/* modularOS site v9 — widget-zywy: the live widget by the notch.
   It is the SAME element the opening leaves in the pinned menu bar (.mbar > #w from v8 hero.css). widget-zywy.js adds the class
   .mos to it when the opening has ended, and from then on the widget behaves as in the app: a list under the notch, cards,
   Glauka and her draft to the LEFT, other Macs and other people to the RIGHT.
   Loaded after site.css and hero.css. Tokens used, all from v8, none redefined:
   site.css  --shell --tx --tx2 --dim --cu --amber --green --red --link --line --plate --plate-h --ink --ink-2 --muted
             --mono --sans --band --ear --ease --t-fold --t-ui
   hero.css  --notch --wing (220/75 px; 110/64 px up to 640 px)
   Interfaces are 1:1 in px: JetBrains Mono 12/17, rows 22, key line 11/16, surfaces 360. Nothing is scaled. */
:root{
  --mos-xr:18px;            /* the right wing is this much wider than the left one: two Macs and one person */
  --mos-hov:#1c1b19;        /* the only fill inside a surface: the row or key under the pointer */
  --mos-mk:#a39b91;         /* outline of a Mac mark */
  --mos-wl:calc(28px + var(--wing));                 /* left wing: the dots of this Mac (v8 geometry) */
  --mos-wr:calc(28px + var(--wing) + var(--mos-xr)); /* right wing: other Macs, other people */
}

/* ── 1. the band: v8 shell, wings sized to their content, the camera stays on the screen's axis ── */
.w.mos{--mos-nl:calc(50% - var(--notch)/2)}          /* where the notch starts inside the shell; phones keep v8's centred shell */
@media (min-width:641px){
  .w.mos{--mos-nl:var(--mos-wl);left:calc(50% - var(--notch)/2 - var(--mos-wl));transform:none;
    width:calc(var(--notch) + var(--mos-wl) + var(--mos-wr))}
  .w.mos.open,.w.mos.open.wide{width:calc(var(--notch) + var(--mos-wl) + var(--mos-wr))}   /* the list is as wide as the band, never narrower */
}
.w.mos .w-notch{left:var(--mos-nl);margin-left:0}
.w.mos .w-dw{right:calc(100% - var(--mos-nl) + 10px)}
.w.mos::before,.w.mos::after{top:var(--band)}        /* the ears sit where the open shell leaves the black bar */
.w.mos .d{transition:opacity .15s,transform .2s,background-color .25s ease-out,box-shadow .2s}
.w.mos .d.mos-ring{box-shadow:0 0 0 2px var(--shell),0 0 0 3.5px var(--link)}   /* Glauka's wire: the agent a draft will go to */

