:root {
  color-scheme: light;
  --ink: #1b1a17;
  --muted: #5f584f;
  --sand: #f3e2c4;
  --clay: #d8b389;
  --pine: #1f3f3a;
  --river: #0b3b4a;
  --amber: #e59f3f;
  --rose: #c85a3c;
  --cream: #fdf7ed;
  --card: rgba(255, 249, 236, 0.9);
  --shadow: 0 18px 40px rgba(14, 20, 17, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Futura", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 243, 213, 0.9), transparent 60%),
    linear-gradient(130deg, #f3d4a0, #e5c39a 40%, #cfa87a 100%);
  min-height: 100vh;
}

.page {
  padding: 32px 48px 60px;
  max-width: 1280px;
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 24px 28px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: rise 800ms ease-out both;
}

.hero-actions {
  display: flex;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  font-weight: 700;
  color: var(--pine);
  margin: 0 0 12px;
}

h1 {
  font-family: "Rockwell", "Avenir Next", sans-serif;
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  margin: 0 0 8px;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 16px;
  text-align: right;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--pine);
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 32px;
}

.map-panel {
  display: flex;
  flex-direction: column;
}

.map-shell {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.map-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.form-panel {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  width: min(360px, 92%);
  max-height: calc(100% - 36px);
  overflow: auto;
  z-index: 2;
}

.form-panel.is-open {
  display: block;
}

.map-top h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  background: var(--amber);
}

.map-wrapper {
  position: relative;
}

#map {
  width: 100%;
  height: 520px;
  border-radius: 18px;
  overflow: hidden;
  cursor: crosshair;
}

.form-card,
.timeline {
  background: var(--card);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.form-card h3,
.timeline h3 {
  margin-top: 0;
}

.gist-form .form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gist-form button {
  width: 100%;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

input,
textarea,
button {
  font-family: inherit;
}

input,
textarea {
  border: 1px solid rgba(80, 66, 48, 0.25);
  border-radius: 12px;
  padding: 9px 12px;
  background: #fffdf7;
  font-size: 14px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.form-actions .ghost-button {
  padding: 10px 16px;
}

.upload {
  border: 1px dashed rgba(80, 66, 48, 0.35);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 246, 228, 0.8);
}

.upload input {
  border: none;
  padding: 0;
  background: transparent;
}

.upload span {
  font-size: 12px;
  color: var(--muted);
}

button {
  background: var(--pine);
  color: #fef6e8;
  border: none;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(21, 18, 14, 0.18);
}

.helper {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.timeline-header p {
  margin: 0 0 8px;
  color: var(--muted);
}

.timeline-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#stopList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.stop-card {
  background: #fff9f0;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  border-left: 4px solid var(--amber);
  animation: fade 400ms ease-out both;
}

.stop-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.ghost-button {
  border: 1px solid rgba(80, 66, 48, 0.3);
  background: transparent;
  color: var(--pine);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button.danger {
  border-color: rgba(200, 90, 60, 0.6);
  color: var(--rose);
}

.stop-card.active {
  border-left-color: var(--rose);
  box-shadow: inset 0 0 0 1px rgba(200, 90, 60, 0.35);
}

.stop-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.stop-title {
  font-weight: 700;
  margin: 0;
}

.stop-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.stop-details {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 245, 227, 0.9);
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
}


@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-stats {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .map-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .page {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .map-top {
    flex-direction: column;
    align-items: flex-start;
  }

  #map {
    height: 360px;
  }

  .form-panel {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 16px;
  }
}
.timeline.full {
  padding-bottom: 28px;
}

.sync-panel {
  border: none;
}

.sync-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--pine);
  margin-bottom: 12px;
}

.sync-panel .form-card {
  margin-top: 12px;
}
