:root {
  --bg: #ffffff;
  --pill: #17181b;
  --ink: #f5f5f2;
  --soft: rgba(245, 245, 242, 0.55);
  --accent: #ffb020;
  --go: #3ddc84;
}

*, *::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: 16px;
}
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.tl {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  width: min(298px, 100%);
  height: 64px;
  padding: 0 20px 0 8px;
  border: 0;
  border-radius: 32px;
  background: var(--pill);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  /* --t goes from 0 to 1 when the toll is paid: the lane light and the shadow pass from amber to green */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 34px -16px color-mix(in srgb, var(--go) calc(var(--t, 0) * 100%), rgba(23, 24, 27, 0.55));
}
.tl:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--pill); }
.tl[aria-busy="true"] { cursor: default; }

/* the gate: a round tile with the barrier; its ring is the lane light */
.tl__gate { position: relative; width: 48px; height: 48px; border-radius: 24px; background: rgba(245, 245, 242, 0.08); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--go) calc(var(--t, 0) * 100%), var(--accent)); overflow: hidden; }
.tl__gate svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gate__ground { fill: none; stroke: rgba(245, 245, 242, 0.3); stroke-width: 1.500; stroke-linecap: round; }
.gate__post { fill: rgba(245, 245, 242, 0.55); }
.gate__arm { fill: #f5f5f2; }
.gate__stripe { fill: var(--accent); }
.gate__hinge { fill: var(--pill); }

.tl__text { min-width: 0; display: grid; gap: 1px; }
.tl__line { display: block; overflow: hidden; white-space: nowrap; }
.tl__line span { display: block; overflow: hidden; text-overflow: ellipsis; }
.tl__line--a { height: 22px; font-size: 16.5px; line-height: 22px; font-weight: 680; font-stretch: 104%; letter-spacing: -0.012em; }
.tl__line--b { height: 16px; font-size: 11.5px; line-height: 16px; font-weight: 560; color: var(--soft); }

.tl__end { position: relative; display: grid; place-items: center end; min-width: 44px; height: 24px; }
.tl__amount { font-size: 15px; font-weight: 700; white-space: nowrap; }
.tl__tick { position: absolute; right: 0; top: 2px; width: 20px; height: 20px; fill: none; stroke: var(--go); stroke-width: 2.200; stroke-linecap: round; stroke-linejoin: round; }
.tl__tick path { stroke-dasharray: 1; stroke-dashoffset: 1; }
/* the light that crosses the pill while the payment goes through */
.tl__shine { position: absolute; inset: 0; pointer-events: none; }
.tl__shine i { position: absolute; top: 0; bottom: 0; left: 0; width: 34%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent); opacity: 0; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #17181b;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (hover: hover) {
  .tl:not([aria-busy="true"]):hover .tl__gate { background: rgba(245, 245, 242, 0.13); }
}
