/* Flow (19 Nov 2026). The pictures for a change of page, and the press of a control. See assets/flow.js.
   Loaded first in <head> on every page, so the browser knows the page takes part before it draws anything. */
@view-transition{navigation:auto}

/* ---------- public pages: the header holds its place, the page crossfades (the house's own timing: out .16s, in .22s) ---------- */
html[data-flow=public]::view-transition-old(root){animation:fl-out var(--dur-1,.12s) var(--ease,ease-out) both;mix-blend-mode:normal}
html[data-flow=public]::view-transition-new(root){animation:fl-in var(--dur-2,.2s) .08s var(--ease,ease-out) both;mix-blend-mode:normal}
@keyframes fl-out{to{opacity:0}}
@keyframes fl-in{from{opacity:0}}
html[data-flow=public].fl-changing .hd{view-transition-name:site-head}   /* named only while a page change runs (flow.js) */
html[data-flow=public]::view-transition-group(site-head){animation-duration:var(--dur-2,.2s);animation-timing-function:cubic-bezier(.16,1,.3,1)}

/* ---------- signed-in pages: the mark on the current page slides to its new place ----------
   The mark is its own element (app-shell.js adds .app-nav-pill to the current item) so only the tint travels; the
   labels stay where they are. Multiply lets the label under the travelling tint show through it. */
body.has-app-shell .app-sidebar .app-nav-item[aria-current=page]:has(.app-nav-pill){background:transparent;box-shadow:none;isolation:isolate}
body.has-app-shell .app-sidebar .app-nav-item>.app-nav-pill{display:block;position:absolute;inset:0;width:auto;height:auto;margin:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--accent-tint);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 10%,transparent);view-transition-name:app-nav-pill}
::view-transition-group(app-nav-pill){animation-duration:var(--dur-3,.32s);animation-timing-function:cubic-bezier(.16,1,.3,1);mix-blend-mode:multiply}
::view-transition-old(app-nav-pill):not(:only-child){display:none}
::view-transition-new(app-nav-pill):not(:only-child){animation:none}
/* on a phone the sidebar is a drawer that is shut on the new page: nothing to slide to */
@media(max-width:760px){body.has-app-shell .app-sidebar .app-nav-item>.app-nav-pill{view-transition-name:none}}

/* ---------- press: a control answers the finger at once ---------- */
html[data-flow] :is(.app-nav-item,.app-profile,.h-btn,.btn,.pc-btn):active{scale:.98}
@media(prefers-reduced-motion:no-preference){
 html[data-flow] body.has-app-shell .app-sidebar :is(.app-nav-item,.app-profile){transition:background-color var(--dur-1,.12s) var(--ease,cubic-bezier(.22,.61,.36,1)),color var(--dur-1,.12s) var(--ease,cubic-bezier(.22,.61,.36,1)),box-shadow var(--dur-1,.12s) var(--ease,cubic-bezier(.22,.61,.36,1)),scale var(--dur-1,.12s) var(--ease,cubic-bezier(.22,.61,.36,1))}
}

@media(prefers-reduced-motion:reduce){
 html[data-flow=public]::view-transition-old(root),html[data-flow=public]::view-transition-new(root){animation:none}
 ::view-transition-group(site-head),::view-transition-group(app-nav-pill){animation:none}
 html[data-flow] :is(.app-nav-item,.app-profile,.h-btn,.btn,.pc-btn):active{scale:none}
}

/* A row that is fetching what it opens: it stays where it is and shows a hairline working along its foot.
   The line waits a quarter second, so a quick answer shows nothing at all. */
