/* Pro polish for every page (2026-11-23), from the design reels the user sent: mobile feel, press feedback,
   shake on errors, hover only with a mouse, snap + fade on swipe rows, smooth accordions, OKLCH gradients.
   Loaded after the page's own stylesheet. The rules list is in ../../README.md ("Polish rules"). */

/* phones: no grey tap flash, no double-tap zoom on controls, fields at 16 px so iOS never zooms in */
html { -webkit-tap-highlight-color: transparent; interpolate-size: allow-keywords; }
a, button, input, select, textarea, label, summary, [role=button] { touch-action: manipulation; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: max(16px, 1em); }

/* pressed: shrink to 0.97 so a tap feels answered */
:is(.btn, .choice, .chip, .need, .lang button, .film-play, .pick, .svc, .pack, .size, .add, .paycard, .vidc, .v2card, .step button):active:not(:disabled) {
  transform: scale(0.97); transition-duration: 90ms; }

/* wrong value: shake as well as turn red */
[aria-invalid="true"] { animation: pol-shake 380ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes pol-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* touch screens: hover lifts would stay stuck after a tap, so they only happen with a mouse */
@media (hover: none) {
  .btn:hover, .choice:hover, .who:hover img, .tile:hover img, .choice:hover img, .film-play:hover img, .path-media:hover img, .film-play:hover .play-dot,
  .svc:hover, .add:hover, .pack:hover, .price-card:hover, .svcpick button:hover, .dronly:hover, .size:hover, .restore:hover, .paycard:hover,
  .prepcard:hover, .v2card:hover, .vidc:hover:not(:disabled), .svc:hover figure > img, .add:hover figure img, .mosaic figure:hover img, .size:hover figure img { transform: none; }
}

/* pop-ups and menus: scrolling inside never scrolls the page behind */
.mobile-menu, dialog, [role=dialog], .modal, .sheet { overscroll-behavior: contain; }

/* swipe rows: every swipe lands on a card, and the edges fade out */
.needs, .mx-snap { scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.needs > *, .mx-snap > * { scroll-snap-align: start; }
@media (max-width: 760px) {
  .needs { -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 28px), transparent); }
}

/* accordions open smoothly to their real height */
details::details-content { block-size: 0; overflow: clip; transition: block-size 380ms cubic-bezier(0.22, 1, 0.36, 1), content-visibility 380ms allow-discrete; }
details[open]::details-content { block-size: auto; }

/* ---- feel fast (reel "How apps fake being fast") ---- */
/* never an empty box: picture frames shimmer grey until the picture is in */
@keyframes pol-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
:is(.tile, .choice, .path-media, .who figure, .film-play, .clip-media, .ba, .pair figure, .mon figure, .r-item, .svc figure, .size figure, .add figure, .vidc) {
  background-image: linear-gradient(100deg, rgba(128, 128, 128, .10) 30%, rgba(128, 128, 128, .2) 50%, rgba(128, 128, 128, .10) 70%);
  background-size: 300% 100%; animation: pol-shimmer 1.6s linear infinite; }
:is(.tile, .choice, .path-media, .who figure, .film-play, .clip-media, .ba, .pair figure, .mon figure, .r-item, .svc figure, .size figure, .add figure, .vidc).pol-done { animation: none; }
/* pictures arrive blurry and sharpen (wa.js marks them) */
img.pol-wait { filter: blur(14px); transform: scale(1.03); }
img.pol-in { transition: filter .5s ease, transform .5s ease; }

/* ---- 6 more UX laws ---- */
/* uniform connectedness: the steps are joined by one line, so they read as one path with a start and an end */
@media (min-width: 761px) {
  .steps { position: relative; }
  .steps::before { content: ""; position: absolute; left: 8%; right: 8%; top: 52px; height: 2px; z-index: 0;
    background: linear-gradient(in oklch 90deg, var(--lime, #D4E45C), rgba(212, 228, 92, .25)); }
  .steps > * { position: relative; z-index: 1; }
}
/* closure: on a phone, swipe rows let the next card peek, so the cut edge says "there's more" */
@media (max-width: 760px) { .needs { padding-right: 32%; } }

@media (prefers-reduced-motion: reduce) {
  :is(.tile, .choice, .path-media, .who figure, .film-play, .clip-media, .ba, .pair figure, .mon figure, .r-item, .svc figure, .size figure, .add figure, .vidc) { animation: none; }
  img.pol-wait { filter: none; transform: none; }
  [aria-invalid="true"] { animation: none; }
  :is(.btn, .choice, .chip, .need):active { transform: none; }
  details::details-content { transition: none; }
}
