:root {
  color-scheme: light dark;
  --ink: #1c2430;
  --muted: #526072;
  --line: #d5dde6;
  --card: #ffffff;
  --accent: #0f6b4c;
  font-family: "Segoe UI", sans-serif;
  line-height: 1.45;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eef4;
    --muted: #b7c3d0;
    --line: #314052;
    --card: #15202b;
    --accent: #7dceb0;
  }
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef3f1;
}

h1, h2, p {
  margin-top: 0;
}

.layout {
  display: grid;
  grid-template-rows: minmax(46dvh, 58dvh) auto;
  min-height: 100dvh;
}

.map {
  position: relative;
  height: 42dvh;
  max-height: 42dvh;
  overflow: hidden;
  background: #d5e0db;
}

.map-empty {
  position: absolute;
  z-index: 500;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--card);
  color: var(--ink);
}

.sheet {
  position: relative;
  z-index: 2;
  padding: 1rem 1rem 2rem;
}

.card, .sheet > form, .hint {
  max-width: 36rem;
}

.card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--card);
}

label, button, input, select, textarea {
  font: inherit;
}

label {
  display: block;
  margin: 0.85rem 0 0.3rem;
  color: var(--muted);
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.75rem;
  margin: 0.25rem 0;
  color: var(--ink);
}

input, select, textarea {
  width: min(100%, 36rem);
  min-height: 2.75rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: transparent;
  color: inherit;
}

.choice input {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  padding: 0;
}

textarea {
  min-height: 6.5rem;
}

button {
  min-height: 2.75rem;
  margin-top: 0.8rem;
  padding: 0.4rem 0.9rem;
  border: 0;
  border-radius: 0.7rem;
  background: var(--accent);
  color: #fff;
}

button[type="button"] {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.hint, code {
  color: var(--muted);
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

#device-token {
  width: 100%;
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
  user-select: all;
}

.leaflet-container {
  height: 42dvh;
  width: 100%;
  font: inherit;
}

@media (min-width: 64rem) {
  .layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(24rem, 0.7fr);
    grid-template-rows: 100dvh;
  }

  .sheet {
    overflow: auto;
  }
}

.day-app {
  position: relative;
  height: 100dvh;
  background: #e7e1d6;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.day-app .map {
  height: 100dvh;
  max-height: none;
  min-height: 0;
}

.day-app .sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 96px;
  max-height: 96px;
  overflow: hidden;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 16px 16px 0 0;
  background: #fbf7f1;
  box-shadow: 0 -8px 20px rgba(28, 25, 21, 0.14);
}

.day-app .sheet-body {
  display: none;
}

.day-app.sheet-open .sheet {
  height: auto;
  max-height: 40dvh;
  overflow: auto;
}

.day-app.sheet-open .sheet-body {
  display: block;
  padding-top: 8px;
}

.sheet-handle,
.controls button,
.day-nav a,
.day-nav button {
  min-height: 2.75rem;
  border-radius: 999px;
  border: 1px solid #d9cfc0;
  background: #fff;
  color: #1c1915;
  padding: 0.4rem 0.9rem;
}

.day-app .sheet-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1 1 auto;
  width: 100%;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  border: 0;
  background: transparent;
}

.sheet-summary {
  min-width: 0;
}

.sheet-action {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: #0e7c66;
}

.day-nav,
.controls,
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.day-nav .archive {
  display: none;
  gap: 0.45rem;
  align-items: center;
}

.day-nav .archive.is-open {
  display: flex;
  flex-wrap: wrap;
}

.range-label {
  margin: 0 0 0.25rem;
  color: #5c564e;
  font-size: 12px;
}

.day-axis button {
  color: #fffdf8;
  font-size: 0.62rem;
  overflow: hidden;
}

.day-nav input {
  width: 11.5rem;
  flex: 0 0 auto;
  min-height: 2.75rem;
  border-radius: 999px;
  border: 1px solid #d9cfc0;
  padding: 0 0.7rem;
}