a[aria-busy=true]{position:relative;cursor:progress}
a[aria-busy=true]::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;border-radius:2px;background:var(--accent,#2b2d6e);transform-origin:left;opacity:0;animation:fl-busy 1.1s .25s cubic-bezier(.22,.61,.36,1) infinite}
@keyframes fl-busy{0%{opacity:.7;transform:scaleX(0)}60%{opacity:.7;transform:scaleX(1)}100%{opacity:0;transform:scaleX(1)}}
@media (prefers-reduced-motion:reduce){a[aria-busy=true]::after{animation:none;opacity:.5}}

/* While the view changes, the sidebar does not also slide: opening a memorandum folds the sidebar, and the fold
   used to run under the crossfade and push the text sideways as it arrived. It now folds in the same instant. */
html.hv-route body.has-app-shell{--shell-dur:0s}
html.hv-route::view-transition-old(app-sidebar){animation:hv-out var(--dur-1,.12s) var(--ease,ease-out) both!important;mix-blend-mode:normal}
html.hv-route::view-transition-new(app-sidebar){mix-blend-mode:normal}

/* ---------- pop-ups: one rule (19 Nov) ----------
   Counted that day: 32 pop-up surfaces; 14 had no motion at all and most of the rest opened with motion and closed
   with none. The rule, on the site's own scale (tokens.css): a pop-up arrives in --dur-2 (200ms) from 4px off its
   place, and leaves in --dur-1 (120ms) without moving; leaving is always the quicker. One curve, --ease.
   It is done in CSS alone (@starting-style and transition-behavior), so no page's script changes; a browser
   without those simply opens and closes at once, as before. */
@media (prefers-reduced-motion:no-preference){
 /* menus and popovers shown and hidden with the hidden attribute */
 :is(.cs-menu,.lk-mode-menu,.card-menu,.tr-ws-menu,.popover):not(#_){animation:none;opacity:1;translate:0 0;
  transition:opacity var(--dur-2,.2s) var(--ease,ease-out),translate var(--dur-2,.2s) var(--ease,ease-out),display var(--dur-2,.2s) allow-discrete}
 :is(.cs-menu,.lk-mode-menu,.card-menu,.tr-ws-menu,.popover)[hidden]:not(#_){opacity:0;pointer-events:none;
  transition:opacity var(--dur-1,.12s) var(--ease,ease-out),display var(--dur-1,.12s) allow-discrete}
 @starting-style{:is(.cs-menu,.lk-mode-menu,.card-menu,.tr-ws-menu,.popover):not([hidden]):not(#_){opacity:0;translate:0 -4px}}
 /* menus a script draws in when opened: they arrive by the rule; flow.js leaves a copy (.fl-ghost) that goes by it */
 :is(.lb-menu,.dc-menu,.dg-court-menu){transition:opacity var(--dur-2,.2s) var(--ease,ease-out),translate var(--dur-2,.2s) var(--ease,ease-out)}
 @starting-style{:is(.lb-menu,.dc-menu,.dg-court-menu){opacity:0;translate:0 -4px}}
 .fl-leave:not(#_){opacity:0;translate:0 -4px;pointer-events:none;transition:opacity var(--dur-1,.12s) var(--ease,ease-out),translate var(--dur-1,.12s) var(--ease,ease-out)}
 .fl-ghost:not(#_){position:fixed;margin:0;pointer-events:none;z-index:2147483000;animation:fl-ghost var(--dur-1,.12s) var(--ease,ease-out) both;transition:none}
 @keyframes fl-ghost{to{opacity:0}}
 /* the account menu closed at once while the notifications panel, the same surface, faded */
 .hn-panel.account-panel:not(#_){transition:opacity var(--dur-2,.2s) var(--hn-ease,ease-out),transform var(--dur-2,.2s) var(--hn-ease,ease-out),display var(--dur-2,.2s) var(--ease,cubic-bezier(.22,.61,.36,1)) allow-discrete}
 .hn-panel.account-panel[hidden]:not(#_){transition-duration:var(--dur-1,.12s)}
 /* dialogs (the plan gate and the appeal check keep their own, which already follow the rule) */
 dialog:not(.hd-dialog,.hx-ap-dialog){opacity:0;translate:0 8px;animation:none!important;
  transition:opacity var(--dur-1,.12s) var(--ease,ease-out),translate var(--dur-1,.12s) var(--ease,ease-out),overlay var(--dur-1,.12s) allow-discrete,display var(--dur-1,.12s) allow-discrete}
 dialog[open]:not(.hd-dialog,.hx-ap-dialog){opacity:1;translate:0 0;transition-duration:var(--dur-2,.2s)}
 @starting-style{dialog[open]:not(.hd-dialog,.hx-ap-dialog){opacity:0;translate:0 8px}}
 dialog.workspace-panel:not([open]){translate:16px 0}
 @starting-style{dialog.workspace-panel[open]{translate:16px 0}}
 dialog:not(.hd-dialog,.hx-ap-dialog)::backdrop{opacity:0;transition:opacity var(--dur-1,.12s) var(--ease,ease-out),overlay var(--dur-1,.12s) allow-discrete,display var(--dur-1,.12s) allow-discrete}
 dialog[open]:not(.hd-dialog,.hx-ap-dialog)::backdrop{opacity:1;transition-duration:var(--dur-2,.2s)}
 @starting-style{dialog[open]:not(.hd-dialog,.hx-ap-dialog)::backdrop{opacity:0}}
}

/* Lenis (eased wheel scrolling): its own small stylesheet, without the rule that switches iframes off (the document
   readers live in iframes) */
html.lenis,html.lenis body{height:auto}
html.lenis{scroll-behavior:auto!important}
.lenis:not(.lenis-autoToggle).lenis-stopped{overflow:clip}
.lenis [data-lenis-prevent]{overscroll-behavior:contain}

/* Waiting (19 Nov, owner: "it should just open"). A wait says nothing for its first 600 ms: a quick answer is one
   change with no note. Only a slow one gets its words. */
.fl-late{opacity:0;animation:fl-late var(--dur-2,.2s) .6s var(--ease,ease-out) forwards}
@keyframes fl-late{to{opacity:1}}
@media (prefers-reduced-motion:reduce){.fl-late{animation-duration:.01s}}
