/* Premier shared components (Tue 1 Dec 2026), used by every 2027 app on top of tokens.css.
   Source of truth: apps/shared/components.css; scripts/sync-tokens.sh copies it to each site. Never edit a copy.
   Behaviour patterns approved by the user from ClassMusicApp (behaviour only, in Premier's look):
   status as a dot plus a word (with the numbers), blocked actions greyed with the reason, a short Undo after a small
   change, a preview before anything is sent or imported, progress with Stop for long jobs, a visible row menu.
   All classes start with p- so they never collide with an app's own CSS. */

/* Status: a dot and a word, numbers in the word ("Too long · 4:12 of 4:00"). Colour is never the only signal. */
.p-status{display:inline-flex;align-items:center;gap:6px;font-weight:600;font-size:13px;color:var(--ink);white-space:nowrap}
.p-status::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--muted);flex:none}
.p-status.ok::before{background:var(--ok)}.p-status.warn::before{background:var(--warn)}.p-status.bad::before{background:var(--bad)}
.p-status.plum::before{background:var(--plum)}
.p-status .n{font-weight:400;color:var(--muted)}

/* Blocked action: the button stays visible, greyed, with exactly what blocks it underneath. */
.p-blocked{display:inline-grid;gap:4px;justify-items:start}
.p-blocked>button,.p-blocked>.btn{opacity:.5;cursor:not-allowed}
.p-why{font-size:12.5px;color:var(--muted);max-width:36ch;line-height:1.35}

/* Undo: a short-lived bar after a small change or mark. */
.p-undo{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);display:flex;align-items:center;gap:14px;
  background:var(--head);color:#fff;border-bottom:3px solid var(--gold);border-radius:var(--r-panel);padding:10px 12px 10px 16px;font-size:14px;z-index:30;max-width:calc(100vw - 32px)}
.p-undo button{font:600 14px var(--sans);color:var(--head);background:var(--gold);border:0;border-radius:6px;padding:8px 14px;min-height:40px;cursor:pointer}

/* Preview before import or send: every row, with what will be skipped and why. */
.p-preview{border:1px solid var(--line);border-radius:var(--r-panel);overflow:hidden}
.p-preview .p-sum{display:flex;flex-wrap:wrap;gap:6px 18px;padding:10px 14px;background:var(--lilac);font-weight:600}
.p-preview .skip td{color:var(--muted);text-decoration:line-through}
.p-preview .skip td:last-child{text-decoration:none;color:var(--warn)}

/* Progress for long jobs, with Stop. */
.p-progress{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-items:center}
.p-progress .p-track{height:8px;border-radius:4px;background:var(--lilac);overflow:hidden}
.p-progress .p-track i{display:block;height:100%;background:var(--brand);transition:width .3s}
.p-progress .p-label{grid-column:1/-1;font-size:13px;color:var(--muted)}

/* Row menu: a visible "…" button, never hidden on hover. */
.p-more{font:700 18px/1 var(--sans);color:var(--plum);background:var(--ground);border:1.5px solid var(--line);border-radius:6px;min-width:40px;min-height:36px;cursor:pointer}
.p-more[aria-expanded="true"]{border-color:var(--gold)}
.p-menu{position:absolute;z-index:25;background:var(--ground);border:1px solid var(--line);border-top:3px solid var(--gold);border-radius:var(--r-panel);padding:4px;min-width:200px}
.p-menu button{display:block;width:100%;text-align:left;font:500 14px var(--sans);color:var(--ink);background:none;border:0;border-radius:6px;padding:10px 12px;min-height:40px;cursor:pointer}
.p-menu button:hover{background:var(--lilac)}.p-menu button.bad{color:var(--bad)}

/* Page header summary: totals and what needs attention (Office O1, Teacher app T1). */
.p-summary{display:flex;flex-wrap:wrap;gap:6px 18px;margin:-4px 0 14px;font-size:13.5px}
.p-summary b{font-weight:700}
.p-summary .attn{color:var(--warn);font-weight:600}

@media (prefers-reduced-motion:reduce){.p-progress .p-track i{transition:none}}

