/* Moment routines keep their icon while ink fills the small timetable sticker. */
html body .ln-row .hb-chip[data-hb-tap] {
  box-sizing: border-box;
  --hb-step: calc((100% - var(--hc)) * var(--hb-slot, .1666667));
  --hb-gap: min(2px, calc(var(--hb-step) * .12));
  left: calc(var(--hc) + (100% - var(--hc)) * var(--hb-anchor, 0) + var(--hb-step) * var(--hb-index, 0) + var(--hb-gap) * .5);
  width: calc(var(--hb-step) - var(--hb-gap));
  min-width: 0;
  max-width: var(--hb-step);
  padding: 0;
  gap: 0;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 2px;
  isolation: isolate;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html body .ln-row .hb-chip[data-hb-tap]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line, #b6b8bd);
  z-index: 2;
  pointer-events: none;
}

html body .ln-row .hb-chip[data-hb-tap]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 1px;
  background: color-mix(in srgb, var(--hb-ink-color, var(--accent)) var(--pen-a, 33%), transparent);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

html body .ln-row .hb-chip[data-hb-tap].on::before {
  transform: scaleX(1);
}

html body .ln-row .hb-chip[data-hb-tap] .hb-mk-ic {
  position: relative;
  z-index: 1;
  display: block;
  flex: 0 1 13px;
  width: 13px;
  min-width: 0;
  height: 13px;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  color: var(--sub);
  pointer-events: none;
}

html body .ln-row .hb-chip[data-hb-tap].on .hb-mk-ic {
  color: var(--ink, var(--text));
}

html body .ln-row .hb-chip[data-hb-tap].hb-ink-fill::before {
  animation: tuk-routine-chip-fill var(--hb-hold-ms, 320ms) linear both;
}

html body .ln-row .hb-chip[data-hb-tap].hb-ink-erase::before {
  animation: tuk-routine-chip-erase var(--hb-hold-ms, 320ms) linear both;
}

html body .ln-row .hb-chip[data-hb-tap]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@keyframes tuk-routine-chip-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes tuk-routine-chip-erase {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* The TASKS icon has the same inner ink and hold gesture as its timetable stamp. */
html body .hb-todos .hb-lab[data-hb-ink] {
  position: relative;
  isolation: isolate;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  --hb-stamp-size: 20px;
}
html body.dev-phone .hb-todos .hb-lab[data-hb-ink] { --hb-stamp-size: 16px; }
html body .hb-todos .hb-lab[data-hb-ink]::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc((100% - var(--hb-stamp-size)) / 2);
  width: var(--hb-stamp-size);
  height: var(--hb-stamp-size);
  border-radius: 2px;
  z-index: 0;
  background: color-mix(in srgb, var(--hb-ink-color, var(--accent)) var(--pen-a, 33%), transparent);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
}
html body .hb-todos .hb-lab[data-hb-ink].on::before { transform: scaleX(1); }
html body .hb-todos .hb-lab[data-hb-ink] .hb-ic { position: relative; z-index: 1; pointer-events: none; }
html body .hb-todos .hb-lab[data-hb-ink].hb-ink-fill::before { animation: tuk-routine-chip-fill var(--hb-hold-ms, 320ms) linear both; }
html body .hb-todos .hb-lab[data-hb-ink].hb-ink-erase::before { animation: tuk-routine-chip-erase var(--hb-hold-ms, 320ms) linear both; }

@media (prefers-reduced-motion: reduce) {
  html body .ln-row .hb-chip[data-hb-tap].hb-ink-fill::before,
  html body .ln-row .hb-chip[data-hb-tap].hb-ink-erase::before {
    animation: none;
  }
  html body .ln-row .hb-chip[data-hb-tap].hb-ink-fill::before {
    transform: scaleX(1);
    opacity: .55;
  }
  html body .ln-row .hb-chip[data-hb-tap].hb-ink-erase::before {
    transform: scaleX(0);
  }
  html body .hb-todos .hb-lab[data-hb-ink].hb-ink-fill::before,
  html body .hb-todos .hb-lab[data-hb-ink].hb-ink-erase::before { animation: none; }
  html body .hb-todos .hb-lab[data-hb-ink].hb-ink-fill::before { transform: scaleX(1); opacity: .55; }
  html body .hb-todos .hb-lab[data-hb-ink].hb-ink-erase::before { transform: scaleX(0); }
}
