:root {
  --ink: #18211d;
  --muted: #5d6a62;
  --paper: #f6f0df;
  --panel: rgba(255, 252, 241, 0.94);
  --line: #d6c9a8;
  --accent: #d96f32;
  --accent-strong: #a6421a;
  --forest: #1e5a43;
  --shadow: 0 24px 70px rgba(36, 42, 32, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body,
.shell,
#map {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 14%, rgba(217, 111, 50, 0.22), transparent 28%),
    linear-gradient(135deg, #173a2f 0%, #f6f0df 48%, #d7a05b 100%);
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 18px;
  padding: 18px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 0.92;
}

.lede,
.hint {
  color: var(--muted);
  line-height: 1.45;
}

.card,
.stats {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
}

label,
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.field label {
  margin-bottom: 0;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(217, 111, 50, 0.2);
  border-color: var(--accent);
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.day-picker {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
}

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

button {
  min-height: 42px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--forest);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff8e8;
  font: inherit;
  font-weight: 700;
}

.day-picker button {
  width: 42px;
  padding: 0;
  border-radius: 13px;
}

button.primary {
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stats div {
  min-width: 0;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-card {
  display: grid;
  gap: 12px;
}

.timeline-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.timeline-heading strong {
  color: var(--forest);
  font-size: 0.94rem;
}

.activityTimeline {
  display: grid;
  gap: 8px;
  min-height: 70px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activityTimeline:empty::before {
  content: "No activities";
  display: block;
  padding: 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.activityItem {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  cursor: pointer;
  border: 1px solid rgba(214, 201, 168, 0.82);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  text-align: left;
}

.activityItem:focus-visible {
  outline: 3px solid rgba(217, 111, 50, 0.24);
}

.activityStripe {
  width: 10px;
  min-height: 100%;
  border-radius: 99px;
  background: var(--accent);
}

.activityItem.stay .activityStripe {
  background: var(--forest);
}

.activityItem.fast .activityStripe {
  background: #2e6fbb;
}

.activityBody {
  min-width: 0;
}

.activityTop,
.activityMeta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.activityType {
  color: var(--ink);
  font-weight: 700;
}

.activityTime,
.activityMeta {
  color: var(--muted);
  font-size: 0.82rem;
}

.activityTime {
  white-space: nowrap;
}

.activityMeta {
  margin-top: 4px;
}

.mapWrap {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

#map {
  min-height: 100%;
}

.floating {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 500;
  max-width: min(520px, calc(100% - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(24, 33, 29, 0.84);
  color: #fff8e8;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.leaflet-container {
  font-family: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100%;
  }

  .panel {
    max-height: none;
  }

  .mapWrap {
    height: 68vh;
  }
}

@media (max-width: 520px) {
  .shell {
    padding: 10px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .grid.two,
  .stats {
    grid-template-columns: 1fr;
  }

  .activityTop,
  .activityMeta {
    display: grid;
    gap: 2px;
  }

  .activityTime {
    white-space: normal;
  }
}