.controls button.is-on,
.day-nav a {
  background: #0e7c66;
  color: #fff;
  border-color: #0e7c66;
  text-decoration: none;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.status-line {
  margin: 0 0 0.35rem;
  font-size: 12px;
  font-weight: 650;
}

.summary p {
  margin: 0;
  padding: 0.7rem 0.75rem;
  border-radius: 0.8rem;
  background: #fff;
  font-size: 1rem;
}

.summary strong {
  display: block;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.legend i {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 99px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.timeline button.row {
  width: 100%;
  min-height: 44px;
  text-align: left;
  border-radius: 0.7rem;
  border: 1px solid #e4dacd;
  background: #fff;
  padding: 0.35rem 0.55rem;
}

.timeline button.row strong {
  display: block;
}

.stay-detail {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.35rem;
}

.stay-detail input,
.stay-detail button {
  min-height: 2.75rem;
}

.here {
  margin: 0 0 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.9rem;
  background: #e5f5ef;
}

.leaflet-div-icon.arrow-icon,
.leaflet-div-icon.time-card-icon,
.leaflet-div-icon.stay-pin-icon {
  background: transparent;
  border: none;
}

.time-tip {
  background: #fff;
  color: #1c1915;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(28, 25, 21, 0.16);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  padding: 0.15rem 0.45rem;
}

.time-tip::before {
  display: none;
}

.stay-pin {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: #fff;
  color: #172554;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 2px solid currentColor;
  box-shadow: 0 4px 12px rgba(23, 37, 84, 0.16);
}

.stay-pin svg {
  display: block;
}

.time-card {
  width: 8.6rem;
  padding: 0.35rem 0.45rem 0.4rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.96);
  color: #1c1915;
  box-shadow: 0 8px 22px rgba(28, 25, 21, 0.16);
  line-height: 1.15;
}

.time-card .kicker {
  display: flex;
  gap: 0.28rem;
  align-items: center;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: #3f3a34;
}

.time-card .range {
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: #5c564e;
}

.time-card .duration {
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.time-card .place {
  font-size: 0.72rem;
  color: #1c1915;
}

.time-card .note {
  font-size: 0.68rem;
  color: #8a5a12;
}

.day-axis {
  display: flex;
  height: 1.15rem;
  margin: 0 0 0.7rem;
  border-radius: 999px;
  overflow: hidden;
  background: #efe8dc;
}

.day-axis button {
  min-width: 4px;
  height: 1.15rem;
  border: 0;
  padding: 0;
  border-radius: 0;
}

.day-axis button.stay { background: #0e7c66; }
.day-axis button.walk { background: #3d7a4a; }
.day-axis button.drive { background: #1d4a73; }
.day-axis button.unknown { background: #8d867c; }
.day-axis button.gap { background: repeating-linear-gradient(90deg, #efe8dc, #efe8dc 3px, #cfc6b8 3px, #cfc6b8 6px); }
.day-axis button.is-on { outline: 2px solid #1c1915; outline-offset: -2px; }

.clock {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.04em;
}

.mix {
  display: flex;
  height: 0.45rem;
  margin: 0 0 0.8rem;
  border-radius: 999px;
  overflow: hidden;
  background: #efe8dc;
}

.mix i { display: block; height: 100%; }
.mix i.stay { background: #0e7c66; }
.mix i.move { background: #1d4a73; }
.mix i.gap { background: #cfc6b8; }

.timeline { gap: 0.35rem; }

.visit {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
}

.visit time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #5c564e;
  padding-top: 0.45rem;
}

.timeline button.row {
  border-radius: 0.95rem;
  box-shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
}

.timeline button.row.is-on {
  border-color: #0e7c66;
  box-shadow: 0 0 0 2px rgba(14, 124, 102, 0.18);
}

.timeline button.row .big {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 700;
}

.speed-chart {
  width: 100%;
  height: 4.5rem;
  display: block;
  margin-top: 0.35rem;
  background: #f6f1ea;
  border-radius: 0.5rem;
}

.settings {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

@media (min-width: 64rem) {
  .day-app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    grid-template-rows: 100dvh;
    overflow: hidden;
    --sheet-stack: 0px;
  }

  .day-app .map-frame,
  .day-app .sheet,
  .day-app.sheet-open .sheet {
    min-height: 0;
  }

  .day-app .legend {
    width: min(20rem, calc(100% - 80px));
    right: auto;
  }

  .day-app .map {
    height: 100dvh;
  }

  .day-app .sheet,
  .day-app.sheet-open .sheet {
    position: relative;
    height: 100dvh;
    max-height: 100dvh;
    overflow: auto;
    border-radius: 0;
    padding: 8px 10px;
    background: #f7f3ec;
    border-left: 1px solid rgba(28, 25, 21, 0.06);
    box-shadow: none;
  }

  .day-app .sheet-body,
  .day-app.sheet-open .sheet-body {
    display: block;
  }

  .day-app .sheet-handle {
    flex: 0 0 auto;
    min-height: 0;
    margin-bottom: 0.45rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    cursor: default;
  }

  .day-app .sheet-action {
    display: none;
  }

  .day-app .leaflet-bottom {
    bottom: 0;
  }
}

.day-app {
  color: #1c1915;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.map-frame {
  position: relative;
  min-width: 0;
  height: 100dvh;
}

.release-mark {
  position: absolute;
  z-index: 450;
  left: 6px;
  bottom: 102px;
  margin: 0;
  padding: 0;
  max-width: 42vw;
  font-size: 11px;
  line-height: 1.25;
  color: #3f3a34;
  text-shadow: 0 0 2px #fffdf8, 0 0 2px #fffdf8;
  pointer-events: none;
}

.release-mark a {
  color: inherit;
  pointer-events: auto;
}

.demo-banner {
  position: absolute;
  z-index: 460;
  top: 64px;
  left: 8px;
  right: 58px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  color: #1c1915;
  font-size: 11px;
  line-height: 1.35;
  box-shadow: 0 2px 8px rgba(28, 25, 21, 0.12);
  pointer-events: none;
}

.demo-banner strong {
  font-size: 12px;
}

.demo-name {
  letter-spacing: 0.01em;
}

.demo-banner span {
  display: block;
}

.return-position {
  position: absolute;
  z-index: 470;
  left: 50%;
  bottom: calc(112px + var(--safe-bottom));
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(28, 25, 21, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  color: #1c1915;
  font: 600 12px/1.2 "Segoe UI", sans-serif;
  box-shadow: 0 2px 8px rgba(28, 25, 21, 0.14);
}

.day-app.sheet-open .return-position {
  bottom: calc(40dvh + 12px + var(--safe-bottom));
}

@media (min-width: 64rem) {
  .return-position,
  .day-app.sheet-open .return-position {
    bottom: calc(16px + var(--safe-bottom));
  }
}

@media (min-width: 64rem) {
  .release-mark {
    bottom: 4px;
    max-width: 16rem;
  }
}

@media (max-width: 63.99rem) {
  .day-app.sheet-open .release-mark {
    bottom: calc(40dvh + 4px);
  }
}

.day-app .leaflet-container {
  height: 100%;
  width: 100%;
  background: #d5e0db;
  font: inherit;
}

@media (max-width: 63.99rem) {
  .day-app .leaflet-bottom {
    bottom: 108px;
  }

  .day-app.sheet-open .leaflet-bottom {
    bottom: calc(40dvh + 6px);
  }

  .day-app .leaflet-control-attribution {
    max-width: min(16rem, 58vw);
    font-size: 10px;
    line-height: 1.2;
    background: rgba(255, 253, 248, 0.92);
  }
}

.day-title {
  margin: 0 0 0.2rem;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

.day-nav a {
  background: #fff;
  color: #1c1915;
  border-color: #d9cfc0;
  text-decoration: none;
}

.day-app button {
  margin-top: 0;
}

.time-tools {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.time-tools .controls {
  display: contents;
}

.time-tools .controls input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #0e7c66;
}

.control-buttons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.summary p {
  box-shadow: 0 8px 18px rgba(28, 25, 21, 0.04);
}

.summary .value {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.2rem;
  font-weight: 720;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.summary .fine {
  display: block;
  margin-top: 0.15rem;
  color: #6d675f;
  font-size: 0.75rem;
}

.match-note {
  margin: 0 0 0.4rem;
  color: #5c564e;
  font-size: 12px;
}

.axis-wrap {
  position: relative;
  margin: 0 0 0.35rem;
}

.day-axis {
  height: 1.35rem;
  margin: 0;
  background: #efe8dc;
}

.day-axis button,
.day-axis .empty {
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.day-axis .empty {
  background: transparent;
}

.playhead {
  position: absolute;
  top: -3px;
  width: 2px;
  height: calc(100% + 6px);
  background: #1c1915;
  border-radius: 2px;
  pointer-events: none;
}

.axis-tip {
  min-height: 0;
  margin: 0 0 0.35rem;
  color: #5c564e;
  font-size: 12px;
}

.axis-tip[hidden] {
  display: none;
}

.mix {
  display: block;
  height: auto;
  margin: 0 0 0.9rem;
  background: transparent;
  overflow: visible;
}

.mix-bar {
  display: flex;
  height: 0.5rem;
  border-radius: 999px;
  overflow: hidden;
  background: #efe8dc;
}

.mix-bar i {
  display: block;
  height: 100%;
}

.mix-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-top: 0.25rem;
  color: #5c564e;
  font-size: 12px;
}

.mix-key b {
  font-weight: 650;
  color: #1c1915;
}

.swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 99px;
  display: inline-block;
}

.swatch.stay { background: #0e7c66; }
.swatch.move { background: #1d4a73; }
.swatch.gap { background: #cfc6b8; }

.day-app .legend {
  position: absolute;
  z-index: 500;
  top: 8px;
  left: 8px;
  right: 64px;
  bottom: auto;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  box-sizing: border-box;
  width: auto;
  max-width: none;
  height: 50px;
  margin: 0;
  padding: 3px 2px 3px 8px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 4px 12px rgba(28, 25, 21, 0.12);
  overflow: hidden;
}

.legend-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.day-app .hour-bar,
.day-app .hour-labels {
  width: 100%;
}

.hour-bar {
  height: 6px;
  border-radius: 999px;
  cursor: crosshair;
}

.day-app .hour-labels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  height: auto;
  position: static;
  margin: 0;
  font-size: 12px;
  line-height: 13px;
}

.day-app .hour-labels span {
  position: static;
  white-space: nowrap;
}

.day-app .hour-labels .legend-mark {
  position: static;
  display: block;
  width: auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  line-height: 13px;
}

.day-app .hour-labels .legend-time {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-app .hour-labels .legend-mark:nth-child(1) {
  justify-self: start;
  text-align: left;
}

.day-app .hour-labels .legend-mark:nth-child(2) {
  justify-self: center;
  text-align: center;
}

.day-app .hour-labels .legend-mark:nth-child(3) {
  justify-self: end;
  text-align: right;
}

.legend-scale {
  position: relative;
}

.legend-date {
  margin: 0;
  color: #3f3a34;
  font-size: 11px;
  line-height: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-info {
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
}

.legend-note {
  max-width: 16rem;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #d9cfc0;
  border-radius: 10px;
  background: #fffdf8;
  color: #1c1915;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(28, 25, 21, 0.16);
}

.legend-note:popover-open {
  inset: unset;
  top: 62px;
  left: 8px;
}

.legend-tip {
  position: absolute;
  left: 8px;
  top: 60px;
  margin: 0;
  color: #3f3a34;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.legend-tip[hidden] {
  display: none;
}

.playhead.preview {
  background: #172554;
  width: 3px;
  z-index: 2;
}

.route-hover {
  position: absolute;
  z-index: 700;
  pointer-events: none;
  width: min(16rem, calc(100% - 1rem));
  padding: 0;
  background: transparent;
  color: #1c1915;
  box-shadow: none;
  font-size: 0.82rem;
  line-height: 1.3;
}

.trip-cards {
  display: grid;
  gap: 0.35rem;
}

.trip-card {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  column-gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.38rem 0.5rem;
  border: 2px solid #172554;
  border-radius: 0.75rem;
  background: rgba(255, 253, 248, 0.97);
  color: #1c1915;
  text-align: left;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  cursor: pointer;
}

.trip-card.is-on {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.18), 0 8px 18px rgba(15, 23, 42, 0.14);
}

.trip-arrow {
  grid-row: span 2;
  align-self: center;
}

.trip-card strong,
.trip-card span {
  display: block;
}

.trip-card strong {
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
}

.trip-more,
.offset-note {
  margin: 0.2rem 0 0;
  color: #5c564e;
  font-size: 0.72rem;
}

.route-hover strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.route-hover .approx,
.route-hover .alts {
  color: #5c564e;
}

.leaflet-marker-icon.arrow-icon,
.route-arrows {
  pointer-events: none;
}

.route-arrows {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 480;
}

.hour-labels {
  position: relative;
  height: 1rem;
  margin-top: 0.28rem;
  color: #5c564e;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.hour-labels span {
  position: absolute;
  top: 0;
  white-space: nowrap;
}

.legend .caption {
  margin: 0 0 0.25rem;
  color: #5c564e;
  font-size: 0.72rem;
}

.timeline button.row {
  display: grid;
  gap: 0.05rem;
  box-shadow: 0 8px 18px rgba(28, 25, 21, 0.04);
}

.timeline button.row.stay { box-shadow: inset 3px 0 0 #0e7c66, 0 8px 18px rgba(28, 25, 21, 0.04); }
.timeline button.row.walk { box-shadow: inset 3px 0 0 #3d7a4a, 0 8px 18px rgba(28, 25, 21, 0.04); }
.timeline button.row.drive { box-shadow: inset 3px 0 0 #1d4a73, 0 8px 18px rgba(28, 25, 21, 0.04); }
.timeline button.row.unknown { box-shadow: inset 3px 0 0 #8d867c, 0 8px 18px rgba(28, 25, 21, 0.04); }
.timeline button.row.gap { box-shadow: inset 3px 0 0 #cfc6b8, 0 8px 18px rgba(28, 25, 21, 0.04); }

.timeline button.row .kicker,
.timeline button.row .sub {
  color: #5c564e;
  font-size: 12px;
}

.timeline button.row .range {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.timeline button.row.gap .big {
  font-size: 0.95rem;
  font-weight: 650;
  color: #5c564e;
}

.visit-detail {
  margin: 0.15rem 0 0.35rem 3.85rem;
  display: grid;
  gap: 0.35rem;
}

.chart-note,
.empty-note {
  margin: 0;
  color: #5c564e;
  font-size: 0.8rem;
}

.leaflet-div-icon.ride-time-icon,
.leaflet-div-icon.hour-mark-icon,
.leaflet-div-icon.cluster-icon {
  background: transparent;
  border: none;
  overflow: visible;
}

.hour-mark,
.hour-chevron,
.hour-chip {
  pointer-events: none;
}

.hour-mark {
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
}

.hour-chevron {
  position: absolute;
  left: -7px;
  top: -7px;
  display: block;
  overflow: visible;
}

.hour-chip {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.12rem 0.45rem;
  border: 2px solid #172554;
  border-radius: 999px;
  background: #fffdf8;
  color: #1c1915;
  font-size: 0.74rem;
  font-weight: 680;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stay-cluster {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #0e7c66;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(14, 124, 102, 0.28);
}

.time-card {
  border-left: 3px solid #0e7c66;
}

.time-card.is-on {
  box-shadow: 0 10px 24px rgba(14, 124, 102, 0.22);
}

.time-card .duration span {
  font-size: 0.68rem;
  font-weight: 600;
  color: #5c564e;
}

.clock-icon {
  color: #0e7c66;
}

.sheet-link {
  margin: 0.8rem 0 0;
}

.sheet-link a {
  color: #0e7c66;
}

.mix-bar i.stay { background: #0e7c66; }
.mix-bar i.move { background: #1d4a73; }
.mix-bar i.gap { background: #cfc6b8; }

.visit > div {
  min-width: 0;
}

.day-axis button {
  cursor: pointer;
}

.time-card .kicker span {
  width: 1rem;
  height: 1rem;
  border-radius: 99px;
  display: inline-grid;
  place-items: center;
  background: #0e7c66;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.chart-readout {
  margin: 0.2rem 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}

.day-app .sheet-body {
  font-size: 12px;
  line-height: 1.3;
  padding-top: 4px;
}

.day-app .sheet-body .status-line {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 450;
  line-height: 1.3;
  color: #6d675f;
}

.day-app .sheet-body .range-label,
.day-app .sheet-body .axis-tip,
.day-app .sheet-body .mix-key,
.day-app .sheet-body .match-note {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 450;
  line-height: 1.3;
}

.day-app .day-nav {
  display: block;
  margin: 0 0 4px;
}

.day-app .sheet-body .tool-line,
.day-app .sheet-body .extra-actions,
.day-app .sheet-body .archive.is-open {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0 0 4px;
}

.day-app .sheet-body .seg {
  display: inline-flex;
  align-items: stretch;
  margin: 0;
  max-width: 100%;
}

.day-app .sheet-body button,
.day-app .sheet-body a,
.day-app .sheet-body input {
  margin-top: 0;
}

.day-app .sheet-body .seg > button,
.day-app .sheet-body .seg > a,
.day-app .sheet-body .extra-actions > button,
.day-app .sheet-body .archive > a,
.day-app .sheet-body .sheet-info {
  box-sizing: border-box;
  min-height: 28px;
  height: 28px;
  max-height: 28px;
  margin: 0;
  padding: 3px 8px;
  border: 1px solid #d9cfc0;
  border-radius: 7px;
  background: #fff;
  color: #1c1915;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}

.day-app .sheet-body .seg > .is-on,
.day-app .sheet-body .extra-actions > .is-on {
  background: #0e7c66;
  color: #fff;
  border-color: #0e7c66;
}

.day-app .sheet-body .sheet-info {
  width: 28px;
  padding: 0;
  font-style: italic;
}

.day-app .sheet-body .seg > button,
.day-app .sheet-body .seg > a,
.day-app .sheet-body .archive > a {
  border-radius: 0;
}

.day-app .sheet-body .seg > :first-child,
.day-app .sheet-body .archive > a:first-child {
  border-radius: 7px 0 0 7px;
}

.day-app .sheet-body .seg > :last-child,
.day-app .sheet-body .archive > a:last-of-type {
  border-radius: 0 7px 7px 0;
}

.day-app .sheet-body .seg > button + button,
.day-app .sheet-body .seg > button + a,
.day-app .sheet-body .seg > a + button,
.day-app .sheet-body .seg > a + a {
  margin-left: -1px;
}

.day-app .sheet-body .timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
}

.day-app .sheet-body .visit {
  display: block;
  margin: 0;
  border-top: 1px solid rgba(28, 25, 21, 0.14);
}

.day-app .sheet-body .timeline button.row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #1c1915;
  font-size: 12px;
  font-weight: 450;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.day-app .sheet-body .timeline button.row.is-on,
.day-app .sheet-body .timeline button.row.is-hot,
#day-axis button.is-hot {
  background: rgba(14, 124, 102, 0.12);
  box-shadow: none;
}

.day-app .sheet-body .timeline button.row .mark {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8d867c;
}

.day-app .sheet-body .timeline button.row.stay .mark { background: #0e7c66; }
.day-app .sheet-body .timeline button.row.walk .mark { background: #3d7a4a; }
.day-app .sheet-body .timeline button.row.drive .mark { background: #1d4a73; }
.day-app .sheet-body .timeline button.row.gap .mark { background: #cfc6b8; }

.day-app .sheet-body .timeline button.row .range,
.day-app .sheet-body .timeline button.row .kind,
.day-app .sheet-body .timeline button.row .dur,
.day-app .sheet-body .timeline button.row .dist {
  display: block;
  min-width: 0;
  font-size: 12px;
  line-height: 1.2;
}

.day-app .sheet-body .timeline button.row .range {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.day-app .sheet-body .timeline button.row .kind {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-app .sheet-body .timeline button.row .dur,
.day-app .sheet-body .timeline button.row .dist {
  flex: 0 0 auto;
  font-weight: 700;
}

.day-app .sheet-body .visit-detail {
  margin: 2px 0 4px 12px;
  font-size: 11px;
  line-height: 1.3;
}

.day-app .sheet-body .archive input[type="date"] {
  box-sizing: border-box;
  width: 9.2rem;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.day-app .scrub {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  margin: 4px 0;
}

.day-app .scrub .clock {
  flex: 0 0 auto;
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0;
}

.day-app .scrub .controls {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.day-app .sheet-body .scrub input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  width: 100%;
  height: 32px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #0e7c66;
}

.day-app .sheet-body .scrub input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: #d9cfc0;
}

.day-app .sheet-body .scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #0e7c66;
}

.day-app .sheet-body .scrub input[type="range"]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 4px;
  background: #d9cfc0;
}

.day-app .sheet-body .scrub input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #0e7c66;
}

.day-app .sheet-body .axis-wrap,
.day-app .sheet-body .mix {
  margin: 4px 0;
}

.day-app .sheet-body .sheet-link {
  margin: 4px 0 0;
  font-size: 12px;
}

.day-app .sheet-body .match-note {
  max-width: 16rem;
  padding: 8px 10px;
  border: 1px solid #d9cfc0;
  border-radius: 8px;
  background: #fffdf8;
  color: #1c1915;
  box-shadow: 0 8px 22px rgba(28, 25, 21, 0.16);
}

.bundle-count {
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #172554;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.trip-tip {
  display: grid;
  gap: 1px;
  max-width: 15rem;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.96);
  color: #1c1915;
  font-size: 11px;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(28, 25, 21, 0.16);
}

.trip-tip strong {
  font-size: 12px;
}

@media (min-width: 64rem) {
  .day-app .legend {
    width: min(20rem, calc(100% - 80px));
    right: auto;
  }
}

.leaflet-div-icon.live-pin-icon {
  background: transparent;
  border: 0;
  pointer-events: none;
  overflow: visible;
}

.live-pin {
  position: relative;
  width: 32px;
  height: 32px;
  pointer-events: none;
  overflow: visible;
}

.live-wave,
.live-shadow,
.live-face,
.live-glyph {
  position: absolute;
  pointer-events: none;
}

.live-wave {
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 1.5px solid rgba(23, 37, 84, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 253, 248, 0.8);
  opacity: 0;
  transform: scale(0.85);
  transform-origin: center;
}

.live-shadow {
  left: 7px;
  top: 23px;
  width: 18px;
  height: 5px;
  border-radius: 50%;
  background: rgba(28, 25, 21, 0.22);
  filter: blur(0.5px);
}

.live-face {
  inset: 0;
  filter: drop-shadow(0 1px 0 rgba(255, 253, 248, 0.85)) drop-shadow(0 3px 3px rgba(23, 37, 84, 0.28));
}

.live-glyph {
  inset: 0;
  width: 32px;
  height: 32px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.live-glyph-drive {
  transform-origin: 16px 16px;
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.live-pin[data-mode="walk"] .live-glyph-walk,
.live-pin[data-mode="drive"] .live-glyph-drive,
.live-pin[data-mode="stay"] .live-glyph-stay,
.live-pin[data-mode="unknown"] .live-glyph-unknown {
  opacity: 1;
}

.position-tag {
  position: absolute;
  inset: 0;
  z-index: 640;
  pointer-events: none;
  overflow: hidden;
}

.position-tag[hidden] {
  display: none;
}

.position-link {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.position-chip {
  position: absolute;
  height: 22px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid rgba(28, 25, 21, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  color: #1c1915;
  font: 600 11px/22px "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(28, 25, 21, 0.12);
}

.live-pin.fresh:not(.paused) .live-wave,
.leaflet-marker-icon.fresh:not(.paused) .live-wave {
  animation: live-wave 2.6s ease-out infinite;
}

.live-pin.fresh:not(.paused) .live-wave-b,
.leaflet-marker-icon.fresh:not(.paused) .live-wave-b {
  animation-delay: 1.3s;
}

.live-pin.stale .live-face,
.leaflet-marker-icon.stale .live-face {
  filter: grayscale(0.8) brightness(0.92) drop-shadow(0 1px 2px rgba(28, 25, 21, 0.18));
}

.live-pin.stale .live-shadow,
.leaflet-marker-icon.stale .live-shadow {
  opacity: 0.35;
}

.live-pin.stale .live-wave,
.live-pin.paused .live-wave,
.leaflet-marker-icon.stale .live-wave,
.leaflet-marker-icon.paused .live-wave {
  animation: none;
  opacity: 0;
}

@keyframes live-wave {
  0% { opacity: 0.5; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(2); }
}

@media (prefers-reduced-motion: reduce) {
  .live-pin.fresh:not(.paused) .live-wave,
  .leaflet-marker-icon.fresh:not(.paused) .live-wave,
  .live-glyph,
  .live-glyph-drive {
    animation: none !important;
    transition: none;
  }

  .live-pin.fresh .live-wave,
  .leaflet-marker-icon.fresh .live-wave {
    opacity: 0;
  }
}
