/* MOTION-2026-11-04 — Sentinel Command motion layer (Motion & Quality
   Design Program, COMMAND lane). Patterns M-03/M-08/M-09/M-13/M-14/
   M-15/M-16 + ten-state support styles, per DESIGN-LANGUAGE.md.
   M-18-2026-11-07 (Icon State-Morph Program, LANE C): M-18(d)
   search<->X on the global search + M-18(b) download story-arc on
   the shell's genuine download/export buttons — styles below.
   Palette: the shell's own tokens only (black/white/green — no
   purple, ever). Every animation has a reduced-motion collapse at
   the bottom of this file; motion.js also gates on the same media
   query and never starts a pattern under reduced motion. */

/* ---------- M-14 sliding indicator (nav groups + pill tab bars) -- */
.sc-pillhost{position:relative}
.sc-pill{position:absolute;left:0;top:0;border-radius:10px;
 background:var(--grn-tint);border:1px solid #1d3a24;
 box-shadow:inset 3px 0 0 var(--grn);pointer-events:none;opacity:0;
 transition:transform .26s var(--ease),width .26s var(--ease),
   height .26s var(--ease),opacity .18s var(--ease);z-index:0}
.crmtabs .sc-pill{border-radius:999px;background:var(--grn);
 border-color:var(--grn);box-shadow:none}
.sc-pillhost>*{position:relative;z-index:1}
.navlinks.sc-pillhost button.on{background:transparent;
 border-color:transparent;box-shadow:none}
.crmtabs.sc-pillhost button{background:transparent}
.crmtabs.sc-pillhost button.on{color:var(--grn-ink)}

/* ---------- M-15 origin-anchored menus --------------------------- */
/* The global-search dropdown grows out of the search field that
   opened it (its trigger sits directly above, left-aligned). */
.gsdrop{transform-origin:0 0}
.gsdrop:not([hidden]){animation:scDropIn .18s var(--ease) both}
@keyframes scDropIn{from{opacity:0;transform:scale(.96) translateY(-3px)}
 to{opacity:1;transform:scale(1) translateY(0)}}
.gssugg{padding:9px 10px 10px;border-top:1px solid var(--line);
 color:var(--mut);font-size:13px}
.gssugg-lbl{display:block;font-size:10.5px;font-weight:800;
 letter-spacing:1.6px;text-transform:uppercase;color:var(--grn);
 margin-bottom:2px}

/* ---------- M-13 error shake ------------------------------------- */
.sc-shake{animation:scShake .35s var(--ease) both}
@keyframes scShake{0%,100%{transform:translateX(0)}
 18%{transform:translateX(-9px)}38%{transform:translateX(7px)}
 58%{transform:translateX(-5px)}78%{transform:translateX(3px)}}

/* ---------- M-08 submit morph + M-06 drawn tick ------------------ */
button.sc-morphing{border-radius:999px!important;margin-left:auto;
 margin-right:auto;flex:none!important;display:inline-flex;
 align-items:center;justify-content:center;overflow:hidden;
 transition:width .26s var(--ease),height .26s var(--ease),
   border-radius .26s var(--ease)}
.sc-spin{width:22px;height:22px;border-radius:50%;flex:none;
 border:3px solid rgba(0,230,118,.25);border-top-color:var(--grn);
 animation:scSpin .7s linear infinite}
@keyframes scSpin{to{transform:rotate(360deg)}}
button.sc-morph-done{background:var(--grn)!important;
 border-color:var(--grn)!important}
.sc-tick{stroke:var(--grn-ink);stroke-width:3.4;stroke-linecap:round;
 stroke-linejoin:round;display:block}
.sc-tick circle{stroke-dasharray:151;stroke-dashoffset:151;
 animation:scTickC .28s var(--ease) forwards}
.sc-tick path{stroke-dasharray:40;stroke-dashoffset:40;
 animation:scTickP .19s var(--ease) .28s forwards}
@keyframes scTickC{to{stroke-dashoffset:0}}
@keyframes scTickP{to{stroke-dashoffset:0}}

