.mu-otp[data-mono] {
  --otp-paper: #fff;
  --otp-ink: #171717;
  --otp-muted: #5d5d5d;
  --otp-rule: #d3d3d3;
  --otp-key: #f7f7f7;
  --otp-stub-ink: #f5f5f5;
  --otp-stub-paper: #181818;
  container-type: inline-size;
  width: 100%;
  max-width: 42rem;
  color: var(--otp-ink);
}
[data-theme="dark"] .mu-otp[data-mono] {
  --otp-paper: #242424;
  --otp-ink: #f4f4f4;
  --otp-muted: #bababa;
  --otp-rule: #555;
  --otp-key: #303030;
  --otp-stub-paper: #0f0f0f;
  color-scheme: dark;
}
.mu-otp-pass {
  --otp-stub: 23%;
  --otp-notch: .42rem;
  display: grid;
  grid-template-columns: var(--otp-stub) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--otp-rule);
  border-radius: .68rem;
  background: var(--otp-paper);
  mask: radial-gradient(circle at var(--otp-stub) 0, transparent var(--otp-notch), #000 calc(var(--otp-notch) + .7px)),
        radial-gradient(circle at var(--otp-stub) 100%, transparent var(--otp-notch), #000 calc(var(--otp-notch) + .7px));
  mask-composite: intersect;
}
.mu-otp-stub {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: .8rem;
  color: var(--otp-stub-ink);
  background: radial-gradient(#424242 .6px, transparent .85px) 1px 1px / 8px 8px, var(--otp-stub-paper);
}
.mu-otp-stub::after {
  content: "";
  position: absolute;
  inset: .62rem .2rem .62rem auto;
  width: 1px;
  background: repeating-linear-gradient(to bottom, #979797 0 3px, transparent 3px 7px);
}
.mu-otp-print { display: block; width: min(100%, 6.75rem); height: auto; }
.mu-otp-body {
  min-width: 0;
  padding: clamp(1.15rem, 5cqi, 2.15rem) clamp(1rem, 5.2cqi, 2.4rem);
}
.mu-otp-label {
  display: block;
  width: fit-content;
  color: var(--otp-ink);
  font: 500 clamp(1.8rem, 6.5cqi, 2.7rem)/1.06 "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.mu-otp-hint {
  margin: .56rem 0 0;
  color: var(--otp-muted);
  font-size: clamp(.85rem, 2.3cqi, .95rem);
  line-height: 1.45;
}
.mu-otp-entry { position: relative; width: 100%; margin-top: clamp(1.1rem, 3.8cqi, 1.65rem); }
.mu-otp[data-otp-enhanced] .mu-otp-entry { max-width: calc(var(--otp-count) * 4.7rem); }
.mu-otp-input {
  width: 100%;
  min-width: 0;
  padding: .55rem .72rem;
  border: 1px solid var(--otp-rule);
  border-radius: .35rem;
  background: var(--otp-key);
  color: var(--otp-ink);
  font: 600 1.4rem/1.5 ui-monospace, monospace;
  letter-spacing: .2em;
}
.mu-otp-input:focus-visible { outline: 2px solid var(--otp-ink); outline-offset: 2px; }
.mu-otp-slots {
  --otp-gap: clamp(.22rem, 1.25cqi, .5rem);
  display: flex;
  gap: var(--otp-gap);
  width: 100%;
}
.mu-otp-slots > span {
  position: relative;
  display: grid;
  flex: 1 1 0;
  place-items: center;
  min-width: 0;
  height: clamp(2.65rem, 10.5cqi, 3.8rem);
  border: 1px solid var(--otp-rule);
  border-radius: .35rem;
  background: var(--otp-key);
  color: var(--otp-ink);
  font: 500 clamp(1.2rem, 4.9cqi, 2rem)/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  transition: color .14s ease, background-color .14s ease, border-color .14s ease;
}
.mu-otp-slots > [data-gap] { margin-left: clamp(.35rem, 1.4cqi, .65rem); }
.mu-otp-slots > [data-gap]::before {
  content: "";
  position: absolute;
  right: calc(100% + var(--otp-gap) / 2);
  top: 50%;
  width: clamp(.25rem, .9cqi, .38rem);
  height: 1px;
  background: var(--otp-muted);
}
.mu-otp-slots > span:empty::after {
  content: "";
  width: .26rem;
  height: .26rem;
  border-radius: 50%;
  background: var(--otp-muted);
}
.mu-otp-slots > [data-filled] { background: var(--otp-paper); border-color: var(--otp-muted); }
.mu-otp-slots > :is([data-active],[data-selected]) {
  border-color: var(--otp-ink);
  background: var(--otp-ink);
  color: var(--otp-paper);
}
.mu-otp-slots > [data-active]:empty::after {
  width: 2px;
  height: .93em;
  border-radius: 1px;
  background: currentColor;
  animation: mu-otp-caret 1.2s ease-in-out infinite alternate;
}
@keyframes mu-otp-caret { to { opacity: .42; } }
.mu-otp[data-otp-enhanced] .mu-otp-input {
  position: absolute;
  z-index: 1;
  inset: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: text;
  font-size: 16px;
}
.mu-otp[data-invalid] .mu-otp-slots > span { border-style: dashed; border-color: var(--otp-ink); }
.mu-otp-entry:has(.mu-otp-input:focus-visible) .mu-otp-slots { outline: 2px solid var(--otp-ink); outline-offset: 3px; border-radius: .35rem; }
.mu-otp:not([data-otp-enhanced]) .mu-otp-footer { display: none; }
.mu-otp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1.05rem;
  padding-top: .72rem;
  border-top: 1px solid var(--otp-rule);
}
.mu-otp-status { color: var(--otp-muted); font: 500 .72rem/1.45 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.mu-otp[data-complete] .mu-otp-status, .mu-otp[data-invalid] .mu-otp-status { color: var(--otp-ink); }
.mu-otp-track { display: block; flex: 0 1 3.8rem; height: 3px; overflow: hidden; border-radius: 3px; background: var(--otp-rule); }
.mu-otp-track > span { display: block; height: 100%; width: var(--otp-progress, 0%); background: var(--otp-ink); transition: width .16s ease-out; }
.mu-otp:has(.mu-otp-input:disabled) .mu-otp-entry { opacity: .55; }
.mu-otp:has(.mu-otp-input:disabled) .mu-otp-input { cursor: not-allowed; }
.mu-otp[data-compact] .mu-otp-slots { --otp-gap: .15rem; }
.mu-otp[data-compact] .mu-otp-slots > span { font-size: clamp(.85rem, 3.25cqi, 1.45rem); }
@container (max-width: 27rem) {
  .mu-otp-pass { --otp-stub: 16%; --otp-notch: .32rem; }
  .mu-otp-stub { padding: .45rem; }
  .mu-otp-body { padding: 1rem .85rem; }
  .mu-otp-label { font-size: clamp(1.5rem, 7.5cqi, 1.9rem); }
  .mu-otp-footer { margin-top: .85rem; padding-top: .6rem; }
}
@container (max-width: 19rem) {
  .mu-otp-pass { --otp-stub: 13%; }
  .mu-otp-stub { padding: .3rem; }
  .mu-otp-body { padding: .9rem .65rem; }
  .mu-otp-slots { --otp-gap: .18rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mu-otp-slots > span, .mu-otp-track > span { transition: none; }
  .mu-otp-slots > [data-active]:empty::after { animation: none; }
}
@media (forced-colors: active) {
  .mu-otp-pass { border-color: CanvasText; }
  .mu-otp-stub { border-right: 1px dashed CanvasText; }
  .mu-otp-slots > [data-active] { outline: 2px solid Highlight; }
  .mu-otp-slots > [data-selected] { border: 2px dashed Highlight; }
  .mu-otp-slots > span:empty::after, .mu-otp-track > span { background: CanvasText; }
}