/* Floating header on phones (header.js; user, Tue 1 Dec 2026: solid plum on a plum band with the gold rule).
   A 70px band leaves 12px round the 46px buttons; the crest sits in the band and the title pill under it. Once the
   page scrolls, the crest fades out and the pill rises into the band showing the page title. Only transforms and opacity
   animate, so it stays smooth; the header is never redrawn, and it never moves the page.
   Markup: <header class="p-fh"> .p-fh-btn.l, .p-fh-crest>img, .p-fh-pill>(.a home words, .b page title), .p-fh-btn.r
   Laptops keep their own slim band: .p-fh shows at 900px wide and under only. */
.p-fh{display:none}
@media (max-width:900px){
  .p-fh{display:block;position:fixed;left:0;right:0;top:0;z-index:16;height:calc(128px + env(safe-area-inset-top,0px));pointer-events:none;
    --fh-top:env(safe-area-inset-top,0px)}
  .p-fh>*{pointer-events:auto}
  .p-fh::before{content:"";position:absolute;left:0;right:0;top:0;height:100%;pointer-events:none;
    background:linear-gradient(var(--ground) 80%,color-mix(in srgb,var(--ground) 0%,transparent));transition:opacity .24s}
  .p-fh::after{content:"";position:absolute;left:0;right:0;top:0;height:calc(70px + var(--fh-top));background:var(--head);border-bottom:3px solid var(--gold);pointer-events:none}
  .p-fh-btn{position:absolute;z-index:3;top:calc(12px + var(--fh-top));width:46px;height:46px;padding:0;border-radius:50%;display:grid;place-items:center;
    background:var(--head);color:#fff;border:1.5px solid var(--gold);cursor:pointer}
  .p-fh-btn.l{left:12px}.p-fh-btn.r{right:12px}
  .p-fh-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  .p-fh-btn .dot{position:absolute;top:6px;right:6px;width:10px;height:10px;border-radius:50%;background:var(--gold);border:2px solid var(--head)}
  .p-fh-btn:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
  .p-fh-crest{position:absolute;z-index:2;left:50%;top:calc(4px + var(--fh-top));margin-left:-31px;width:62px;height:62px;border-radius:50%;
    display:grid;place-items:center;background:var(--head);border:1.5px solid var(--gold);transform-origin:50% 50%;
    transition:transform .24s cubic-bezier(.2,.7,.2,1),opacity .18s;will-change:transform,opacity}
  .p-fh-crest img{width:78%;height:78%}
  .p-fh-pill{position:absolute;z-index:1;left:50%;top:calc(85px + var(--fh-top));transform:translateX(-50%);display:grid;max-width:64%;
    font:600 13.5px/1.25 var(--sans);color:#fff;background:var(--head);padding:6px 16px;border-radius:999px;border:1.5px solid var(--gold);
    transition:transform .24s cubic-bezier(.2,.7,.2,1);will-change:transform}
  .p-fh-pill>span{grid-area:1/1;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .18s}
  .p-fh-pill .b{opacity:0}
  .p-fh-env{position:absolute;z-index:3;left:66px;top:calc(30px + var(--fh-top));font:700 10px/1 var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--gold)}
  .p-fh.p-sc .p-fh-crest{transform:scale(.6);opacity:0}
  .p-fh.p-sc::before{opacity:0}
  .p-fh-env{transition:opacity .18s}.p-fh.p-sc .p-fh-env{opacity:0}
  .p-fh.p-sc .p-fh-pill{transform:translate(-50%,-65px)}
  .p-fh.p-sc .p-fh-pill .a{opacity:0}.p-fh.p-sc .p-fh-pill .b{opacity:1}
  .p-fh.p-notitle .p-fh-pill .a{opacity:1}.p-fh.p-notitle .p-fh-pill .b{opacity:0}
}
@media (prefers-reduced-motion:reduce){.p-fh-crest,.p-fh-pill,.p-fh-pill>span{transition:none}}

/* Bottom navigation on phones: four places and More. Labels under icons, current place highlighted. */
.p-tabbar{display:none}
@media (max-width:900px){
  .p-tabbar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;z-index:17;background:var(--ground);
    border-top:1px solid var(--line);padding:4px 4px calc(4px + env(safe-area-inset-bottom,0px))}
  .p-tabbar button{display:grid;justify-items:center;gap:2px;font:600 11px/1.2 var(--sans);color:var(--muted);background:none;border:0;border-radius:8px;padding:6px 2px;min-height:50px;cursor:pointer}
  .p-tabbar svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .p-tabbar button.on{color:var(--plum);background:var(--lilac)}
}
