/* The hike tracker (site/hike.html, since 2026-10-24): a full-screen map
   for a phone in the hand. The drive page's look by copy - dark chrome
   that stays out of the map, Gaia-style stat cells (a small label over a
   bold figure), white square buttons - cut down to what a walk needs. */

:root {
  --hike-ink: #f2f6f3;
  --hike-muted: #b9c8bf;
  --hike-bg: rgba(14, 24, 18, 0.92);
  --hike-green: #2e8b40;
  --hike-red: #d9342b;
  --hike-amber: #d9961a;
  --hike-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top-h: 62px;
  --stats-h: 70px;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #0e1812;
  color: var(--hike-ink);
  font-family: var(--hike-font);
  font-size: 16px;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

#map {
  position: fixed;
  inset: 0;
  background: #0e1812;
}

/* Heading-up: the map drawn as a square larger than the screen's diagonal,
   rotated by minus the heading; the fixed chrome stays upright. */
.hike-heading-up #map {
  inset: auto;
  left: 50%;
  top: 50%;
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%) rotate(var(--map-rot, 0deg));
  transform-origin: center center;
  transition: transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.hike-heading-up .leaflet-control-container {
  display: none;
}

.hike-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* ---- Header ---- */
#hike-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px;
  background: var(--hike-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

#hike-exit,
#hike-menu-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--hike-ink);
  text-decoration: none;
  cursor: pointer;
}

#hike-exit .hike-icon,
#hike-menu-btn .hike-icon {
  width: 22px;
  height: 22px;
}

#hike-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#hike-title:active {
  opacity: 0.7;
}

#hike-label {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hike-sub {
  font-size: 13px;
  color: var(--hike-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Weather alert under the header ---- */
#hike-wx {
  position: fixed;
  left: 10px;
  right: 10px;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + var(--stats-h) + 10px);
  z-index: 1001;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--hike-amber);
  color: #111;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

#hike-wx.hike-wx-warning {
  background: var(--hike-red);
  color: #fff;
}

#hike-wx[hidden] {
  display: none;
}

#hike-off {
  position: fixed;
  left: 10px;
  right: 10px;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + var(--stats-h) + 10px);
  z-index: 1002;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--hike-amber);
  color: #111;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

#hike-wx:not([hidden]) ~ #hike-off {
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + var(--stats-h) + 58px);
}

#hike-off[hidden] {
  display: none;
}

/* ---- The trail block at the top of the strip ---- */
#hike-trail {
  padding: 0 2px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 2px;
}

#hike-trail[hidden] {
  display: none;
}

#hike-trail-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hike-trail-line {
  font-size: 13px;
  color: var(--hike-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hike-trail-line.hike-trail-off {
  color: var(--hike-amber);
}

#hike-trail-profile {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 3px;
}

#hike-trail-profile[hidden] {
  display: none;
}

/* ---- Trailhead pins and the trail's rows on the sheet ---- */
.hike-th-pin {
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #b5451b;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.hike-trail-facts {
  margin: 0 0 6px;
}

.hike-trail-facts strong {
  display: block;
  font-size: 16px;
}

.hike-row-dist {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--hike-muted);
  padding-left: 8px;
}

/* ---- The stat strip under the header ---- */
#hike-stats {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h));
  left: 0;
  right: 0;
  z-index: 999;
  padding: 6px 10px 0;
  background: var(--hike-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.hike-cells {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.hike-cell {
  flex: 1 1 0;
  min-width: 0;
  padding: 2px 4px 4px;
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.hike-cell:first-child {
  border-left: 0;
}

.hike-cell-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hike-muted);
}

.hike-cell-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.hike-cell-unit {
  display: block;
  font-size: 10px;
  color: var(--hike-muted);
}

#hike-stats-more {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 4px;
  padding-top: 6px;
}

#hike-stats-more[hidden] {
  display: none;
}

.hike-line {
  margin: 6px 2px 0;
  font-size: 13px;
  color: var(--hike-muted);
}

.hike-line:empty {
  display: none;
}

.hike-where {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 2px 4px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.hike-where[hidden] {
  display: none;
}

.hike-where-text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
}

.hike-mini {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--hike-ink);
  cursor: pointer;
}

.hike-mini .hike-icon {
  width: 20px;
  height: 20px;
}

#hike-stats-toggle {
  display: block;
  width: 100%;
  padding: 4px 0 6px;
  border: 0;
  background: none;
  cursor: pointer;
}

.hike-grabber {
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

/* ---- Status line above the controls ---- */
#hike-status {
  position: fixed;
  left: 10px;
  right: 76px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  z-index: 999;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--hike-bg);
  font-size: 14px;
  line-height: 1.35;
  pointer-events: none;
}

#hike-status:empty {
  display: none;
}

#hike-status .hike-status-main {
  font-weight: 700;
  font-size: 15px;
}

#hike-status .hike-status-sub {
  color: var(--hike-muted);
  font-size: 13px;
}

#hike-status.hike-status-warn .hike-status-main {
  color: #ffd166;
}

