:root {
  --blue: #0754b8;
  --ink: #172033;
  --muted: #637087;
  --line: #dce3ec;
  --surface: #fff;
  --page: #f4f7fb;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow-x: hidden;
}
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--page);
  letter-spacing: 0;
}
button {
  font: inherit;
  cursor: pointer;
}
.trip-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.trip-header h1 {
  margin: 0;
  min-width: 0;
  font-size: 21px;
  color: #083b79;
}
.trip-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}
.stories-workspace {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
}
.stories-sidebar {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px;
}
.stories-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.stories-heading h2 {
  margin: 0;
  font-size: 19px;
  color: #083b79;
}
.stories-heading span {
  color: var(--muted);
  font-size: 13px;
}
.stories-notice {
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  margin: 8px 0 18px;
}
.story-list {
  display: grid;
  gap: 8px;
}
.story-list button {
  width: 100%;
  padding: 13px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}
.story-list button.active {
  border-color: var(--blue);
  background: #eaf3ff;
  box-shadow: inset 3px 0 var(--blue);
}
.story-list strong,
.story-list span {
  display: block;
}
.story-list strong {
  font-size: 15px;
  line-height: 1.3;
}
.story-list span {
  color: var(--muted);
  margin-top: 5px;
  font-size: 12px;
}
.story-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.story-map {
  min-width: 0;
  min-height: 260px;
  flex: 1 1 52%;
  background: #dce8f0;
}
.story-detail-content {
  min-width: 0;
  flex: 1 1 48%;
  min-height: 170px;
  overflow-y: auto;
  background: #fff;
  padding: 20px 26px;
}
.story-detail-content h2 {
  margin: 0 0 6px;
  font-size: 21px;
  color: #083b79;
}
.story-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 15px 0;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.story-stats div {
  min-width: 100px;
}
.story-stats strong,
.story-stats span {
  display: block;
}
.story-stats span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.timeline {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 14px;
  border-left: 2px solid #b7cce5;
}
.timeline li {
  position: relative;
  padding: 0 0 17px 18px;
}
.timeline li:before {
  content: "";
  position: absolute;
  left: -21px;
  top: 2px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--blue);
  background: #fff;
  border-radius: 50%;
}
.timeline li:last-child {
  padding-bottom: 0;
}
.timeline strong,
.timeline time {
  display: block;
}
.timeline time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.empty-copy {
  color: var(--muted);
  line-height: 1.5;
}
.live-workspace {
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  position: relative;
}
.live-map {
  position: absolute;
  inset: 0;
  background: #dce8f0;
}
.live-summary {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 2;
  width: min(440px, calc(100% - 40px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 7px 28px rgba(20, 43, 71, 0.23);
}
.live-summary h1 {
  margin: 0;
  font-size: 20px;
  color: #083b79;
  overflow-wrap: anywhere;
}
.live-summary p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.live-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.live-metrics strong,
.live-metrics span {
  display: block;
}
.live-metrics strong {
  font-size: 17px;
}
.live-metrics span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.progress-track {
  height: 6px;
  margin-top: 16px;
  background: #dce3ec;
  border-radius: 4px;
  overflow: hidden;
}
.progress-track div {
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width 0.5s ease;
}
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #083b79;
  font-size: 17px;
  font-weight: 700;
}
.live-indicator i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #168a4f;
}
#liveUpdated {
  color: var(--muted);
  font-size: 12px;
}
.trip-location-marker {
  width: 18px;
  height: 18px;
  background: #1769e8;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(23, 105, 232, 0.2),
    0 2px 6px #3338;
}
.trip-destination-marker {
  color: #d63838;
  font-size: 28px;
  text-shadow: 0 2px 3px #fff;
}
.map-credits {
  flex: 0 0 auto;
  min-height: 20px;
  display: none;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 8px;
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font:
    10px/1.25 Arial,
    sans-serif;
}
.map-credits .maplibregl-ctrl-attrib {
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  font: inherit;
}
.map-credits .maplibregl-ctrl-attrib-inner {
  white-space: normal;
  text-align: right;
}
.map-credits .maplibregl-ctrl-attrib a {
  color: var(--blue);
}
@media (max-width: 820px) {
  .trip-header {
    width: 100vw;
    max-width: 100vw;
    min-height: 54px;
    padding: 8px 14px;
  }
  .trip-header h1 {
    font-size: 18px;
  }
  .stories-workspace {
    width: 100vw;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .stories-sidebar {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    max-height: 27dvh;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stories-notice {
    margin: 4px 0 8px;
  }
  .story-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  .story-list button {
    flex: 0 0 220px;
  }
  .story-detail {
    width: 100%;
    max-width: 100%;
    flex: 1;
    overflow: hidden;
  }
  .story-map {
    flex: 1 1 48%;
    min-height: 190px;
  }
  .story-detail-content {
    flex: 1 1 52%;
    padding: 15px;
  }
  .map-credits {
    font-size: 9px;
    padding: 2px 6px;
  }
  .live-summary {
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 8px 8px 0 0;
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  }
}