.mos-hit,.mos-rw{display:none}
.w.mos .mos-hit{all:unset;box-sizing:border-box;position:absolute;z-index:2;left:0;top:0;display:block;width:calc(var(--mos-nl) + var(--notch));height:var(--band);cursor:pointer;border-radius:0 0 10px 10px}
.w.mos .mos-hit:focus-visible{outline:2px solid var(--tx);outline-offset:-4px}
.w.mos .mos-rw{position:absolute;z-index:2;top:0;left:calc(var(--mos-nl) + var(--notch) + 10px);display:flex;align-items:center;gap:8px;height:var(--band);animation:mos-rw .35s ease-out both}
@keyframes mos-rw{from{opacity:0}}
/* handoff from the v8 opening: its four blue team dots (.mp-team, right of the notch) give their place to the Mac marks and the teammate */
.mos-live .mp-team{opacity:0!important;transition:opacity .25s ease-out}
.mos-mk{all:unset;box-sizing:border-box;position:relative;flex:none;display:block;width:27px;height:22px;cursor:pointer}
.mos-mk::before{content:"";position:absolute;inset:-8px -4px}                     /* the whole height of the band answers */
.mos-mk:focus-visible{outline:2px solid var(--tx);outline-offset:3px;border-radius:5px}
.mos-mk .mos-b{position:absolute;box-sizing:border-box;display:grid;place-items:center;border:1.25px solid var(--mos-mk);font:700 11px/1 var(--mono);font-style:normal;color:var(--tx);transition:border-color var(--t-ui) ease-out}
.mos-mk[data-kind="mini"] .mos-b{left:2px;top:4.5px;width:23px;height:13px;border-radius:4px}
.mos-mk[data-kind="studio"] .mos-b{left:4px;top:.5px;width:19px;height:21px;border-radius:5px}
.mos-mk:hover .mos-b,.mos-mk.mos-sel .mos-b{border-color:var(--tx)}
.mos-face{position:absolute;inset:0;display:block;background:center/contain no-repeat;transition:transform var(--t-ui) ease-out}
.mos-mk:hover .mos-face,.mos-mk.mos-sel .mos-face{transform:scale(1.08)}
/* one state sign in the whole right wing (need > failed > done > working) */
.mos-pp{position:absolute;right:-3px;bottom:-2px;width:7px;height:7px;border-radius:50%;box-shadow:0 0 0 2px #000;opacity:0;transform:scale(.3);transition:opacity .15s,transform .2s;font-style:normal;pointer-events:none}
.mos-pp.work,.mos-pp.done,.mos-pp.bad,.mos-pp.need{opacity:1;transform:none}
.mos-pp.work{background:var(--cu)}.mos-pp.done{background:var(--green)}.mos-pp.bad{background:var(--red)}
.mos-pp.need{right:-6px;bottom:-4px;width:11px;height:11px;background:var(--amber);font:800 9px/11.5px var(--mono);text-align:center;color:#000}

/* ── 2. one typeface, one row, one line of keys: the shell's card and both side surfaces ──
   Only mos-* classes and data-k kinds inside: v8 has global .st, .face, .ring, .work/.need/.done/.idle. */
.w.mos .mos-card,.mos-sf{font:400 12px/17px var(--mono);font-variant-ligatures:none;color:var(--tx);text-align:left;letter-spacing:0}
.w.mos[data-c="mos"] .mos-card{display:block;padding:3px 14px 10px}
.w.mos .mos-card:focus,.mos-sf:focus{outline:none}
.mos-sf{position:absolute;z-index:1;top:calc(var(--band) + 3px);box-sizing:border-box;width:360px;max-height:320px;overflow:hidden;display:flex;flex-direction:column;padding:11px 14px 10px;border-radius:var(--r-shell,14px);background:var(--shell);
  box-shadow:0 10px 28px rgba(37,36,31,.22);opacity:0;visibility:hidden;transform:translateY(-6px);transition:opacity .18s ease-out,transform var(--t-fold) var(--ease),visibility 0s linear .2s}
.mos-sf.mos-on{opacity:1;visibility:visible;transform:none;transition-delay:0s}
.mos-sf>*,.mos-card>*{flex:none}

/* the addressee row: reads like a prompt. Names bold, › between them, the state on the right. */
.mos-hd{display:flex;align-items:center;gap:6px;height:22px;white-space:nowrap}
.mos-sf>.mos-hd:first-child{margin-top:-3px}                                       /* first row of a surface stands 8 px from its top edge */
.mos-to{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font-weight:600;color:var(--tx)}
.mos-hd .mos-pj{flex:0 100 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--tx2)}
.mos-gt{flex:none;color:var(--dim)}
.mos-t{flex:none;margin-left:6px;color:var(--tx2);font-variant-numeric:tabular-nums}
.mos-st{flex:none;margin-left:auto;padding-left:6px;display:flex;align-items:center;gap:6px;color:var(--tx2);font-variant-numeric:tabular-nums;white-space:pre}
.mos-tail{flex:1 1 0;min-width:0;margin-left:4px;overflow:hidden;text-overflow:ellipsis;color:var(--dim)}
.mos-tail.mos-tx{color:var(--tx)}.mos-tail.mos-tx2{color:var(--tx2)}
.mos-okk{flex:none;margin-left:4px;color:var(--green)}
.mos-no{flex:none;margin-left:4px;color:var(--tx2)}
.mos-qm{flex:none;margin-left:4px;font-weight:700;color:var(--amber)}
.mos-hd>.ld{margin-right:2px}
.mos-hd+.mos-ln,.mos-hd+.mos-row,.mos-hd+.mos-gp{margin-top:3px}
.mos-st.mos-am{color:var(--amber)}.mos-st.mos-ok{color:var(--green)}.mos-st.mos-hi{color:var(--tx)}
.mos-i{flex:none;display:block;width:11px;height:11px}
.mos-hd>.mos-i:first-child{color:var(--tx2)}
.mos-i.mos-chev{width:9px;height:9px;color:var(--tx2)}
.mos-stop{all:unset;flex:none;position:relative;isolation:isolate;margin-left:auto;display:flex;align-items:center;gap:7px;font-weight:600;color:var(--tx);cursor:pointer}
.mos-stop i{display:block;width:8px;height:8px;border-radius:2px;background:var(--tx)}

/* a line of text: a 14 px column for its sign, then the words */
.mos-ln{display:grid;grid-template-columns:14px minmax(0,1fr)}
.mos-ln p{margin:0;color:var(--tx);overflow-wrap:anywhere}
.mos-m{color:var(--dim);font-style:normal}
.w.mos .mos-ln b,.mos-ln b{font-weight:600;color:var(--tx);margin:0 7px 0 0}
.mos-ln code{font:inherit;color:var(--tx)}
.mos-v{color:var(--tx2)}
.mos-ln[data-k~="you"] p{color:var(--tx2)}.mos-ln[data-k~="old"] p{color:var(--dim)}
.mos-ln[data-k~="sg"] .mos-m{color:var(--cu);font-weight:600}
.mos-ln[data-k~="me"] p{color:var(--tx2)}
.mos-ln[data-k~="q"] .mos-m{color:var(--amber);font-weight:700}
.mos-ln[data-k~="ok"] .mos-m{color:var(--green)}
.mos-ln[data-k~="meta"] p{color:var(--tx2)}.mos-ln[data-k~="dm"] p{color:var(--dim)}
.mos-ln[data-k~="ask"] p{color:var(--dim)}
.mos-ln[data-k~="tool"],.mos-ln[data-k~="run"]{padding-left:14px}
.mos-ln[data-k~="tool"] p,.mos-ln[data-k~="tool"] .mos-m{color:var(--dim)}
.mos-ln[data-k~="tool"] p,.mos-ln[data-k~="run"] p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mos-ln[data-k~="run"] .mos-m{color:var(--cu)}.mos-ln[data-k~="run"] p{color:var(--tx2)}
.mos-ln[data-k~="see"] .mos-m,.mos-ln[data-k~="ver"] .mos-m{display:grid;place-items:center start;color:var(--tx)}
.mos-ln[data-k~="ver"] .mos-m,.mos-ln[data-k~="ver"] p{color:var(--tx2)}
.mos-gp{height:6px}.mos-gd{height:12px}
.mos-cur{display:inline-block;width:7px;height:14px;margin-left:1px;vertical-align:-2px;background:var(--tx);animation:mos-cur 1.1s steps(1) infinite}
@keyframes mos-cur{50%{opacity:0}}

/* a row of a list: the same in the shell (this Mac) and on the right (another Mac) */
.mos-row{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:8px;width:calc(100% + 12px);height:22px;margin:0 -6px;padding:0 6px;border-radius:4px;white-space:nowrap;cursor:pointer}
.mos-row:hover,.mos-row:focus-visible,.mos-row.mos-hl{background:var(--mos-hov)}
.mos-row:focus-visible{outline:2px solid var(--tx);outline-offset:-2px}
.mos-row .ld{flex:none}
.w.mos .mos-row b,.mos-row b{flex:none;margin:0;font-weight:600;color:var(--tx)}
.mos-row .mos-pj{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--tx2)}
.mos-s{flex:none;color:var(--tx2)}
.mos-row.mos-idle b,.mos-row.mos-idle .mos-pj,.mos-row.mos-idle .mos-s{color:var(--dim)}
.mos-card .ld.idle,.mos-sf .ld.idle{opacity:.45}