/* ---- The stack (lower left) and the controls (lower right) ---- */
#hike-stack {
  position: fixed;
  left: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 150px);
  z-index: 1001;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.hike-stack-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #1f2a24;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.hike-stack-btn[hidden] {
  display: none;
}

.hike-stack-btn[aria-pressed="true"] {
  color: #1f7a3d;
}

#hike-controls {
  position: fixed;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 1001;
  display: flex;
  gap: 10px;
}

.hike-btn {
  min-height: 46px;
  padding: 8px 14px;
  border: 2px solid #fff;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.hike-btn-primary {
  background: var(--hike-green);
  border-color: var(--hike-green);
  color: #fff;
}

.hike-btn-primary.hike-btn-stop {
  background: var(--hike-red);
  border-color: var(--hike-red);
}

.hike-btn[hidden] {
  display: none;
}

#hike-controls .hike-btn {
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#hike-controls .hike-btn .hike-icon {
  width: 28px;
  height: 28px;
}

/* The id rule above outranks .hike-btn[hidden]; without this Pause showed
   before the first Start (the drive page's trap, found in the smoke). */
#hike-controls .hike-btn[hidden] {
  display: none;
}

/* ---- Yes/No ---- */
#hike-confirm {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  z-index: 1360; /* over the photo viewer too (its Delete asks here) */
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  color: #111;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

#hike-confirm[hidden] {
  display: none;
}

#hike-confirm-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}

#hike-confirm-text {
  margin: 0 0 8px;
  color: #444;
}

.hike-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- The name box ---- */
#hike-namebox {
  position: fixed;
  left: 10px;
  right: 10px;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + var(--stats-h) + 12px);
  z-index: 1250;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  color: #111;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

#hike-namebox[hidden] {
  display: none;
}

#hike-namebox-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}

#hike-namebox-text {
  margin: 0 0 8px;
  color: #444;
}

#hike-namebox-text:empty {
  display: none;
}

#hike-namebox-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid #b7bdb9;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 17px;
}

#hike-namebox-input:focus {
  outline: 2px solid var(--hike-green);
  outline-offset: 1px;
}

/* ---- Toast ---- */
#hike-toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + var(--stats-h) + 12px);
  z-index: 1370;
  max-width: calc(100% - 40px);
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  pointer-events: none;
}

#hike-toast[hidden] {
  display: none;
}

/* ---- Dark screen ---- */
#hike-darkscreen {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #000;
  color: #8a9a90;
  text-align: center;
  cursor: pointer;
}

#hike-darkscreen[hidden] {
  display: none;
}

.hike-dark-big {
  font-size: 44px;
  font-weight: 800;
  color: #b8c6bd;
  font-variant-numeric: tabular-nums;
}

.hike-dark-line {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.hike-dark-status {
  font-size: 15px;
  color: #5f7067;
}

.hike-dark-hint {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  font-size: 13px;
  color: #45534b;
}

/* ---- Sheets ---- */
.hike-sheet {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  overflow-y: auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  background: #0e1812;
}

.hike-sheet[hidden] {
  display: none;
}

.hike-sheet h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.hike-sheet h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hike-muted);
}

.hike-sheet a {
  color: #9fd4ad;
}

.hike-sheet-lead,
.hike-sheet-note {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--hike-muted);
  line-height: 1.45;
}

.hike-muted {
  color: var(--hike-muted);
  font-size: 14px;
}

.hike-h3 {
  margin: 12px 0 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hike-muted);
}

a.hike-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  box-sizing: border-box;
}

.hike-section {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hike-section > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hike-section > summary::-webkit-details-marker {
  display: none;
}

.hike-section > summary::after {
  content: "\203A";
  margin-left: auto;
  padding-left: 8px;
  font-size: 22px;
  line-height: 1;
  color: var(--hike-muted);
  transition: transform 0.15s;
}

.hike-section[open] > summary::after {
  transform: rotate(90deg);
}

.hike-section-sum {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--hike-muted);
}

.hike-section[open] > summary .hike-section-sum {
  display: none;
}

.hike-show {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hike-show-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.hike-show-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.hike-show-item select,
.hike-field input[type="text"] {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #3a4740;
  border-radius: 8px;
  background: #1d2420;
  color: var(--hike-ink);
  font: inherit;
}

.hike-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}

.hike-field label {
  font-size: 13px;
  color: var(--hike-muted);
}

.hike-link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: #9fd4ad;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.hike-sheet .hike-btn {
  min-height: 40px;
  padding: 6px 12px;
  font-size: 14px;
  box-shadow: none;
}

.hike-sheet .hike-btn-danger {
  border-color: var(--hike-red);
  background: #fff;
  color: var(--hike-red);
}

#hike-resume {
  width: 100%;
  margin: 4px 0 8px;
}

/* The summary of this hike and the rows of saved hikes. */
.hike-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  margin: 8px 0 10px;
  font-size: 15px;
}

.hike-summary dt {
  font-size: 12px;
  color: var(--hike-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hike-summary dd {
  margin: 0 0 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hike-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--hike-ink);
  text-align: left;
}

.hike-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.hike-row-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hike-row-sub {
  font-size: 13px;
  color: var(--hike-muted);
}

.hike-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}

