/* Prism feel layer (kernel): the shared feedback, state, edge and art rules every site ships. Pairs with feel.js.
   Reaches: game sites through builder/kits/game/ops/finish.mjs (/pw/feel.css + /pw/feel.js on every page); recipes through embed-motion.mjs (with motion.css); kernel apps copy it next to tokens.css.
   Fixes the five complaints judges repeated on every site (docs/DETAIL-BAR.md "Feel layer"): feedback mid-screen or invisible, controls with no press/focus/busy, hard edge cuts on rails, layout-animating motion, murky dark art.
   Gate rules (studio/design/gate.mjs): toast, edge, art, motion. Zero-specificity :where() except where the rule must beat site styles. */
:root{--f-ring:var(--focus,var(--acc,var(--accent,var(--ac,#a9b6ff))));--f-on:var(--acc,var(--accent,var(--ac,#a9b6ff)));--f-ease:cubic-bezier(.22,1,.36,1);--f-fade:28px}
/* 1 states: every control answers press (scale .97), focus (2px ring), disabled (dim, inert), busy (spinner, width kept) */
:where(button,[role=button],[role=tab],[role=switch],[role=option],a[class*=btn],summary,label:has(>input)){-webkit-tap-highlight-color:transparent;transition:transform 140ms var(--f-ease),opacity 140ms,filter 140ms,background-color 140ms,box-shadow 140ms,color 140ms}
:where(button,[role=button],[role=tab],[role=switch],[role=option],a[class*=btn]):not(:disabled,[aria-disabled=true]):active{transform:scale(.97);transition-duration:90ms}
:is(button,[role=button],[role=tab],[role=switch],[role=option],a[href],summary,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--f-ring);outline-offset:2px}
:where(button,[role=button],a[href],input,select,textarea):is(:disabled,[aria-disabled=true]){opacity:.5;cursor:not-allowed;transform:none;filter:none}
:where(button,[role=button])[aria-busy=true]{position:relative;pointer-events:none;color:transparent!important}
:where(button,[role=button])[aria-busy=true]>*{opacity:0}
:where(button,[role=button])[aria-busy=true]::after{content:"";position:absolute;inset:0;margin:auto;inline-size:1.1em;block-size:1.1em;border-radius:50%;border:2px solid var(--m-spin,currentColor);border-inline-end-color:transparent;animation:f-spin .7s linear infinite}
@keyframes f-spin{to{transform:rotate(1turn)}}
/* bars and meters fill with transform: scaleX from the left (width:100%; transform-origin:0 50%), never a width transition. Static bars: animation:f-grow .6s var(--f-ease) backwards */
@keyframes f-grow{from{transform:scaleX(0)}}
/* 2 feedback on the control itself: a saved/followed/liked control looks on (tint + ring), and pops once when it changes (feel.js adds .f-ack).
   The tint is a fallback (0,1,0): a site's own solid pressed style wins. A hover-only action row stays shown once one of its controls is on. */
:is(div,span):has(>[data-save][aria-pressed=true],>[data-like][aria-pressed=true],>[data-fav][aria-pressed=true]){opacity:1}
:where([data-save],[data-notify],[data-like],[data-follow],[data-fav])[aria-pressed=true]{color:var(--f-on);background-color:color-mix(in srgb,var(--f-on) 20%,transparent);box-shadow:inset 0 0 0 1.5px var(--f-on)}
.f-ack{animation:f-ack 380ms var(--f-ease)}
@keyframes f-ack{35%{transform:scale(1.16)}70%{transform:scale(.98)}}
/* 3 toasts: ONE reserved region (Sonner/Linear). Desktop: bottom-right, max 360px, above any bottom bar and the sound float. Phone (<=640px): above the bottom dock (feel.js measures --f-dock), or under the top bar (--f-top) without one.
   Transient (feel.js hides it after 4 s), pointer-events none except its own buttons, never over nav or primary controls. prismFeel.toast(msg), a site .gk-toast, or any fixed site toast (feel.js adds .f-toast-fix). Gate: studio/design/gate.mjs TOAST. */
:where(.f-toast,.gk-toast){position:fixed;inset-inline:0;inset-block:var(--f-tt,auto) var(--f-tb,auto);margin:0 auto;inline-size:max-content;block-size:max-content;max-inline-size:calc(100% - 32px);padding:10px 18px;border-radius:999px;font:600 var(--fs-md,13px)/1.2 var(--font,system-ui),sans-serif;background:light-dark(#f3f3f5,#1d2129);color:light-dark(#09090b,#f5f6f8);box-shadow:0 12px 32px rgb(0 0 0/.4),inset 0 0 0 1px light-dark(transparent,rgb(255 255 255/.16));z-index:999;pointer-events:none;opacity:0;transform:translateY(12px);transition:opacity 220ms var(--f-ease),transform 220ms var(--f-ease)}
:where(.f-toast,.gk-toast).on{opacity:1;transform:none}
.f-toast,.gk-toast,.f-toast-fix{position:fixed!important;inset:auto var(--f-tr,max(16px,calc(env(safe-area-inset-right) + 16px))) calc(var(--f-dock,0px) + var(--f-float,0px) + max(16px,calc(env(safe-area-inset-bottom) + 12px))) auto!important;margin:0!important;inline-size:max-content!important;block-size:max-content!important;max-inline-size:min(360px,calc(100vw - 32px))!important;z-index:999!important;pointer-events:none!important;box-sizing:border-box}
.f-toast-fix{transform:none!important;translate:none!important;transition:opacity .2s,visibility 0s!important}
:is(.f-toast,.gk-toast,.f-toast-fix) :is(button,a,input,select){pointer-events:auto}
@media(max-width:640px){.f-toast,.gk-toast,.f-toast-fix{inset:calc(var(--f-top,0px) + 8px) 0 auto 0!important;margin-inline:auto!important}:root.f-has-dock :is(.f-toast,.gk-toast,.f-toast-fix){inset:auto 0 calc(var(--f-dock) + var(--f-float,0px) + 8px) 0!important}}
.f-toast-out{opacity:0!important;visibility:hidden!important;transition:opacity .2s,visibility 0s .2s!important}
/* a sound/login float that stays fixed at the bottom right reserves its spot above the toast region; one moved into a bar (feel.js data-f-docked) is a normal flex item */
body:has(>.xp-snd:not([data-f-docked])){--f-float:56px}
.xp-snd[data-f-docked]{width:36px!important;height:36px!important}
[data-f-docked]{position:static!important;inset:auto!important;margin:0 0 0 8px!important;flex:none!important;align-self:center}
/* a bottom dock gets a soft scrim, so content passes under it instead of being cut, and the page end scrolls clear of it */
.f-dock{box-shadow:0 -18px 22px -6px var(--f-ground,rgb(0 0 0/.55))}
:root.f-has-dock body{padding-bottom:calc(var(--f-dock) + 8px)}
/* the band behind a floating dock is solid ground, so captions passing under it end cleanly instead of peeking through the gaps around the dock (gtav judge 2026-11-30) */
:root.f-has-dock::after{content:"";position:fixed;inset:auto 0 0 0;block-size:calc(var(--f-dock) + 16px);background:linear-gradient(to top,var(--f-ground,#000) calc(100% - 16px),transparent);z-index:var(--f-dz,40);pointer-events:none}
/* phone (a dock): a corner reward chip (Look XP stack) has no chrome left to sit on, so it stays off; the toast carries the news */
:root.f-has-dock .lk-xp-stack{display:none}
/* a hidden toast is not there for assistive tech or contrast checks mid-fade */
:where(.f-toast,.gk-toast):not(.on){visibility:hidden;transition-property:opacity,transform,visibility;transition-delay:0s,0s,220ms}
/* 4 scroll edges: a rail that hides content fades on the side that hides it (feel.js sets data-edge="l r") instead of a hard cut */
.f-edge{--f-l:0px;--f-r:0px;-webkit-mask-image:linear-gradient(90deg,transparent,#000 var(--f-l),#000 calc(100% - var(--f-r)),transparent);mask-image:linear-gradient(90deg,transparent,#000 var(--f-l),#000 calc(100% - var(--f-r)),transparent)}
.f-edge[data-edge~=l]{--f-l:var(--f-fade)}.f-edge[data-edge~=r]{--f-r:var(--f-fade)}
/* 5 dark art: a plate whose mean light is under 0.2 is lifted, so it reads on a near-black page (feel.js measures, adds .f-dark) */
img.f-dark{filter:brightness(1.32) contrast(1.06) saturate(1.12)}
@media(prefers-reduced-motion:reduce){.f-ack,:where(button,[role=button])[aria-busy=true]::after{animation:none}:where(.f-toast,.gk-toast){transition:none}}