/* the line of keys. Every item is also a button. */
.mos-kl{display:flex;align-items:center;gap:16px;height:16px;margin-top:9px;font:400 11px/16px var(--mono);color:var(--tx2);white-space:nowrap}
.mos-kl>*{flex:none}
.mos-kl kbd{font:500 11px/16px var(--mono);color:var(--tx);margin-right:6px}
.mos-kl kbd:only-child{margin-right:0}
.mos-kr{margin-left:auto;font-variant-numeric:tabular-nums}
.mos-kl.mos-off,.mos-kl.mos-off kbd{color:var(--dim)}
.mos-kl button{all:unset;position:relative;isolation:isolate;color:var(--tx2);cursor:pointer}
.mos-kl button.mos-kr{margin-left:auto}
.mos-kl button::before,.mos-stop::before{content:"";position:absolute;z-index:-1;inset:-5px -7px;border-radius:5px;transition:background-color var(--t-ui) ease-out}
.mos-kl button:hover,.mos-kl button:focus-visible{color:var(--tx)}
.mos-kl button:hover::before,.mos-stop:hover::before{background:var(--mos-hov)}
.mos-kl button:focus-visible,.mos-stop:focus-visible{outline:2px solid var(--tx);outline-offset:4px;border-radius:2px}
.mos-kl button.mos-press{color:var(--tx)}
.mos-kl button.mos-press::before{background:#2e2c29}

/* ── 3. where the side surfaces stand ──
   wide (from 1346 px): Glauka 8 px left of the shell, her surface 12 px left of her; the right surface 8 px right of the shell.
   narrower: Glauka's surface stands under the bar at the shell's left edge (one surface at a time, the script folds the list);
   the right surface stays RIGHT of the notch at every desktop width (v11, owner's correction 1: left = you, right = the team):
   8 px right of the shell while the window has room, else moved in just enough to keep a 16 px margin.
   phone: one sheet under the bar, as wide as the open shell. */
.mos-pet{position:absolute;top:calc(var(--band) + 4px);right:calc(50% + var(--notch)/2 + var(--mos-wl) + 8px);width:64px;height:72px;overflow:hidden;pointer-events:none}
.mos-petb{all:unset;position:absolute;left:0;bottom:2px;display:block;width:64px;height:70px;cursor:pointer;pointer-events:auto;transform:translateY(-112%);visibility:hidden;transition:transform .34s cubic-bezier(.2,.8,.2,1),visibility 0s linear .34s}
.mos-pet.mos-on .mos-petb{transform:none;visibility:visible;transition-delay:0s}
.mos-petb:focus-visible{outline:2px solid var(--ink);outline-offset:-2px;border-radius:8px}
.mos-petb img{position:absolute;left:50%;bottom:0;display:block;height:100%;width:auto;max-width:none;transform:translateX(-50%) scale(var(--ps,1));transform-origin:50% 100%;transition:transform .14s ease-in,opacity .14s ease-in;-webkit-user-drag:none;user-select:none}
.mos-pet.mos-swap .mos-petb img{transform:translateX(-50%) translateY(5px) scale(calc(var(--ps,1)*.82));opacity:0}
.mos-l{right:calc(50% + var(--notch)/2 + var(--mos-wl) + 84px);width:min(360px,calc(50% - var(--notch)/2 - var(--mos-wl) - 92px))}
.mos-r{left:min(calc(50% + var(--notch)/2 + var(--mos-wr) + 8px),calc(100% - 376px));width:360px}
@media (max-width:1345px){
  .mos-l{right:auto;left:calc(50% - var(--notch)/2 - var(--mos-wl));width:360px}
}
@media (max-width:640px){
  :root{--mos-xr:0px}
  .w.mos .mos-rw{gap:6px}
  .w.mos .mos-rw .mos-mk:nth-child(n+2):not([data-person]){display:none}      /* one Mac and one person fit the 92 px wing */
  .mos-l,.mos-r{left:max(var(--w-margin,17px),calc(50% - 180px));right:auto;width:min(360px,calc(100% - 2*var(--w-margin,17px)))}
  .mos-pet{right:auto;left:max(var(--w-margin,17px),calc(50% - 180px))}
  .mos-l{top:calc(var(--band) + 4px + 74px)}                                   /* under Glauka: she stands on her card */
  .mos-row{height:34px}                                                        /* touch: a row is 34 px tall, the type stays 12/17 */
  .mos-kl{height:28px;margin-top:3px}
  .mos-kl button::before{inset:-6px -8px}
  .mos-kl button::after{content:"";position:absolute;inset:-14px -8px}       /* the finger's target: 44 px tall */
  .mos-kl .mos-opt{display:none}
}
@media (hover:none){.mos-kl .mos-kb{display:none}}                                  /* keys nobody can press on a touch screen */

/* ── 4. motion: transform and opacity only; all of it off under prefers-reduced-motion (site.css) and under .mos-still ── */
.mos-fx .mos-n{animation:mos-in .26s ease-out both;animation-delay:calc(var(--i,0)*.2s)}
@keyframes mos-in{from{opacity:0;transform:translateY(4px)}}
.mos-still .mbar,.mos-still .mbar *,.mos-still .mbar *::before,.mos-still .mbar *::after{transition:none!important;animation:none!important}
@media (prefers-reduced-motion:reduce){.mos-cur{animation:none}}

/* ── 5. the demo (round 3) ── */
.mos-fx.mos-fast .mos-n{animation-delay:calc(var(--i,0)*.06s)}                 /* the list of agents: a row every 60 ms */
.mos-ln[data-k~="old"].mos-n{animation-duration:.2s}
.mos-ln[data-k~="lit"] p{color:var(--tx);transition:color .3s ease-out}         /* a past prompt the new one has just used */
/* the compact form: one line in the shell under the notch, a head or a Mac mark first, the rest cut with an ellipsis */
.mos-cf{flex:none;display:block;width:22px;height:18px;margin-right:2px;background:center/contain no-repeat}
.mos-cf[data-f="copper"]{background-image:url(face-copper.webp)}
.mos-cf[data-f="nora"]{background-image:url(team-blue.webp)}
.mos-cf[data-f="sam"]{background-image:url(team-violet.webp)}
.mos-cf[data-f="ines"]{background-image:url(team-teal.webp)}
.mos-sf .mos-hd .mos-cf{margin-right:4px}
.mos-cmk{box-sizing:border-box;flex:none;display:grid;place-items:center;width:23px;height:13px;margin:0 4px 0 2px;border:1.25px solid var(--mos-mk);border-radius:4px;font:700 11px/1 var(--mono);font-style:normal;color:var(--tx)}
.mos-okc{flex:none;color:var(--green)}
.mos-run{flex:none;margin-left:8px;color:var(--cu)}
.mos-hd .mos-t+.mos-run{margin-left:10px}
.mos-card>.mos-hd:only-child .mos-tail{flex:1 1 0}
/* while the page scrolls the surfaces fold up to the band and come back where they were (demo.js: html.mos-roll) */
html.mos-roll .w.mos.open .w-fold{grid-template-rows:0fr;transition-duration:.14s}
html.mos-roll .w.mos::before,html.mos-roll .w.mos::after{opacity:0}
html.mos-roll .mos-sf.mos-on{opacity:0;visibility:hidden;transform:translateY(-6px);transition:opacity .14s ease-out,transform .14s ease-out,visibility 0s linear .14s}
html.mos-roll .mos-pet.mos-on .mos-petb{transform:translateY(-112%);visibility:hidden}

/* ── 6. v11 (decyzje-v11 §2.2): three dots, the team's owls ── */
/* the opening leaves five dots; when the widget takes over, the ones beyond the three agents fade out and close the gap */
.w.mos .w-dw .d.mos-gone{animation:mos-gone .45s ease-out forwards;pointer-events:none}
@keyframes mos-gone{60%{opacity:0;transform:scale(.4)}100%{opacity:0;transform:scale(.4);width:0;margin-left:-7px}}
/* the team, right of the notch: each person an owl of their own colour, flying in one after another */
.mos-mk[data-person]{opacity:0;transform:translateX(14px) scale(.6);visibility:hidden;transition:opacity .3s ease-out,transform .42s cubic-bezier(.2,.8,.2,1),visibility 0s linear .42s}
.mos-mk[data-person].mos-in{opacity:1;transform:none;visibility:visible;transition-delay:0s}
/* the one whose agent asks comes up to the notch */
.mos-mk[data-person].mos-in.mos-near{transform:translateX(-4px) scale(1.14)}
@media (max-width:640px){
  .w.mos .mos-rw{gap:4px}
  .mos-mk[data-person]{width:24px}
}
@media (prefers-reduced-motion:reduce){.w.mos .w-dw .d.mos-gone{animation:none;display:none}.mos-mk[data-person]{transition:none}}
/* a teammate's request: the card carries a thin outline in the colour of their owl, a little muted (owner's correction 1);
   1 px of the padding gives way to it, so the card keeps its size. Nora #5882de, Sam #9266be, Ines #009ca5 (widget-zywy.js DATA.people) */
.mos-r.mos-pc{border:1px solid var(--mos-pc);border-color:color-mix(in srgb,var(--mos-pc) 72%,var(--shell));padding:10px 13px 9px}
/* round 3 (control 2, look W2): the team's request as one line under the notch has the same outline, around the line itself
   (inside the 22 px row, so the line keeps its 35 px); then the whole question and "allow" at its end */
.w.mos .mos-card.mos-pc>.mos-hd{box-sizing:border-box;margin:0 -9px;padding:0 7px;border:1px solid var(--mos-pc);border-color:color-mix(in srgb,var(--mos-pc) 72%,var(--shell));border-radius:7px}
.mos-st.mos-al{padding-left:0;color:var(--tx)}
.mos-st.mos-al kbd{font:500 12px/17px var(--mono);color:var(--tx)}
@media (max-width:640px),(hover:none){.mos-st.mos-al kbd{display:none}}
@media (max-width:640px),(hover:none){.mos-r .mos-kl kbd:not(:only-child){display:none}}  /* round 4 (control 3, D3): the team's card on a phone, words only, as its line */                  /* no Return key on a phone: the word alone */
/* on the strip (demo.js) the card may push the contents strip down under it: the card shows once the strip has moved (0.2 s) */
@media (max-width:899px){.mos-r.mos-on{transition-delay:.2s,.2s,0s}}