/* ---------- M-03 rolling digits ---------------------------------- */
.sc-digit{display:inline-block;height:1em;overflow:hidden;
 vertical-align:baseline;line-height:1}
.sc-strip{display:flex;flex-direction:column;
 transition:transform .5s var(--ease)}
.sc-strip>span{height:1em;line-height:1;display:block}
.sc-sep{display:inline-block}

/* ---------- M-09 capped list stagger ----------------------------- */
.sc-rowin{animation:scRowIn .35s var(--ease) both}
@keyframes scRowIn{from{opacity:0;transform:translateY(6px)}
 to{opacity:1;transform:translateY(0)}}

/* ---------- M-16 glide-on-delete --------------------------------- */
.sc-collapsing{overflow:hidden;transition:height .26s var(--ease),
 opacity .26s var(--ease);opacity:0}
.sc-glide{transition:transform .26s var(--ease)}

/* ---------- ten-state support ------------------------------------ */
.sc-banner{max-width:1180px;margin:0 0 16px;padding:13px 16px;
 border:1px solid #1d3a24;background:var(--grn-tint);
 border-radius:var(--r);display:flex;gap:12px;align-items:center;
 flex-wrap:wrap;animation:scRowIn .35s var(--ease) both}
.sc-banner p{margin:0;flex:1;min-width:220px}
.sc-expired-note{border:1px solid #1d3a24;background:var(--grn-tint);
 border-radius:10px;padding:11px 14px;margin:0 0 16px;font-size:14px}
.sc-offline{position:fixed;top:14px;left:50%;transform:translateX(-50%);
 z-index:1200;background:#0a140a;color:#eaffea;
 border:1px solid var(--grn);border-radius:999px;
 padding:9px 18px;font-weight:600;font-size:14px;
 box-shadow:0 8px 30px rgba(0,0,0,.5);animation:scRowIn .35s var(--ease) both}
.sc-stepper>span.mut{font-size:0;width:22px;height:2px;flex:none;
 background:var(--line2);border-radius:2px;align-self:center}

/* ---------- M-18 (d) search<->X morph (global search) ----------- */
/* b23 wraps #gsearchInput in .sc-gsearchwrap and adds ONE morph
   button: magnifier when search is closed/empty, X while results
   are open or a query is present. Opening and closing are the same
   400 ms motion forward/reverse: the circle undraws, the handle
   swings away, the X strokes draw in. */
.sc-gsearchwrap{position:relative;display:block}
.sc-gsearchwrap input{padding-right:46px}
.sc-gsearchwrap input::-webkit-search-cancel-button{
 -webkit-appearance:none;appearance:none}
.sc-gsmorph{position:absolute;right:5px;top:50%;
 transform:translateY(-50%);width:34px;height:34px;min-height:34px;
 padding:0;display:inline-flex;align-items:center;justify-content:center;
 background:transparent;border:1px solid transparent;border-radius:8px;
 box-shadow:none;color:var(--mut)}
.sc-gsmorph:hover{background:rgba(0,230,118,.08);
 border-color:transparent;color:var(--grn)}
.sc-gsmorph svg{display:block}
.sc-gsmorph .gs-circ{stroke-dasharray:44;stroke-dashoffset:0;
 transition:stroke-dashoffset .4s var(--ease)}
.sc-gsmorph .gs-handle{transform-origin:14.2px 14.2px;
 transition:transform .4s var(--ease),opacity .25s var(--ease)}
.sc-gsmorph .gs-x1,.sc-gsmorph .gs-x2{stroke-dasharray:10;
 stroke-dashoffset:10}
.sc-gsmorph .gs-x1{transition:stroke-dashoffset .22s var(--ease) .1s}
.sc-gsmorph .gs-x2{transition:stroke-dashoffset .22s var(--ease) .17s}
.sc-gsmorph.is-x .gs-circ{stroke-dashoffset:44}
.sc-gsmorph.is-x .gs-handle{transform:rotate(180deg);opacity:0}
.sc-gsmorph.is-x .gs-x1,.sc-gsmorph.is-x .gs-x2{stroke-dashoffset:0}

