/* PRE hold to confirm + undo notice. Pairs with assets/js/hold-confirm.js. */
.pre-hold {
  --hold-tint: #ff5a6a;
  --hold-ink: #020304;
  --hold-text: #ff9aa4;
  --hold-border: rgba(255, 90, 106, .42);
  --hold-surface: rgba(255, 90, 106, .08);
  --hold-surface-hover: rgba(255, 90, 106, .13);
  --hold-pad: 1.25rem;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11rem;
  min-height: 44px;
  padding: 0 var(--hold-pad);
  overflow: hidden;
  border: 1px solid var(--hold-border);
  border-radius: var(--radius, 12px);
  background: var(--hold-surface);
  color: var(--hold-text);
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: transform 150ms cubic-bezier(.23, 1, .32, 1);
}

.pre-hold[data-tone="accent"] {
  --hold-tint: var(--accent, #9fd8ff);
  --hold-text: var(--accent, #9fd8ff);
  --hold-border: rgba(159, 216, 255, .4);
  --hold-surface: rgba(159, 216, 255, .07);
  --hold-surface-hover: rgba(159, 216, 255, .12);
}

@media (hover: hover) {
  .pre-hold:hover:not(:disabled) { background: var(--hold-surface-hover); }
}

.pre-hold:focus-visible {
  outline: 2px solid var(--hold-tint);
  outline-offset: 3px;
}

.pre-hold[data-input="pointer"]:active:not(:disabled) { transform: scale(.98); }

.pre-hold:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.pre-hold[data-status="confirmed"],
.pre-hold[data-status="confirmed"]:hover {
  border-color: var(--hold-tint);
  background: var(--hold-tint);
  color: var(--hold-ink);
}

.pre-hold__label,
.pre-hold__done,
.pre-hold__fill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}

.pre-hold__label,
.pre-hold__done { position: relative; }

.pre-hold__fill {
  position: absolute;
  inset: 0;
  padding: 0 var(--hold-pad);
  background: var(--hold-tint);
  color: var(--hold-ink);
  clip-path: inset(0 100% 0 0);
  transition-property: clip-path;
  pointer-events: none;
}

.pre-hold > [hidden] { display: none; }

.pre-hold svg { flex: none; }

/* Undo notice: replaces the actions row for a few seconds. */
[data-pre-undo-hidden] { display: none !important; }

.pre-undo {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: min(100%, 16rem);
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 44px;
  padding: .25rem .25rem .25rem .85rem;
  overflow: hidden;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, .12));
  border-radius: var(--radius, 12px);
  background: rgba(255, 255, 255, .05);
  color: #fff;
  font-size: .8125rem;
}

.pre-undo__lead {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .55rem;
}

.pre-undo__lead svg {
  flex: none;
  color: var(--accent, #9fd8ff);
}

.pre-undo__message {
  margin: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pre-undo__button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 5.5rem;
  min-height: 36px;
  padding: 0 .8rem;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, .12));
  border-radius: calc(var(--radius, 12px) - 4px);
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform 150ms cubic-bezier(.23, 1, .32, 1);
}

@media (hover: hover) {
  .pre-undo__button:hover { background: rgba(0, 0, 0, .72); }
}

.pre-undo__button:active { transform: scale(.97); }

.pre-undo__button:focus-visible {
  outline: 2px solid var(--accent, #9fd8ff);
  outline-offset: 3px;
}

.pre-undo__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent, #9fd8ff);
  opacity: .8;
  transform-origin: left center;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .pre-hold,
  .pre-undo__button { transition: none; }
  .pre-hold[data-input="pointer"]:active:not(:disabled),
  .pre-undo__button:active { transform: none; }
  .pre-undo__bar { opacity: .45; }
}
