:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: #142d38;
  background: #f9f8f3;
  --paper: #fffef9;
  --ink: #153f4b;
  --accent: #11685b;
  --line: #dedfd5;
  --muted: #51645f;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  color: white;
  padding: calc(7px + env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) 7px
    max(16px, env(safe-area-inset-left));
  min-height: 48px;
  z-index: 2;
}
.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand > span:last-child {
  font-weight: 500;
  font-size: 0.86rem;
  color: #d5e8e4;
  margin-left: 3px;
}
.brand-icon {
  display: grid;
  place-items: center;
  border: 1px solid #b8ddcf;
  border-radius: 7px;
  width: 26px;
  height: 26px;
  color: #c6e4be;
}
button,
select {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
a:focus-visible,
.timeline:focus-visible {
  outline: 3px solid #ce7915;
  outline-offset: 2px;
}
header button {
  color: white;
  background: transparent;
  border: 1px solid #719295;
  border-radius: 15px;
  padding: 5px 12px;
  font-size: 0.8rem;
}
#status {
  max-width: 34rem;
  margin: auto;
  padding: 24px;
}
#status p {
  line-height: 1.7;
  color: var(--muted);
}
#status a {
  display: block;
  padding: 12px 0;
  color: var(--accent);
}
#trip {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  grid-template-areas: "sheet map";
}
.map-side {
  grid-area: map;
  position: relative;
  min-height: 0;
}
#map {
  position: absolute;
  inset: 0;
  background: #e6e9df;
}
#tile-status {
  position: absolute;
  z-index: 500;
  bottom: 22px;
  left: 10px;
  background: var(--paper);
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
}
.sheet {
  grid-area: sheet;
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: var(--paper);
  z-index: 1;
}
.sheet-head {
  padding: 23px 19px 13px;
  border-bottom: 1px solid var(--line);
}
#dates,
.day-label,
.entry-time {
  font-variant-numeric: tabular-nums;
}
#dates,
.day-label {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 650;
}
h1 {
  margin: 5px 0 13px;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.28;
  letter-spacing: -0.04em;
}
.toolbar,
#days {
  display: flex;
  align-items: center;
  gap: 4px;
}
#days {
  overflow-x: auto;
  scrollbar-width: thin;
}
.toolbar {
  justify-content: space-between;
}
.toolbar button,
.toolbar select {
  font-size: 0.82rem;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 0 10px;
  white-space: nowrap;
  background: transparent;
  color: var(--muted);
}
.toolbar button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.toolbar select {
  background: #ededdf;
  color: var(--ink);
  max-width: 7em;
}
.grip {
  display: none;
}
.timeline {
  overflow: auto;
  padding: 0 18px max(20px, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
.day-label {
  padding: 18px 0 7px;
  color: var(--accent);
}
.entry {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  padding: 10px 9px 11px;
  background: transparent;
  color: inherit;
  border-radius: 2px;
}
.entry[aria-pressed="true"] {
  background: #e7f1e9;
  border-left-color: var(--accent);
}
.entry-time {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 650;
}
.entry strong {
  display: block;
  margin: 4px 0;
  font-weight: 650;
  font-size: 1rem;
}
.entry small,
.entry p {
  color: var(--muted);
  line-height: 1.55;
}
.entry p {
  font-size: 0.875rem;
  margin: 6px 0 0;
}
.pin {
  border: 0;
  background: none;
}
.pin b {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  border: 2px solid white;
  box-shadow: 0 2px 5px #183c4366;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font: 700 12px/1 system-ui;
}
.pin.selected b {
  background: #a24a18;
}
.leaflet-tooltip.place-label,
.leaflet-tooltip.leg-label {
  border: 1px solid #d3d8cc;
  background: #fffef9f5;
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 3px #23393120;
}
.leaflet-tooltip.leg-label {
  color: #90421c;
}
.leaflet-container {
  font: inherit;
}
.leaflet-control-attribution {
  font-size: 10px;
}
@media (max-width: 720px) {
  #trip {
    grid-template-columns: 100%;
    grid-template-rows: minmax(0, 1fr) minmax(0, 43%);
    grid-template-areas: "map" "sheet";
  }
  #trip.expanded {
    grid-template-rows: minmax(0, 1fr) minmax(0, 70%);
  }
  .sheet {
    border-radius: 18px 18px 0 0;
    position: relative;
    margin-top: -8px;
    box-shadow: 0 -2px 10px #203d4118;
    z-index: 450;
  }
  .sheet-head {
    padding: 0 15px 7px;
  }
  .grip {
    height: 20px;
    width: 100%;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
  }
  .grip:before {
    content: "";
    height: 4px;
    width: 42px;
    background: #becbc4;
    border-radius: 6px;
  }
  h1 {
    margin: 3px 0 8px;
  }
  .timeline {
    padding-inline: 12px;
  }
  .day-label {
    padding-top: 10px;
  }
  .toolbar button,
  .toolbar select {
    min-height: 40px;
  }
  .leaflet-bottom {
    bottom: 8px;
  }
}
@media (max-height: 540px) and (min-width: 550px) {
  #trip,
  #trip.expanded {
    grid-template-columns: 46% 54%;
    grid-template-rows: 100%;
    grid-template-areas: "sheet map";
  }
  .sheet {
    margin: 0;
    border-radius: 0;
  }
  .grip {
    display: none;
  }
  .sheet-head {
    padding: 7px 12px;
  }
}