/* ---------- M-18 (b) download story-arc -------------------------- */
/* A 15px state icon prepended by b23 to the shell's genuine
   download/export buttons (backup bundle, full archive, form-file
   Download, audit CSV, tax pack, PDF documents). Click: the arrow
   drops in, a ring sweeps to ~74% (indeterminate — no Command
   download reports a real progress value to its button), the ring
   completes and a tick draws: the 1.2 s story. The file download
   itself fires immediately in parallel; the icon never gates it. */
.sc-dlic{display:inline-flex;align-items:center;justify-content:center;
 width:16px;height:16px;margin-right:7px;vertical-align:-3px;flex:none}
.sc-dlic svg{display:block;overflow:visible}
.sc-dlic .dl-arrow{transition:transform .18s var(--ease),
 opacity .18s var(--ease)}
.sc-dlic .dl-ring{stroke-dasharray:47;stroke-dashoffset:47;opacity:0;
 transition:stroke-dashoffset .8s var(--ease),opacity .15s var(--ease)}
.sc-dlic .dl-tick{stroke-dasharray:12;stroke-dashoffset:12}
.sc-dlic.run .dl-arrow{transform:translateY(4px);opacity:0}
.sc-dlic.run .dl-ring{stroke-dashoffset:12;opacity:1}
.sc-dlic.done .dl-arrow{opacity:0}
.sc-dlic.done .dl-ring{stroke-dashoffset:0;opacity:1;
 transition:stroke-dashoffset .18s var(--ease),opacity .15s var(--ease)}
.sc-dlic.done .dl-tick{stroke-dashoffset:0;
 transition:stroke-dashoffset .22s var(--ease) .1s}

/* ---------- reduced motion: every pattern collapses -------------- */
@media (prefers-reduced-motion:reduce){
 .sc-pill,.sc-strip,.sc-collapsing,.sc-glide{transition:none!important}
 .sc-gsmorph .gs-circ,.sc-gsmorph .gs-handle,
 .sc-gsmorph .gs-x1,.sc-gsmorph .gs-x2,
 .sc-dlic .dl-arrow,.sc-dlic .dl-ring,.sc-dlic .dl-tick{
  transition:none!important}
 .sc-shake,.sc-rowin,.sc-banner,.sc-offline,
 .gsdrop:not([hidden]){animation:none!important}
 .sc-spin{animation-duration:1.6s}
 .sc-tick circle,.sc-tick path{animation:none;stroke-dashoffset:0}
}

/* ---------- M-19 (2026-11-09) + C10 First Run ------------------- */
/* MORE CONTENT + FEATURES PROGRAM, Command shell lane (C9/C10).
   Patterns per MOTION-STUDY-2026-11-08-SIX-DETAILS.md M-19a/b/c,
   built on the estate tokens in DESIGN-LANGUAGE.md. The shell had
   named only --ease (which IS the estate ease-out curve); --spring
   (overshoot settle) and --damped (gesture follow) are tokenised
   here for the first time. Palette: the shell's own tokens only. */
:root{--spring:cubic-bezier(.34,1.56,.64,1);
 --damped:cubic-bezier(.25,.46,.45,.94)}

/* M-19a sheet — the existing #dlg as a bottom sheet at phone
   widths ONLY (the shell's own 860px mobile breakpoint). Desktop
   keeps the centred dialog exactly as-is. Enter: 350ms rise on
   the ease-out family; backdrop fades in over 200ms reusing the
   shell's existing ::backdrop dim. Drag physics live in b23
   (damped follow, spring snap); exit is a 260ms slide-down run
   by the b23 close wrapper. EXPANSION: a grab pill marks the
   drag affordance (estate line colour, no new hues). */