/* ---- Terms ---- */
.hike-terms {
  z-index: 1300;
  top: 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
}

.hike-terms-lead {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.45;
}

.hike-terms-list {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.45;
}

.hike-terms-list li {
  margin-bottom: 8px;
}

#hike-terms-ok {
  width: 100%;
  margin-top: 8px;
}

/* ---- Markers ---- */
.hike-me {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}

.hike-me svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.hike-start-pin {
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1f7a3d;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ---- Type size ---- */
.hike-type-large #hike-stats,
.hike-type-large #hike-status {
  zoom: 1.2;
}

/* ---- Phase 3: the way back, waypoints, photos, the account ---- */
#hike-back {
  padding: 2px 2px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 2px;
}

#hike-back[hidden] {
  display: none;
}

.hike-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hike-back-arrow {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  fill: #f0c24b;
  stroke: #f0c24b;
  stroke-width: 1.5;
  stroke-linejoin: round;
  transform-origin: center center;
  transition: transform 0.4s ease-out;
}

.hike-back-text {
  flex: 1 1 auto;
  min-width: 0;
}

#hike-back-main {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

#hike-back-sub {
  font-size: 12px;
  color: var(--hike-muted);
  line-height: 1.25;
}

.hike-mini-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: transparent;
  color: var(--hike-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.hike-mini-btn[aria-pressed="true"] {
  background: #f0c24b;
  border-color: #f0c24b;
  color: #111;
}

/* Waypoint pins: numbered, a dot when there are photos. */
.hike-wp-pin {
  position: relative;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #7a3fb0;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}

.hike-wp-pin-photo::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f0c24b;
  border: 2px solid #fff;
}

/* The waypoint box, under the strip like the name box. */
#hike-wpbox {
  position: fixed;
  left: 10px;
  right: 10px;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + var(--stats-h) + 12px);
  max-height: calc(100vh - env(safe-area-inset-top, 0px) - var(--top-h) - var(--stats-h) - 110px);
  overflow-y: auto;
  z-index: 1250;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  color: #111;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

#hike-wpbox[hidden] {
  display: none;
}

#hike-wpbox-title {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 800;
}

#hike-wpbox-where {
  margin: 0 0 8px;
  color: #444;
  font-size: 13px;
}

#hike-wpbox-name,
#hike-wpbox-note {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid #b7bdb9;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 16px;
}

#hike-wpbox-note {
  resize: vertical;
}

#hike-wpbox-name:focus,
#hike-wpbox-note:focus,
#hike-signin-email:focus {
  outline: 2px solid var(--hike-green);
  outline-offset: 1px;
}

#hike-wpbox-photos {
  margin: 0 0 8px;
}

.hike-wp-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.hike-wp-strip:empty {
  display: none;
}

.hike-wp-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #e4e9e6;
  cursor: pointer;
}

.hike-wp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hike-wp-clip::after {
  content: "\25B6";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.hike-wp-waiting,
.hike-wp-signin {
  margin: 0;
  font-size: 13px;
  color: #555;
}

.hike-wp-adds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hike-wp-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 14px;
  box-shadow: none;
  border-color: #b7bdb9;
  cursor: pointer;
}

.hike-wp-add .hike-icon {
  width: 20px;
  height: 20px;
}

/* The photo viewer: full screen, the box scrolls, a × at the top right. */
#hike-photo-view {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  touch-action: pan-y;
}

.hike-view-box {
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 48px 12px 16px;
  box-sizing: border-box;
  text-align: center;
}

.hike-view-box img,
.hike-view-box video {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  margin: 0 auto;
  border-radius: 6px;
  background: #000;
}

.hike-view-caption {
  margin: 10px 0;
  color: #d5ddd8;
  font-size: 14px;
}

.hike-view-box .hike-actions {
  justify-content: center;
}

.hike-view-close,
.hike-view-arrow {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.hike-view-close {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 10px;
}

.hike-view-arrow {
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
}

.hike-view-prev {
  left: 6px;
}

.hike-view-next {
  right: 6px;
}

/* The sign-in form in About. */
.hike-signin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}

#hike-signin-email {
  flex: 1 1 180px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #3a4740;
  border-radius: 8px;
  background: #1d2420;
  color: var(--hike-ink);
  font: inherit;
}

/* ---- Sheet open: the map chrome steps back ---- */
.hike-sheet-open #hike-wx,
.hike-sheet-open #hike-off,
.hike-sheet-open #hike-confirm,
.hike-sheet-open #hike-namebox,
.hike-sheet-open #hike-wpbox,
.hike-sheet-open #hike-toast,
.hike-sheet-open #hike-status {
  display: none;
}

/* ---- Wide screens: the sheet is a column at the left ---- */
@media (min-width: 900px) and (min-height: 600px) {
  .hike-sheet {
    right: auto;
    width: 560px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
  }

  #hike-namebox,
  #hike-wpbox {
    right: auto;
    width: 560px;
  }
}
