/* The timeline is one calm, tactile surface on top of the cartography. */
#map-explorer {
  position: absolute;
  z-index: 5;
  left: 360px;
  right: 28px;
  bottom: 30px;
  display: grid;
  justify-items: stretch;
  pointer-events: none;
  color: #382b30;
  font: 13px/1.4 var(--font, system-ui, sans-serif);
  --ce-accent: #6d394b;
}
#map-explorer button,
#map-explorer input {
  font: inherit;
}
#map-explorer svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ce-launcher,
.ce-panel {
  pointer-events: auto;
  border: 1px solid #dedbd2;
  background: #f8f7ef;
  border-radius: 4px;
  box-shadow: 0 4px 16px #382b3008;
}
.ce-launcher {
  justify-self: center;
  display: flex;
  gap: 4px;
  padding: 7px;
}
.ce-launch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 8px 16px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #867d7b;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  transition:
    background 0.18s,
    color 0.18s;
}
.ce-launch:first-child {
  color: #382b30;
  background: #eeece3;
}
.ce-launch:hover {
  color: #6d394b;
  background: #efebe1;
}
.ce-panel {
  width: 100%;
  padding: 17px 20px 12px;
  max-height: var(--ce-max-height, 380px);
  overflow: auto;
  overscroll-behavior: contain;
}
.ce-head,
.ce-modes,
.ce-transport,
.ce-steps,
.ce-journey,
.ce-foot,
.ce-month-summary {
  display: flex;
  align-items: center;
}
.ce-head {
  gap: 12px;
}
.ce-heading {
  min-width: 140px;
  flex: 1;
}
.ce-head h3 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
.ce-scope {
  font-size: 10px;
  color: #867d7b;
  line-height: 1.35;
}
.ce-modes {
  gap: 3px;
  padding: 3px;
  background: #edeae2;
  border-radius: 3px;
}
.ce-mode,
.ce-depth,
.ce-square,
.ce-play,
.ce-retry {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  transition:
    background 0.16s,
    box-shadow 0.16s,
    color 0.16s;
}
.ce-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 3px;
  padding: 6px 10px;
  min-height: 29px;
  font-size: 11px !important;
  font-weight: 560 !important;
  color: #867d7b;
}
.ce-mode-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
}
.ce-mode[aria-pressed="true"] {
  color: #382b30;
  background: #f8f7ef;
  box-shadow: 0 0 0 1px #dedbd2;
}
.ce-mode[aria-pressed="true"] .ce-mode-dot {
  background: var(--ce-accent);
  opacity: 1;
}
.ce-mode:hover:not(:disabled) {
  color: #382b30;
}
.ce-depth-wrap {
  padding-left: 11px;
  border-left: 1px solid #dedbd2;
}
.ce-depth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 33px;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 11px !important;
  font-weight: 650 !important;
  color: #867d7b;
}
.ce-depth[aria-pressed="true"] {
  background: #6d394b;
  color: #d9df8b;
}
.ce-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 27px;
  border-radius: 3px;
  padding: 0;
  color: #867d7b;
}
.ce-close {
  width: 26px;
  height: 26px;
  margin-right: -5px;
}
.ce-close svg {
  width: 14px !important;
  height: 14px !important;
}
.ce-square:hover:not(:disabled),
.ce-depth:hover:not([aria-pressed="true"]),
.ce-retry:hover {
  background: #eeece3;
  color: #382b30;
}
.ce-square:disabled,
.ce-play:disabled,
.ce-mode:disabled,
.ce-depth:disabled {
  opacity: 0.35;
}
.ce-journey {
  gap: 23px;
  margin-top: 15px;
}
.ce-transport {
  gap: 11px;
  flex-shrink: 0;
  align-self: center;
  padding-bottom: 12px;
}
.ce-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  height: 40px;
  width: 40px;
  border-radius: 3px;
  color: #d9df8b;
  background: #6d394b;
  box-shadow: none;
}
.ce-play:hover:not(:disabled) {
  background: #382b30;
}
.ce-play svg {
  width: 16px !important;
  height: 16px !important;
}
.ce-stamp {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ce-stamp-caption {
  font-size: 9px;
  color: #867d7b;
}
.ce-month {
  display: block;
  color: #382b30;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 630;
  white-space: nowrap;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  text-transform: capitalize;
}
.ce-steps {
  gap: 0;
  margin-left: -5px;
}
.ce-steps svg {
  width: 14px !important;
  height: 14px !important;
}
.ce-timeline {
  flex: 1;
  min-width: 80px;
  position: relative;
  padding-top: 1px;
}
.ce-histogram {
  height: 47px;
  display: grid;
  grid-template-columns: repeat(var(--ce-months, 48), minmax(0, 1fr));
  gap: 3px;
  align-items: stretch;
  border-bottom: 1px solid #dedbd2;
  touch-action: none;
}
.ce-bar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  border: 0;
  border-radius: 1px 1px 0 0;
  padding: 0;
  background: transparent;
  min-width: 0;
  height: 100%;
  cursor: pointer;
}
.ce-bar-fill {
  display: block;
  height: max(2px, var(--ce-bar-height, 0%));
  width: 100%;
  border-radius: 1px 1px 0 0;
  background: #e3dfd5;
  transition: background 0.18s;
}
.ce-bar.is-past .ce-bar-fill {
  background: #cdc6bb;
}
.ce-bar.is-selected .ce-bar-fill {
  background: var(--ce-accent);
  box-shadow: none;
}
.ce-bar.is-selected::after {
  content: "";
  position: absolute;
  top: -5px;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed #6d394b70;
  z-index: -1;
}
.ce-bar:hover .ce-bar-fill {
  background: #bc6547;
}
.ce-bar.is-selected:hover .ce-bar-fill {
  background: #6d394b;
}
.ce-after-gap {
  border-left: 1px dashed #a59b93;
}
.ce-range {
  position: absolute;
  left: 0;
  top: 41px;
  width: 100%;
  height: 10px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  accent-color: var(--ce-accent);
  z-index: 2;
}
.ce-range:focus-visible {
  opacity: 1;
  pointer-events: auto;
  outline: 2px solid #6d394b66;
  outline-offset: 5px;
  border-radius: 4px;
}
.ce-years {
  display: grid;
  grid-template-columns: repeat(var(--ce-months, 48), minmax(0, 1fr));
  margin-top: 6px;
  color: #867d7b;
  font: 9px/1.2 var(--mono, monospace);
}
.ce-years span {
  padding-left: 3px;
  border-left: 1px solid #dedbd2;
}
.ce-bar-tooltip {
  position: absolute;
  z-index: 6;
  bottom: calc(100% + 8px);
  left: clamp(75px, var(--ce-tip-at, 50%), calc(100% - 75px));
  transform: translateX(-50%);
  border-radius: 3px;
  padding: 6px 9px;
  background: #382b30;
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: none;
}
.ce-foot {
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #dedbd2;
  padding-top: 9px;
  margin-top: 11px;
}
.ce-reference {
  margin: 0;
  font-size: 10px;
  color: #867d7b;
}
.ce-month-summary {
  gap: 7px;
  white-space: nowrap;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.ce-month-total {
  color: #867d7b;
}
.ce-month-change {
  font-size: 9px;
  font-weight: 650;
  border-radius: 4px;
  padding: 2px 5px;
  color: #867d7b;
  background: #edeae2;
}
.ce-month-change[data-direction="up"] {
  color: #964d39;
  background: #f2e5db;
}
.ce-month-change[data-direction="down"] {
  color: #536c63;
  background: #e7ece0;
}
.ce-message {
  font-size: 11px;
  line-height: 1.4;
  color: #867d7b;
  padding-block: 6px 0;
}
.ce-message:empty,
.ce-reference:empty,
.ce-month-total:empty,
.ce-month-change:empty {
  display: none;
}
.ce-retry {
  padding: 7px 11px;
  border-color: #dedbd2;
  border-radius: 3px;
  font-size: 11px !important;
  margin-top: 6px;
}
body[data-sidebar="closed"] #map-explorer {
  left: 28px;
}
@media (max-width: 1200px) {
  #map-explorer {
    left: 332px;
    right: 20px;
    bottom: 26px;
  }
  .ce-panel {
    padding-inline: 16px;
  }
  .ce-head {
    gap: 7px;
  }
  .ce-head h3 {
    font-size: 13px;
  }
  .ce-heading {
    min-width: 110px;
  }
  .ce-mode {
    padding-inline: 7px;
  }
  .ce-depth-wrap {
    padding-left: 7px;
  }
  .ce-journey {
    gap: 14px;
  }
  .ce-steps {
    display: none;
  }
}
@media (max-width: 1050px) {
  .ce-scope {
    max-width: 125px;
    font-size: 9px;
  }
  .ce-panel {
    padding: 14px 14px 11px;
  }
  .ce-mode {
    font-size: 10px !important;
    gap: 4px;
    padding-inline: 6px;
  }
  .ce-mode-dot {
    display: none;
  }
  .ce-depth {
    padding-inline: 7px;
  }
  .ce-depth-wrap {
    border: 0;
    padding-left: 0;
  }
  .ce-foot {
    align-items: flex-start;
  }
  .ce-reference {
    max-width: 160px;
    font-size: 9px;
  }
  .ce-month-summary {
    font-size: 9px;
    gap: 5px;
  }
  .ce-transport {
    gap: 8px;
  }
  .ce-play {
    width: 34px;
    height: 34px;
  }
  .ce-month {
    font-size: 13px;
  }
  .ce-histogram {
    gap: 2px;
  }
}
@media (max-width: 850px) {
  #map-explorer {
    left: 20px;
    right: 20px;
    bottom: 24px;
  }
  body[data-sidebar="closed"] #map-explorer {
    left: 20px;
  }
  .ce-scope {
    max-width: none;
  }
  .ce-mode-dot {
    display: inline-block;
  }
  .ce-mode {
    padding-inline: 9px;
  }
  .ce-reference {
    max-width: none;
  }
}
@media (max-width: 600px) {
  #map-explorer,
  body[data-sidebar="closed"] #map-explorer {
    left: 12px;
    right: 12px;
    bottom: 22px;
  }
  .ce-panel {
    border-radius: 4px;
    padding: 12px;
  }
  .ce-head {
    gap: 7px;
    flex-wrap: wrap;
  }
  .ce-heading {
    flex: 1;
    min-width: 120px;
  }
  .ce-modes {
    order: 4;
    flex-basis: 100%;
    justify-content: stretch;
  }
  .ce-mode {
    flex: 1;
    font-size: 11px !important;
    justify-content: center;
  }
  .ce-depth-wrap {
    margin-left: auto;
  }
  .ce-journey {
    gap: 13px;
    margin-top: 12px;
  }
  .ce-stamp-caption {
    font-size: 8px;
  }
  .ce-month {
    font-size: 12px;
  }
  .ce-play {
    width: 31px;
    height: 31px;
  }
  .ce-transport {
    gap: 7px;
  }
  .ce-histogram {
    height: 38px;
    gap: 2px;
  }
  .ce-range {
    top: 32px;
  }
  .ce-years {
    font-size: 8px;
  }
  .ce-foot {
    margin-top: 9px;
    gap: 8px;
  }
  .ce-reference {
    display: none;
  }
  .ce-month-summary {
    width: 100%;
    justify-content: space-between;
    font-size: 10px;
  }
  .ce-launch {
    padding: 7px 10px;
    font-size: 11px !important;
    gap: 5px;
  }
}
@media (pointer: coarse) {
  .ce-mode,
  .ce-depth,
  .ce-square {
    min-height: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #map-explorer *,
  #map-explorer *::after {
    transition: none !important;
  }
}
