:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --ink: #18191b;
  --soft: rgba(24, 25, 27, 0.58);
  --line: rgba(24, 25, 27, 0.09);
  --accent: #1f8a5b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 8px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
ul { list-style: none; }
.live, .ml__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ml { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: min(356px, 100%); padding: 16px 14px 12px; border-radius: 26px; background: var(--card); box-shadow: inset 0 0 0 1.500px var(--line), 0 30px 44px -30px rgba(24, 25, 27, 0.35); }
.ml__head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 0 4px 2px; }
.ml__what { display: grid; gap: 6px; min-width: 0; }
.ml__label { font-size: 11.500px; line-height: 14px; font-weight: 640; color: var(--soft); white-space: nowrap; }

/* the odometer: one window per digit, each a column of ten figures that slides */
.ml__odo { display: flex; align-items: center; gap: 2px; height: 40px; }
.ml__cell { position: relative; width: 25px; height: 40px; border-radius: 7px; background: var(--ink); overflow: hidden; box-shadow: inset 0 8px 8px -6px rgba(0, 0, 0, 0.7), inset 0 -8px 8px -6px rgba(0, 0, 0, 0.7); }
.ml__cell--tenth { background: var(--accent); }
.ml__col { display: block; will-change: transform; }
.ml__col span { display: block; height: 40px; line-height: 41px; text-align: center; font-size: 25px; font-weight: 700; font-stretch: 84%; color: #ffffff; }
.ml__cell.is-lead .ml__col span { color: rgba(255, 255, 255, 0.3); }
.ml__unit { margin-left: 5px; align-self: flex-end; padding-bottom: 3px; font-size: 13px; font-weight: 700; color: var(--soft); }
.ml__ded { display: grid; justify-items: end; gap: 1px; flex: none; }
.ml__ded strong { font-size: 21px; line-height: 26px; font-weight: 740; letter-spacing: -0.02em; color: var(--accent); white-space: nowrap; }
.ml__rate { font-size: 11px; line-height: 14px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.ml__plus { position: absolute; left: 4px; top: -4px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--accent); color: #ffffff; font-size: 11.500px; line-height: 20px; font-weight: 740; white-space: nowrap; opacity: 0; pointer-events: none; }
.ml__plus.is-minus { background: var(--ink); }

/* the drives: a strip on the left says how each one is tagged */
.ml__list { display: grid; gap: 0; border-top: 1.500px solid var(--line); }
.ml__trip { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info mi" "info seg"; column-gap: 8px; row-gap: 3px; align-items: center; padding: 8px 4px 8px 12px; border-bottom: 1.500px solid var(--line); }
.ml__trip::before { content: ""; position: absolute; left: 1px; top: 9px; bottom: 9px; width: 3px; border-radius: 1.500px; background: repeating-linear-gradient(180deg, rgba(24, 25, 27, 0.28) 0 3px, transparent 3px 6px); transition: background-color 0.3s ease; }
.ml__trip[data-tag="b"]::before { background: var(--accent); }
.ml__trip[data-tag="p"]::before { background: rgba(24, 25, 27, 0.3); }
.ml__info { grid-area: info; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.ml__info strong { font-size: 13.500px; line-height: 17px; font-weight: 700; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml__info span { font-size: 11.500px; line-height: 14px; font-weight: 600; color: var(--soft); }
.ml__mi { grid-area: mi; justify-self: end; font-size: 12.500px; line-height: 15px; font-weight: 720; white-space: nowrap; transition: color 0.3s ease; }
.ml__trip[data-tag="b"] .ml__mi { color: var(--accent); }
.ml__seg { grid-area: seg; position: relative; display: grid; grid-template-columns: 62px 62px; height: 24px; padding: 2px; border-radius: 12px; background: rgba(24, 25, 27, 0.06); }
.ml__seg i { position: absolute; left: 2px; top: 2px; width: 62px; height: 20px; border-radius: 10px; background: #ffffff; box-shadow: 0 1px 1px rgba(24, 25, 27, 0.1), 0 4px 8px -5px rgba(24, 25, 27, 0.4); opacity: 0; pointer-events: none; }
.ml__seg button { position: relative; display: grid; place-items: center; height: 20px; border-radius: 10px; font-size: 11px; font-weight: 660; color: var(--soft); transition: color 0.25s ease; }
.ml__seg button[aria-pressed="true"] { color: var(--ink); }
.ml__trip[data-tag="b"] .ml__seg button[aria-pressed="true"] { color: var(--accent); }
.ml__seg button:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
@media (hover: hover) { .ml__seg button:hover { color: var(--ink); } .ml__trip { transition: background-color 0.25s ease; } .ml__trip:hover { background: rgba(24, 25, 27, 0.025); } }
.ml__foot { padding: 0 4px; }
.ml__clip { display: block; height: 16px; line-height: 16px; overflow: hidden; white-space: nowrap; font-size: 11.500px; font-weight: 620; color: var(--soft); }
.ml__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }

@media (max-width: 350px) { .ml { padding: 14px 10px 10px; } .ml__seg { grid-template-columns: 58px 58px; } .ml__seg i { width: 58px; } .ml__cell { width: 23px; } .ml__ded strong { font-size: 19px; } }
@media (max-height: 400px) { .ml { gap: 8px; } .ml__trip { padding-top: 6px; padding-bottom: 6px; } }
@media (prefers-reduced-motion: reduce) { .ml__trip::before, .ml__mi, .ml__seg button, .ml__trip { transition: none; } }