.sc-sheet-grab{display:none}
@media (max-width:860px){
 #dlg{top:auto;bottom:0;left:0;right:0;margin:0;width:100%;
  max-width:100%;max-height:88vh;border-radius:18px 18px 0 0;
  border-bottom:none;padding-top:36px}
 #dlg[open]{animation:scSheetIn .35s var(--ease) backwards}
 #dlg::backdrop{animation:scSheetBgIn .2s var(--ease) backwards}
 .sc-sheet-grab{display:block;position:absolute;top:9px;left:50%;
  transform:translateX(-50%);width:44px;height:5px;border-radius:99px;
  background:var(--line2);cursor:grab;touch-action:none;z-index:2}
}
@keyframes scSheetIn{from{transform:translateY(100%)}
 to{transform:translateY(0)}}
@keyframes scSheetBgIn{from{opacity:0}to{opacity:1}}
@keyframes scSheetFade{from{opacity:0}to{opacity:1}}

/* M-19b toast stack — motion only; the stack layout + pill paint
   live with the #toast rules in index.html. Newcomer (front,
   :nth-child(1) under column-reverse) slides up 64px over 260ms
   ease-out; elders step back over 200ms (translate/scale/opacity
   per the study: -10px / .96 / .75, then -20px / .92 / .5);
   exit fades/slides down over 200ms and the stack steps forward
   as :nth-child positions shift. */
#toast .sc-toast{animation:scToastIn .26s var(--ease) backwards;
 transition:transform .2s var(--ease),opacity .2s var(--ease)}
@keyframes scToastIn{from{opacity:0;transform:translateY(64px)}
 to{opacity:1;transform:translateY(0)}}
@keyframes scToastFade{from{opacity:0}to{opacity:1}}
#toast .sc-toast:nth-child(2){transform:translateY(-10px) scale(.96);
 opacity:.75}
#toast .sc-toast:nth-child(3){transform:translateY(-20px) scale(.92);
 opacity:.5}
#toast .sc-toast.sc-toast-out{opacity:0;transform:translateY(12px)}

/* M-19c drag lift + settle (M-04 amendment) — on dragstart the
   source board card takes the sanctioned 105% lift (180ms
   ease-out, soft shadow); on drop the landed card settles
   1.05 -> ~0.98 -> 1.0 on --spring over 260ms. The reel's 55%
   land is explicitly NOT adopted. The .pipecol .drop glow is
   unchanged (already the standard). */
.pipecard.sc-draglift{transform:scale(1.05);
 box-shadow:0 14px 34px rgba(0,0,0,.5);
 transition:transform .18s var(--ease),box-shadow .18s var(--ease)}
.pipecard.sc-settle{animation:scSettle .26s var(--spring) both}
@keyframes scSettle{0%{transform:scale(1.05)}
 55%{transform:scale(.98)}100%{transform:scale(1)}}

/* C10 First Run panel (dashboard) — checklist paint; all values
   ride payloads the shell already receives (see dashFirstRun). */
.sc-firstrun-list{list-style:none;margin:10px 0 0;padding:0;
 display:grid;gap:8px}
.sc-firstrun-list li{display:flex;gap:10px;align-items:center;
 flex-wrap:wrap}
.sc-firstrun-list li.done{color:var(--mut)}
.sc-firstrun-mark{display:inline-flex;align-items:center;
 justify-content:center;width:22px;height:22px;flex:none;
 border-radius:50%;border:1px solid var(--grn);color:var(--grn);
 font-size:13px;font-weight:800}
.sc-firstrun-list li.done .sc-firstrun-mark{background:var(--grn);
 color:var(--grn-ink)}

/* M-19 reduced motion: no rise, no follow, no spring, no lift,
   no settle, no slide — fades of <=120ms or instant state only.
   The .drop glow stays (a colour state, not motion). */
@media (prefers-reduced-motion:reduce){
 #toast .sc-toast{animation:scToastFade .12s linear backwards;
  transition:none!important}
 #toast .sc-toast:nth-child(2),#toast .sc-toast:nth-child(3){
  transform:none}
 .pipecard.sc-draglift{transform:none}
 .pipecard.sc-settle{animation:none!important}
}
@media (max-width:860px) and (prefers-reduced-motion:reduce){
 #dlg[open]{animation:scSheetFade .12s linear backwards}
 #dlg::backdrop{animation:scSheetFade .12s linear backwards}
}
