:root {
  color-scheme: dark;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background: #111;
  color: #f5f5f5;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
#app {
  position: fixed;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #111;
}
#map {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
#panel {
  width: 300px;
  height: 100%;
  overflow: hidden;
  background: #171717;
  border-left: 1px solid #3f3f46;
}
#app.panel-hidden #panel {
  display: none;
}
#panel-scroll {
  height: 100%;
  overflow: auto;
  padding: 16px;
}
#controls {
  position: absolute;
  z-index: 4;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #52525b;
  border-radius: 12px;
  background: rgba(23, 23, 23, 0.94);
  box-shadow: 0 6px 18px #0008;
}
#toggle-panel {
  margin-left: 0;
}
select,
input,
button {
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #52525b;
  border-radius: 8px;
  background: #27272a;
  color: #f5f5f5;
  font: inherit;
}
#search {
  width: 190px;
  margin-left: auto;
}
button {
  cursor: pointer;
}
button.active {
  background: #2563eb;
  border-color: #60a5fa;
}
h1 {
  margin: 0 0 4px;
  font-size: 20px;
}
h2 {
  margin: 0 0 14px;
  font-size: 13px;
  color: #a1a1aa;
  font-weight: 500;
}
.item {
  padding: 11px 0;
  border-bottom: 1px solid #2f2f35;
  cursor: pointer;
}
.item:hover {
  background: #202027;
}
.route {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 750;
  font-size: 13px;
}
.node {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 10px;
}
.roadtrip-node {
  background: #f59e0b;
}

.hotel-node {
  background: #3070c8;
}
.meta {
  margin-top: 4px;
  color: #a1a1aa;
  font-size: 11px;
}
.journey-legs {
  display: grid;
  gap: 4px;
  margin: 9px 0 2px 27px;
}
.journey-leg {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid #3f3f46;
  border-radius: 7px;
  background: #202027;
  font-size: 11px;
}
.journey-leg .meta {
  margin: 1px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.journey-item.editing {
  cursor: default;
}
.journey-item.editing.selected {
  border-left: 3px solid #60a5fa;
  padding-left: 8px;
  background: #1d2a42;
}
.journey-item.editing.focused {
  outline: 2px solid #fbbf24;
  outline-offset: -2px;
}
.journey-item.editing .journey-leg {
  cursor: grab;
  border-style: dashed;
}
.journey-item.editing .journey-leg:active {
  cursor: grabbing;
}
.passenger-badge {
  margin-left: 6px;
  font-size: 0.9em;
  white-space: nowrap;
}
.journey-leg.drag-over,
.journey-legs.drag-over {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}
.journey-edit-hint {
  margin: 0 0 10px;
  color: #93c5fd;
  font-size: 11px;
  line-height: 1.35;
}
.journey-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.journey-edit-actions button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 11px;
}
.journey-select {
  margin-left: auto;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 500;
}
.journey-select input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  vertical-align: middle;
}
#status {
  position: absolute;
  z-index: 3;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  padding: 6px 9px;
  border-radius: 8px;
  background: #171717dd;
  color: #a1a1aa;
  font-size: 11px;
}
@media (max-width: 700px) {
  #panel {
    width: 300px;
  }
}
#notice {
  position: absolute;
  z-index: 5;
  left: 12px;
  bottom: 44px;
  max-width: min(90%, 500px);
  background: #171717ee;
  color: #fbbf24;
  font-size: 12px;
  padding: 0 8px;
  border-radius: 6px;
}
#notice:empty {
  display: none;
}
#panel-scroll {
  padding-top: calc(var(--controls-height, 50px) + 24px);
}
.item:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: -2px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.journey-edit-actions {
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  #panel {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 45%;
    border-left: 0;
    border-top: 1px solid #52525b;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px #0006;
  }
  #panel-scroll {
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  }
  #controls {
    gap: 5px;
    padding: 7px;
  }
  #controls button {
    min-width: 34px;
    padding: 5px 7px;
  }
  #year {
    width: 100px;
  }
  #search {
    flex: 1;
    min-width: 150px;
    width: auto;
  }
  #status {
    max-width: calc(100% - 80px);
  }
  #app:not(.panel-hidden) #status {
    bottom: calc(45% + 8px);
  }
  #app:not(.panel-hidden) #notice {
    bottom: calc(45% + 40px);
  }
}

#timeline-bars { padding-bottom: 18px; box-sizing: content-box; }
#timeline-bars .timeline-bar { min-height: 0; min-width: 0; margin-bottom: 0; }
#app:not(.panel-hidden) #timeline { right: 316px; }
@media (max-width: 700px) {
  #app:not(.panel-hidden) #timeline { right: 8px; bottom: calc(45% + 8px); }
}

.journey-move-controls {
  margin-bottom: 12px;
  font-size: 12px;
}
.journey-move-controls label {
  display: block;
  margin: 8px 0;
}
.journey-move-controls select {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 4px 0;
}
#controls{left:auto;right:12px;width:auto;padding:0;border:0;background:none;box-shadow:none;gap:8px}#controls #reset[hidden]{display:none}#panel{display:flex;flex-direction:column}#panel-tools{position:relative;z-index:1;padding:12px 12px 10px;background:#171717;border-bottom:1px solid #3f3f46}#panel-tools #search{width:100%;margin:0}.panel-filter-row{display:flex;gap:6px;align-items:center;margin-top:8px}.panel-filter-row button{min-width:34px;padding:5px 7px}#panel-scroll{height:auto;flex:1;min-height:0}#timeline{position:fixed;z-index:4;left:16px;right:16px;bottom:12px;padding:5px 10px 3px;background:#18181bf2;border:1px solid #3f3f46;border-radius:10px;color:#e4e4e7;box-shadow:0 8px 24px #0008}#timeline-label{height:20px;text-align:center;font-size:18px;line-height:20px;font-weight:700;letter-spacing:.08em;color:#f4f4f5}#timeline-bars{display:flex;align-items:end;gap:2px;height:40px;overflow:hidden}.timeline-bar{position:relative;flex:1;min-width:0;height:40px;padding:0!important;border:0!important;border-radius:2px!important;background:linear-gradient(to top,#52525b var(--activity),transparent var(--activity))!important}.timeline-bar.active,.timeline-bar:hover,.timeline-bar:focus-visible{background:linear-gradient(to top,#6366f1 var(--activity),#6366f126 var(--activity))!important;outline:1px solid #818cf8}.timeline-bar span{position:absolute;bottom:0;left:50%;transform:translateX(-50%);font-size:9px;color:#a1a1aa}.timeline-bar{margin-bottom:0}@media(min-width:701px){#app:not(.panel-hidden) #timeline{right:316px}}@media(max-width:700px){#timeline{left:8px;right:8px;bottom:8px}#app:not(.panel-hidden) #timeline{right:8px;bottom:calc(45% + 8px)}#panel-tools{padding:10px}.panel-filter-row{flex-wrap:wrap}}
