/* UPCHub · Demo interactiva — estils */
/* Tokens: els mateixos que assets/styles.css + escala d'espaiat i corbes */
:root{
  --surface-100:#f7f9fc; --surface-200:#e6edf5; --surface-0:#ffffff; --ink:#0b1b2b; --ink-muted:#475a6e;
  --brand:#007bc0; --on-brand:#ffffff; --brand-text:#0069a6; --brand-deep:#003b66; --brand-tint:#d4ecf9;
  --accent:#ffb81c; --on-accent:#0b1b2b; --focus-ring:#0069a6; --border:#8497ab; --line:#d3dde8;
  --ok:#1f9d55; --bad:#d64545; --ok-soft:#dcf3e6; --bad-soft:#fde4e4;
  --c-crit:#d64545; --c-crit-soft:#fde4e4; --c-alt:#c98a00; --c-alt-soft:#fff1cc; --c-norm:#0069a6; --c-norm-soft:#d4ecf9; --c-low:#5b6b7c; --c-low-soft:#e6edf5;
  --font-display:"Bricolage Grotesque","Helvetica Neue",Arial,sans-serif;
  --font-sans:"Manrope","Helvetica Neue",Arial,sans-serif;
  --radius-sm:6px; --radius-md:12px; --radius-lg:24px;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px; --space-6:32px; --space-7:48px; --space-8:64px;
  --ease-out:cubic-bezier(.23,1,.32,1); --ease-in-out:cubic-bezier(.77,0,.175,1);
  --shadow:0 1px 2px rgba(11,27,43,.06),0 8px 24px rgba(11,27,43,.08);
  --logo-light:block; --logo-dark:none;
  --frame:#0b1b2b; --band-h:64px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --surface-100:#071522; --surface-200:#0f2335; --surface-0:#0b1c2c; --ink:#eaf2f9; --ink-muted:#a3b6c8;
    --brand-text:#5bbcf5; --brand-deep:#0a4f82; --brand-tint:#123a57; --accent:#ffc94d;
    --focus-ring:#5bbcf5; --border:#5d7a94; --line:#1f3a52; --logo-light:none; --logo-dark:block;
    --ok:#4fd18b; --bad:#ff7b7b; --ok-soft:#10301f; --bad-soft:#3a1a1f;
    --c-crit:#ff7b7b; --c-crit-soft:#3a1a1f; --c-alt:#ffc94d; --c-alt-soft:#3a2e10; --c-norm:#5bbcf5; --c-norm-soft:#123a57; --c-low:#a3b6c8; --c-low-soft:#16293b;
    --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.35); --frame:#000; color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --surface-100:#071522; --surface-200:#0f2335; --surface-0:#0b1c2c; --ink:#eaf2f9; --ink-muted:#a3b6c8;
  --brand-text:#5bbcf5; --brand-deep:#0a4f82; --brand-tint:#123a57; --accent:#ffc94d;
  --focus-ring:#5bbcf5; --border:#5d7a94; --line:#1f3a52; --logo-light:none; --logo-dark:block;
  --ok:#4fd18b; --bad:#ff7b7b; --ok-soft:#10301f; --bad-soft:#3a1a1f;
  --c-crit:#ff7b7b; --c-crit-soft:#3a1a1f; --c-alt:#ffc94d; --c-alt-soft:#3a2e10; --c-norm:#5bbcf5; --c-norm-soft:#123a57; --c-low:#a3b6c8; --c-low-soft:#16293b;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.35); --frame:#000; color-scheme:dark;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--surface-100);color:var(--ink);font:16px/1.5 var(--font-sans);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
h1,h2,h3{font-family:var(--font-display);line-height:1.15;margin:0;letter-spacing:-.01em;text-wrap:balance}
p{margin:0}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
svg{width:1em;height:1em;flex:none}
img{display:block}
:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
[tabindex="-1"]:focus{outline:none}
::selection{background:var(--brand-tint);color:var(--ink)}
input,textarea,select{caret-color:var(--brand-text);accent-color:var(--brand)}
.result .nums b,.qrow .pv b,.env b{font-variant-numeric:tabular-nums}
[hidden]{display:none!important}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:var(--space-4);top:-60px;z-index:50;display:inline-flex;align-items:center;min-height:44px;background:var(--surface-0);padding:0 var(--space-4);border-radius:var(--radius-sm)}
.skip:focus{top:var(--space-2)}

/* ---------- Botons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);min-height:44px;padding:0 var(--space-5);border-radius:var(--radius-md);border:1px solid transparent;font-weight:700;text-decoration:none;transition:transform 160ms var(--ease-out),background-color 160ms ease,border-color 160ms ease}
.btn:active{transform:scale(.97)}
.btn.pri{background:var(--brand);color:var(--on-brand)}
.btn.sec{background:var(--surface-0);border-color:var(--border);color:var(--ink)}
.btn.ghost{background:transparent;color:var(--brand-text);padding:0 var(--space-3)}
.btn.block{width:100%}
.btn[aria-busy="true"]{pointer-events:none}
.btn .spin{width:18px;height:18px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin 700ms linear infinite}
@media (hover:hover) and (pointer:fine){
  .btn.pri:hover{background:var(--brand-deep)}
  .btn.sec:hover{border-color:var(--brand-text)}
  .btn.ghost:hover{background:var(--brand-tint)}
}
.ic-btn{display:inline-grid;place-items:center;width:44px;height:44px;border-radius:var(--radius-md);border:0;background:transparent;color:inherit;transition:transform 160ms var(--ease-out)}
.ic-btn:active{transform:scale(.94)}
.ic-btn svg{width:22px;height:22px}

/* ---------- Banda superior ---------- */
.band{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:var(--space-3) var(--space-4);flex-wrap:wrap;min-height:var(--band-h);padding:var(--space-2) var(--space-5);background:var(--surface-0);border-bottom:1px solid var(--line)}
.band .home{display:flex;align-items:center;gap:var(--space-2);text-decoration:none;color:inherit;min-height:44px}
.band .logo{height:30px;width:auto}
.logo.l{display:var(--logo-light)} .logo.d{display:var(--logo-dark)}
.band .tag{font-family:var(--font-display);font-weight:700;color:var(--ink-muted)}
.flag{display:inline-flex;align-items:center;padding:var(--space-1) var(--space-3);border-radius:999px;background:var(--accent);color:var(--on-accent);font-size:.8125rem;font-weight:700;line-height:1.3}
.band .tools{margin-left:auto;display:flex;align-items:center;gap:var(--space-2)}
.lang{display:flex;border:1px solid var(--line);border-radius:var(--radius-md);padding:2px}
.lang button{min-width:44px;min-height:44px;border:0;background:transparent;border-radius:10px;font-weight:700;font-size:.875rem;color:var(--ink-muted)}
.lang button[aria-pressed="true"]{background:var(--brand-tint);color:var(--brand-text)}
@media (max-width:719px){
  .band{padding:var(--space-2) var(--space-4)}
  .band .tag{display:none}
  .flag{order:5;width:100%;justify-content:center;border-radius:var(--radius-sm)}
  .band .reset .lbl{display:none}
}

/* ---------- Inici: tria de rol ---------- */
.wrap{max-width:1120px;margin:0 auto;padding:var(--space-7) var(--space-5) var(--space-8)}
.intro{max-width:720px;margin-bottom:var(--space-6)}
.intro h1{font-size:clamp(2rem,4.5vw,3rem)}
.intro p{margin-top:var(--space-3);color:var(--ink-muted);font-size:1.0625rem}
.roles{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:var(--space-4);list-style:none;margin:0;padding:0}
.role{display:flex;flex-direction:column;gap:var(--space-4);padding:var(--space-5);background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-lg)}
.role .top{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3)}
.role .ico{display:grid;place-items:center;width:48px;height:48px;border-radius:var(--radius-md);background:var(--brand-tint);color:var(--brand-text)}
.role .ico svg{width:24px;height:24px}
.chip{display:inline-flex;align-items:center;gap:var(--space-1);padding:2px var(--space-2);border-radius:999px;background:var(--surface-200);color:var(--ink-muted);font-size:.8125rem;font-weight:700}
.chip svg{width:14px;height:14px}
.role h2{font-size:1.5rem}
.role .task{padding:var(--space-3) var(--space-4);background:var(--surface-100);border-radius:var(--radius-md)}
.role .task small{display:block;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-muted)}
.role .task p{font-weight:700}
.role .done{display:flex;align-items:center;gap:var(--space-2);color:var(--ink-muted);font-size:.875rem}
.role .done svg{color:var(--ok)}
.role .btn{margin-top:auto}
.note{display:flex;gap:var(--space-3);align-items:flex-start;margin-top:var(--space-5);padding:var(--space-4) var(--space-5);background:var(--surface-200);border-radius:var(--radius-md);color:var(--ink-muted);font-size:.9375rem}
.note svg{width:20px;height:20px;color:var(--brand-text);margin-top:2px}
.end{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-4);margin-top:var(--space-5);padding:var(--space-5);background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-lg)}
.end h2{font-size:1.25rem}
.end p{color:var(--ink-muted)}
.foot{margin-top:var(--space-6);font-size:.8125rem;color:var(--ink-muted)}

/* ---------- Vista de rol ---------- */
.rolev{display:grid;grid-template-columns:minmax(260px,340px) 1fr;gap:var(--space-6);max-width:1240px;margin:0 auto;padding:var(--space-6) var(--space-5)}
.tpanel{position:sticky;top:calc(var(--band-h) + var(--space-5));align-self:start;display:flex;flex-direction:column;gap:var(--space-4)}
.tpanel h1{font-size:1.75rem}
.tpanel .back,.wrap>.back{align-self:flex-start;margin-left:calc(var(--space-3) * -1)}
.tpanel .hint{color:var(--ink-muted)}
.tpanel .count{font-size:.875rem;font-weight:700;color:var(--ink-muted)}
.stage{display:flex;justify-content:center;min-width:0}
.result{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-5);background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-lg)}
.result h2{font-size:1.25rem;display:flex;align-items:center;gap:var(--space-2)}
.result h2 svg{color:var(--ok)}
.result .nums{display:flex;gap:var(--space-5)}
.result .nums b{display:block;font-family:var(--font-display);font-size:1.75rem;line-height:1.1}
.result .nums span{font-size:.8125rem;color:var(--ink-muted)}
.result .acts{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.result:not([hidden]){animation:rise 300ms var(--ease-out)}
.placeholder{padding:var(--space-7);border:2px dashed var(--line);border-radius:var(--radius-lg);color:var(--ink-muted);text-align:center;width:100%}

/* ---------- Marc de mòbil ---------- */
.phone{position:relative;width:390px;height:min(800px,calc(100dvh - var(--band-h) - var(--space-7)));min-height:640px;border:12px solid var(--frame);border-radius:52px;background:var(--surface-100);box-shadow:var(--shadow);overflow:hidden;isolation:isolate}
.sbar{position:relative;z-index:3;display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 var(--space-6);font-size:.8125rem;font-weight:700}
.sbar::after{content:"";position:absolute;left:50%;top:8px;width:96px;height:24px;margin-left:-48px;border-radius:999px;background:var(--frame)}
.sbar .ic{display:flex;gap:var(--space-1);align-items:center}
.sbar .bat{width:22px;height:11px;border:1.5px solid currentColor;border-radius:3px;position:relative}
.sbar .bat::after{content:"";position:absolute;inset:1.5px 5px 1.5px 1.5px;background:currentColor;border-radius:1px}
.screens{position:absolute;inset:40px 0 0}
.scr{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--surface-100);transition:transform 260ms var(--ease-out),opacity 200ms ease}
.scr[data-pos="next"]{transform:translateX(28px);opacity:0;pointer-events:none}
.scr[data-pos="prev"]{transform:translateX(-28px);opacity:0;pointer-events:none}
.scr[data-pos="fade"]{transform:none;opacity:0;pointer-events:none}
.scr:not(.on){visibility:hidden}
.scr.on,.scr.leaving{visibility:visible}
.shead{display:flex;align-items:center;gap:var(--space-1);min-height:56px;padding:0 var(--space-2)}
.shead .ttl{font-family:var(--font-display);font-weight:700;font-size:1.0625rem}
.shead .app{display:flex;align-items:center;gap:var(--space-2);padding-left:var(--space-3);font-weight:700}
.shead .app .mark{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--brand);color:var(--on-brand)}
.shead .app .mark svg{width:16px;height:16px}
.sbody{flex:1;overflow:auto;padding:var(--space-2) var(--space-5) var(--space-5);display:flex;flex-direction:column;gap:var(--space-4);overscroll-behavior:contain}
.sfoot{padding:var(--space-3) var(--space-5) var(--space-5);background:var(--surface-100);border-top:1px solid var(--line)}
.sbody h2{font-size:1.75rem}
.sbody .sub{color:var(--ink-muted)}
.card{background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4)}
.ctx{display:flex;gap:var(--space-3);align-items:flex-start}
.ctx .pin{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--brand-tint);color:var(--brand-text)}
.ctx .pin svg{width:20px;height:20px}
.ctx b{display:block}
.ctx span{color:var(--ink-muted);font-size:.875rem}

/* A1 · carnet genèric */
.wallet-h{font-size:1.75rem;padding-top:var(--space-2)}
.wcard{position:relative;aspect-ratio:1.586;border-radius:18px;padding:var(--space-4) var(--space-5);color:#fff;background:linear-gradient(135deg,#003b66 0%,#00609e 55%,#0a78b8 100%);display:flex;flex-direction:column;justify-content:space-between;box-shadow:0 2px 4px rgba(11,27,43,.12),0 12px 28px rgba(11,27,43,.22);overflow:hidden}
.wcard::after{content:"";position:absolute;right:-60px;bottom:-80px;width:220px;height:220px;border-radius:50%;border:22px solid rgba(255,255,255,.12)}
.wcard .r1{display:flex;justify-content:space-between;align-items:flex-start}
.wcard .org{font-size:.8125rem;font-weight:700;letter-spacing:.04em}
.wcard .kind{display:flex;align-items:center;gap:var(--space-2);font-family:var(--font-display);font-size:clamp(1.125rem,5vw,1.375rem);line-height:1.15;font-weight:700}
.wcard .kind svg{width:24px;height:24px}
.wcard .who{font-size:.8125rem;line-height:1.35}
.wcard .who b{display:block;font-size:1rem}
.wcard .demo{font-size:.6875rem;font-weight:700;padding:2px var(--space-2);border-radius:999px;background:rgba(0,0,0,.25)}
.wstack{height:10px;margin:-6px 14px 0;border-radius:0 0 14px 14px;background:var(--surface-200)}
.tapnote{display:flex;align-items:center;gap:var(--space-2);color:var(--ink-muted);font-size:.875rem;justify-content:center}
.tapnote svg{width:18px;height:18px}

/* A2 · inici d'incidències */
.big-cta{display:flex;align-items:center;gap:var(--space-4);width:100%;text-align:left;padding:var(--space-5);border-radius:var(--radius-lg);border:0;background:var(--brand);color:var(--on-brand);transition:transform 160ms var(--ease-out)}
.big-cta:active{transform:scale(.98)}
.big-cta .i{display:grid;place-items:center;width:48px;height:48px;border-radius:var(--radius-md);background:rgba(255,255,255,.18)}
.big-cta .i svg{width:24px;height:24px}
.big-cta b{display:block;font-family:var(--font-display);font-size:1.25rem}
.big-cta span{font-size:.875rem;opacity:.92}
.big-cta .chev{margin-left:auto;width:20px;height:20px}
.sec-h{font-family:var(--font-display);font-size:1rem;margin-top:var(--space-2)}
.mine{display:flex;flex-direction:column;gap:var(--space-2);list-style:none;margin:0;padding:0}
.mine li{display:flex;align-items:center;gap:var(--space-3)}
.mine .eq{display:grid;place-items:center;width:36px;height:36px;border-radius:var(--radius-sm);background:var(--surface-200);color:var(--ink-muted)}
.mine .eq svg{width:18px;height:18px}
.mine .t{flex:1;min-width:0}
.mine .t b{display:block;font-size:.9375rem}
.mine .t span{font-size:.8125rem;color:var(--ink-muted)}
.empty{color:var(--ink-muted);font-size:.9375rem}

/* A3 · formulari */
.fwrap{display:flex;flex-direction:column;flex:1;min-height:0}
fieldset{border:0;margin:0;padding:0;min-width:0}
legend,.lbl-f{font-weight:700;margin-bottom:var(--space-2);padding:0}
.help{font-size:.8125rem;color:var(--ink-muted);margin-top:var(--space-1)}
.sel{position:relative}
.sel select{appearance:none;width:100%;min-height:48px;padding:0 var(--space-7) 0 var(--space-4);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);font-size:1rem}
.sel svg{position:absolute;right:var(--space-4);top:50%;margin-top:-9px;width:18px;height:18px;pointer-events:none;color:var(--ink-muted)}
.types{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-2)}
.type{position:relative}
.type input{position:absolute;z-index:1;opacity:0;inset:0;margin:0;cursor:pointer} /* per sobre del label encara que aquest es transformi en prémer */
.type label{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-2);min-height:88px;padding:var(--space-3) var(--space-4);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);font-weight:700;cursor:pointer;transition:border-color 160ms ease,background-color 160ms ease,transform 160ms var(--ease-out)}
.type label svg{width:24px;height:24px;color:var(--brand-text)}
.type input:active+label{transform:scale(.97)}
.type input:checked+label{border-color:var(--brand);background:var(--brand-tint);box-shadow:inset 0 0 0 1px var(--brand)}
.type input:focus-visible+label{outline:2px solid var(--focus-ring);outline-offset:2px}
.err{display:flex;gap:var(--space-2);align-items:center;margin-top:var(--space-2);color:var(--c-crit);font-size:.875rem;font-weight:700}
.err svg{width:16px;height:16px}
.photo-add{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:56px;padding:var(--space-3) var(--space-4);border:1.5px dashed var(--border);border-radius:var(--radius-md);background:transparent;text-align:left;font-weight:700;color:var(--brand-text);transition:transform 160ms var(--ease-out)}
.photo-add:active{transform:scale(.98)}
.photo-add svg{width:22px;height:22px}
.photo-add small{display:block;font-weight:500;color:var(--ink-muted)}
.photo{display:flex;align-items:center;gap:var(--space-3)}
.photo .th{width:72px;height:72px;border-radius:var(--radius-md);background:linear-gradient(160deg,#1c2b3a,#3b4d60);position:relative;overflow:hidden}
.photo .th::before{content:"";position:absolute;left:12px;right:12px;top:16px;bottom:22px;border-radius:3px;background:#0b141d;box-shadow:inset 0 0 0 2px #56687a}
.photo .th::after{content:"";position:absolute;left:30px;right:30px;bottom:12px;height:6px;border-radius:2px;background:#56687a}
.photo .t{flex:1}
.photo .t b{display:block}
.photo .t span{font-size:.8125rem;color:var(--ink-muted)}
.photo:not([hidden]){animation:pop 220ms var(--ease-out)}

/* A4 · rebuda */
.okmark{align-self:flex-start;display:grid;place-items:center;width:72px;height:72px;border-radius:50%;background:var(--ok-soft);color:var(--ok);margin-top:var(--space-4)}
.okmark svg{width:36px;height:36px}
.okmark svg{stroke-dasharray:24;stroke-dashoffset:24}
.scr.on .okmark{animation:pop 300ms var(--ease-out)}
.scr.on .okmark svg{animation:draw 360ms 120ms var(--ease-out) forwards}
.sum{margin:0;display:grid;grid-template-columns:auto 1fr;gap:var(--space-2) var(--space-4)}
.sum dt{color:var(--ink-muted);font-size:.875rem}
.sum dd{margin:0;font-weight:700;font-size:.9375rem;text-align:right}
.badge{display:inline-flex;align-items:center;gap:6px;padding:2px var(--space-2);border-radius:999px;font-size:.8125rem;font-weight:700;color:var(--ink);white-space:nowrap}
.badge::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;color:inherit}
.badge.crit{background:var(--c-crit-soft)} .badge.crit::before{background:var(--c-crit)}
.badge.alt{background:var(--c-alt-soft)} .badge.alt::before{background:var(--c-alt)}
.badge.norm{background:var(--c-norm-soft)} .badge.norm::before{background:var(--c-norm)}
.badge.low{background:var(--c-low-soft)} .badge.low::before{background:var(--c-low)}
.track{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0}
.track li{position:relative;display:flex;gap:var(--space-3);padding-bottom:var(--space-4);color:var(--ink-muted)}
.track li:last-child{padding-bottom:0}
.track li::before{content:"";position:absolute;left:11px;top:24px;bottom:0;width:2px;background:var(--line)}
.track li:last-child::before{display:none}
.track .dot{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;border:2px solid var(--line);background:var(--surface-0);flex:none}
.track .dot svg{width:12px;height:12px;opacity:0}
.track li.done{color:var(--ink)}
.track li.done .dot{background:var(--ok);border-color:var(--ok);color:#fff}
.track li.done .dot svg{opacity:1}
.track li.done::before{background:var(--ok)}
.track li.now{color:var(--ink)}
.track li.now .dot{border-color:var(--brand)}
.track b{display:block;font-size:.9375rem}
.track span{font-size:.8125rem}
.merged{font-size:.875rem;color:var(--ink-muted);padding:var(--space-3) var(--space-4);background:var(--surface-200);border-radius:var(--radius-md)}

/* ---------- Avisos ---------- */
.toast{position:fixed;left:50%;bottom:var(--space-5);z-index:40;transform:translate(-50%,16px);opacity:0;pointer-events:none;max-width:calc(100% - 32px);padding:var(--space-3) var(--space-4);border-radius:var(--radius-md);background:var(--ink);color:var(--surface-0);font-weight:700;font-size:.9375rem;transition:transform 220ms var(--ease-out),opacity 180ms ease}
.toast.on{transform:translate(-50%,0);opacity:1}

/* ---------- Mòbil: l'alumne ocupa tota la pantalla ---------- */
@media (max-width:899px){
  .rolev{grid-template-columns:1fr;gap:var(--space-4);padding:var(--space-4)}
  .tpanel{position:static}
  .tpanel h1{font-size:1.375rem}
}
@media (max-width:599px){
  .rolev.is-phone{padding:0;gap:0;width:100%}
  .rolev.is-phone .tpanel{padding:var(--space-3) var(--space-4);gap:var(--space-1);border-bottom:1px solid var(--line);background:var(--surface-0)}
  .rolev.is-phone .tpanel .hint,.rolev.is-phone .tpanel .back{display:none}
  .rolev.is-phone .tpanel h1{font-size:1.0625rem;font-family:var(--font-sans);font-weight:700}
  .rolev.is-phone .result{margin:var(--space-4)}
  .rolev.is-phone .phone{width:100%;height:auto;min-height:560px;flex:1;border:0;border-radius:0;box-shadow:none}
  .rolev.is-phone .stage{flex:1;display:flex}
  /* Mentre la tasca és en curs, el mòbil omple la pantalla sense scroll de pàgina */
  body.full{display:flex;flex-direction:column;height:100dvh;overflow:hidden}
  body.full main,body.full .view:not([hidden]){flex:1;min-height:0;display:flex;flex-direction:column}
  .rolev.is-phone .tpanel{align-self:stretch}
  body.full .rolev.is-phone{flex:1;min-height:0;display:flex;flex-direction:column}
  body.full .rolev.is-phone .phone{min-height:0}
  .rolev.is-phone .sbar{display:none}
  .rolev.is-phone .screens{inset:0}
}


/* ================= Professor: pantalla de l'aula ================= */
.monitor{position:relative;width:100%;max-width:980px;min-height:620px;background:var(--surface-100);border:10px solid var(--frame);border-radius:20px;box-shadow:var(--shadow);overflow:hidden}
.monitor .scr{position:relative;inset:auto;min-height:600px;transition:none}
.monitor .scr:not(.on){display:none}
.monitor .scr.on{animation:rise 260ms var(--ease-out)}
.ibody{flex:1;display:flex;flex-direction:column;gap:var(--space-4);padding:var(--space-5) var(--space-6) var(--space-6)}
.ibody.center{align-items:center;justify-content:center;text-align:center}
.ibody.center .okmark{align-self:center;margin-top:0}
.ibody h2{font-size:1.75rem}
.ibody .sub{color:var(--ink-muted);max-width:52ch}
.narrow{width:100%;max-width:440px;text-align:left}
.small{font-size:.8125rem;color:var(--ink-muted)}
.acts{display:flex;flex-wrap:wrap;gap:var(--space-2)}

/* B1 · accés */
.login{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-3);padding:var(--space-6);text-align:center;color:#fff;background:radial-gradient(120% 90% at 50% 0%,#0a5a96 0%,#003b66 60%,#062a47 100%)}
.login .login-logo{height:28px;width:auto;margin-bottom:var(--space-4)}
.login .room{font-size:clamp(2.5rem,6vw,4rem);line-height:1}
.login .meta{color:#d6ebf8}
.login .lead{font-weight:700;font-size:1.125rem}
.login .small{color:#bfe3fa}
.btn.light{background:#fff;color:#003b66}
@media (hover:hover) and (pointer:fine){.btn.light:hover{background:#e6f3fb}}
.reader{position:relative;display:grid;place-items:center;width:132px;height:132px;margin:var(--space-4) 0}
.reader .pad{position:relative;z-index:2;display:grid;place-items:center;width:72px;height:72px;border-radius:20px;background:rgba(255,255,255,.12);border:1.5px solid rgba(255,255,255,.4);transition:background-color 200ms ease,transform 200ms var(--ease-out)}
.reader .pad svg{width:34px;height:34px}
.reader .ring{position:absolute;inset:30px;border-radius:24px;border:1.5px solid rgba(255,255,255,.35);animation:ring 2.4s var(--ease-out) infinite}
.reader .ring+.ring{animation-delay:1.2s}
.reader .card-in{position:absolute;z-index:3;right:-34px;bottom:-14px;display:grid;place-items:center;width:52px;height:84px;border-radius:12px;background:#fff;color:#003b66;box-shadow:0 10px 24px rgba(0,0,0,.35);opacity:0;transform:translate(36px,24px) rotate(12deg);transition:transform 520ms var(--ease-in-out),opacity 200ms ease}
.reader .card-in svg{width:24px;height:24px}
.reader.tapping .card-in{opacity:1;transform:translate(-44px,-30px) rotate(-6deg)}
.reader.tapping .ring{animation-duration:900ms}
.reader.ok .pad{background:var(--ok);border-color:var(--ok);transform:scale(1.06)}
@keyframes ring{0%{transform:scale(1);opacity:.9}100%{transform:scale(1.9);opacity:0}}

/* B2 · arrencada */
.bootlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2);width:100%;max-width:420px;text-align:left}
.bootlist li{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md);font-weight:500}
.bootlist .mk{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--ok);color:#fff}
.bootlist .mk svg{width:13px;height:13px}
.bootlist li.bad{border-color:var(--c-crit);background:var(--c-crit-soft);font-weight:700}
.bootlist li.bad .mk{background:var(--c-crit)}
.scr.on .bootlist li{opacity:0;animation:rise 280ms var(--ease-out) forwards}
.scr.on .bootlist li:nth-child(2){animation-delay:120ms}
.scr.on .bootlist li:nth-child(3){animation-delay:240ms}
.scr.on .bootlist li:nth-child(4){animation-delay:360ms}
.scr.on .bootlist li:nth-child(5){animation-delay:480ms}

/* B3 · tauler */
.dhead{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-wrap:wrap;min-height:64px;padding:var(--space-3) var(--space-5);background:var(--surface-0);border-bottom:1px solid var(--line)}
.dhead .dt{display:flex;align-items:center;gap:var(--space-3)}
.dhead .dt h2{font-size:1.375rem}
.dhead .dt span{font-size:.875rem;color:var(--ink-muted)}
.dhead .who{display:flex;align-items:center;gap:var(--space-2);font-size:.875rem;font-weight:700}
.avatar{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--brand-tint);color:var(--brand-text);font-weight:700}
.dhead .ai{display:flex;align-items:center;gap:var(--space-2);margin-right:auto;font-weight:700;color:var(--brand-text)}
.dhead .ai svg{width:18px;height:18px}
.summary{display:flex;align-items:center;gap:var(--space-2);font-weight:700;font-size:1.0625rem}
.summary svg{width:20px;height:20px}
.summary.bad svg{color:var(--c-crit)} .summary.ok svg{color:var(--ok)}
.dgrid{display:grid;grid-template-columns:1.4fr 1fr;grid-template-rows:auto auto;gap:var(--space-4)}
.dgrid .panel:first-child{grid-row:span 2}
.panel{background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4) var(--space-5)}
.panel h3{font-size:1rem;margin-bottom:var(--space-3)}
.eqs{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:var(--space-2)}
.eqb{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-2);width:100%;height:100%;padding:var(--space-3) var(--space-4);text-align:left;background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md);transition:background-color 300ms ease,border-color 160ms ease,transform 160ms var(--ease-out)}
.eqb:active{transform:scale(.97)}
@media (hover:hover) and (pointer:fine){.eqb:hover{border-color:var(--brand-text)}}
.eqb svg{width:24px;height:24px;color:var(--ink-muted)}
.eqb b{font-size:.9375rem}
.st{display:flex;align-items:center;gap:6px;font-size:.8125rem;font-weight:700;color:var(--ink-muted)}
.st i{width:10px;height:10px;border-radius:50%;background:var(--ok);flex:none}
.eqb.bad{border-color:var(--c-crit);background:var(--c-crit-soft)}
.eqb.bad svg{color:var(--c-crit)}
.eqb.bad .st{color:var(--ink)}
.eqb.bad .st i{background:var(--c-crit)}
.eqb.warn .st i{background:var(--c-alt)}
.eqb.ok-new{animation:okflash 900ms var(--ease-out)}
@keyframes okflash{0%{background:var(--ok-soft);border-color:var(--ok)}100%{background:transparent}}
.envs{display:flex;flex-direction:column;gap:var(--space-3)}
.env{display:grid;grid-template-columns:24px 1fr;column-gap:var(--space-3);align-items:center}
.env svg{width:22px;height:22px;color:var(--brand-text);grid-row:span 2}
.env b{font-family:var(--font-display);font-size:1.375rem;line-height:1.1}
.env span{font-size:.8125rem;color:var(--ink-muted)}
.panel .small{margin-top:var(--space-3)}
.sched{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.sched li{display:flex;align-items:center;gap:var(--space-3);font-size:.9375rem;color:var(--ink-muted)}
.sched b{width:44px;color:var(--ink)}
.sched li.now{color:var(--ink);font-weight:700}
.sched .chip{margin-left:auto;background:var(--brand-tint);color:var(--brand-text)}
.dfoot{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-4);padding:var(--space-4) var(--space-6);background:var(--surface-0);border-top:1px solid var(--line)}
.dfoot p{color:var(--ink-muted);font-weight:500}

/* B4 · IA */
.bubble{max-width:60ch;padding:var(--space-4) var(--space-5);background:var(--brand-tint);border-radius:var(--radius-md) var(--radius-md) var(--radius-md) var(--radius-sm);font-weight:500}
.aisteps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2);max-width:640px}
.aisteps li{display:flex;gap:var(--space-4);align-items:flex-start;padding:var(--space-4);background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md)}
.aisteps .n{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--brand);color:var(--on-brand);font-weight:700;flex:none}
.aisteps b{display:block}
.aisteps span{font-size:.875rem;color:var(--ink-muted)}
.scr.on .aisteps li{opacity:0;animation:rise 280ms var(--ease-out) forwards}
.scr.on .aisteps li:nth-child(2){animation-delay:80ms}
.scr.on .aisteps li:nth-child(3){animation-delay:160ms}
.ask{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3) var(--space-4);padding-top:var(--space-2)}
.ask p{font-family:var(--font-display);font-weight:700;font-size:1.25rem}
.yn{display:flex;flex-wrap:wrap;gap:var(--space-2)}

/* B5 · fitxa */
.ficha{margin:0;display:grid;grid-template-columns:160px 1fr;gap:var(--space-3) var(--space-5)}
.ficha dt{color:var(--ink-muted);font-size:.875rem;padding-top:2px}
.ficha dd{margin:0;font-weight:500}
.ficha dd ul{margin:0;padding-left:1.1em}
.ficha .pf{font-size:.8125rem;color:var(--ink-muted);margin-left:var(--space-2)}
#b-ficha{max-width:720px}

/* L'interior del tauler s'adapta a l'amplada de la pantalla simulada, no de la finestra */
.monitor{container:mon/inline-size}
@container mon (max-width:760px){
  .dgrid{grid-template-columns:1fr}
  .dgrid .panel:first-child{grid-row:auto}
}
@container mon (max-width:600px){
  .ibody{padding:var(--space-4)}
  .dhead{padding:var(--space-3) var(--space-4)}
  .dhead .who .nm{display:none}
  .dfoot{padding:var(--space-3) var(--space-4);justify-content:space-between}
  .dfoot .btn{flex:1;padding:0 var(--space-3)}
  .ficha{grid-template-columns:1fr;gap:var(--space-1)}
  .ficha dd{margin-bottom:var(--space-3)}
  .qrow{grid-template-columns:56px 1fr;gap:var(--space-3)}
  .qrow .side{grid-column:2;flex-direction:row;align-items:center;flex-wrap:wrap;padding-bottom:var(--space-1)}
  .qrow .pv{grid-row:span 2}
  .login .reader{margin:var(--space-2) 0}
}
@media (max-width:599px){
  .rolev:not(.is-phone) .stage{margin:0 calc(var(--space-4) * -1)}
  .monitor{border:0;border-radius:0;box-shadow:none;min-height:0}
  .monitor .scr{min-height:560px}
}

/* ================= Tècnic: consola ================= */
.console .dhead .avatar svg{width:18px;height:18px}
.qcount{font-size:.875rem;font-weight:700;color:var(--ink-muted)}
.queue{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.qrow{display:grid;grid-template-columns:64px 1fr auto;align-items:center;gap:var(--space-4);width:100%;padding:var(--space-3) var(--space-4) var(--space-3) 0;text-align:left;background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md);overflow:hidden;transition:transform 160ms var(--ease-out),border-color 160ms ease}
.qrow:active{transform:scale(.99)}
@media (hover:hover) and (pointer:fine){.qrow:hover{border-color:var(--brand-text)}}
.qrow .pv{align-self:stretch;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--c-low-soft)}
.qrow .pv b{font-family:var(--font-display);font-size:1.5rem;line-height:1}
.qrow .pv span{font-size:.6875rem;font-weight:700;color:var(--ink-muted)}
.qrow.crit .pv{background:var(--c-crit-soft)}
.qrow.alt .pv{background:var(--c-alt-soft)}
.qrow.norm .pv{background:var(--c-norm-soft)}
.qrow .main{display:flex;flex-direction:column;gap:2px;min-width:0}
.qrow .main b{display:flex;align-items:center;gap:var(--space-2);font-size:1rem}
.qrow .main b svg{width:18px;height:18px;color:var(--ink-muted)}
.qrow .main .sym{font-size:.9375rem}
.qrow .main .meta{font-size:.8125rem;color:var(--ink-muted)}
.qrow .side{display:flex;flex-direction:column;align-items:flex-end;gap:var(--space-1)}
.qrow .goal{font-size:.8125rem;color:var(--ink-muted);white-space:nowrap}
.tag-new{display:inline-flex;padding:1px var(--space-2);border-radius:999px;background:var(--brand);color:var(--on-brand);font-size:.75rem;font-weight:700}
.tag-st{display:inline-flex;padding:1px var(--space-2);border-radius:999px;background:var(--surface-200);color:var(--ink);font-size:.75rem;font-weight:700}
.qrow.flash{animation:qflash 1200ms var(--ease-out)}
@keyframes qflash{0%{box-shadow:0 0 0 3px var(--brand);transform:translateY(-4px)}100%{box-shadow:0 0 0 0 transparent;transform:none}}
.done-list{margin-top:var(--space-2);color:var(--ink-muted);font-size:.9375rem}
.done-list summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700}
.done-list ul{margin:0;padding-left:1.2em;display:flex;flex-direction:column;gap:var(--space-1)}
.ftitle{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3)}
.ftitle h2{font-size:1.75rem}
.hist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-1)}
.hist li{display:flex;gap:var(--space-3)}
.hist time{min-width:80px;color:var(--ink-muted);font-size:.875rem}
.thumb{width:96px;height:72px;border-radius:var(--radius-sm);background:linear-gradient(160deg,#1c2b3a,#3b4d60);position:relative}
.thumb::before{content:"";position:absolute;left:14px;right:14px;top:12px;bottom:20px;border-radius:3px;background:#0b141d;box-shadow:inset 0 0 0 2px #56687a}
.gui{font-size:.8125rem;color:var(--ink-muted);display:block;margin-top:var(--space-1)}

/* ================= Enquesta ================= */
.survey{max-width:760px;display:flex;flex-direction:column;gap:var(--space-5)}
.survey .intro{margin:0}
.survey .panel h2,.privacy h2{font-size:1.125rem;margin-bottom:var(--space-3)}
.tlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.tlist li{display:flex;align-items:center;gap:var(--space-3);min-height:44px}
.tlist .ic{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--surface-200);color:var(--ink-muted)}
.tlist .ic svg{width:16px;height:16px}
.tlist li.ok .ic{background:var(--ok);color:#fff}
.tlist .t{flex:1}
.tlist .t b{display:block}
.tlist .t span{font-size:.875rem;color:var(--ink-muted)}
.sform{display:flex;flex-direction:column;gap:var(--space-5)}
.q legend,.qlbl{display:flex;align-items:center;gap:var(--space-3);font-family:var(--font-display);font-weight:700;font-size:1.25rem;margin-bottom:var(--space-3)}
.qn{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--brand-tint);color:var(--brand-text);font-size:1rem;flex:none}
.qlbl .help{font-family:var(--font-sans);font-weight:500;font-size:.875rem}
.seg{position:relative;display:flex;flex-wrap:wrap;gap:var(--space-2)}
.seg input{position:absolute;opacity:0;width:1px;height:1px}
.seg label{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 var(--space-5);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);font-weight:700;cursor:pointer;transition:border-color 160ms ease,background-color 160ms ease,transform 160ms var(--ease-out)}
.seg label:active{transform:scale(.97)}
.seg input:checked+label{border-color:var(--brand);background:var(--brand-tint);box-shadow:inset 0 0 0 1px var(--brand)}
.seg input:focus-visible+label{outline:2px solid var(--focus-ring);outline-offset:2px}
.scale label{flex:1;min-width:48px;padding:0;font-family:var(--font-display);font-size:1.25rem}
.ends{display:flex;justify-content:space-between;margin-top:var(--space-2);font-size:.8125rem;color:var(--ink-muted)}
.sform textarea{width:100%;padding:var(--space-3) var(--space-4);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);color:var(--ink);font:inherit;font-size:1rem;resize:vertical;min-height:112px}
.privacy{padding:var(--space-4) var(--space-5);background:var(--surface-200);border-radius:var(--radius-md);font-size:.9375rem;color:var(--ink-muted)}
.privacy h2{color:var(--ink);font-size:1rem;margin-bottom:var(--space-1)}
.thanks{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-3);padding:var(--space-6);background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-lg)}
.thanks .okmark{margin:0}
.thanks h2{font-size:1.75rem}
.thanks p{color:var(--ink-muted)}
.thanks:not([hidden]) .okmark svg{animation:draw 360ms 120ms var(--ease-out) forwards}
@media (max-width:599px){
  .wrap{padding:var(--space-5) var(--space-4) var(--space-7)}
  .seg:not(.scale) label{flex:1 1 100%;justify-content:flex-start}
}

/* ================= v2: alumne ================= */
.homebar{position:absolute;left:50%;bottom:6px;z-index:6;width:120px;height:5px;margin-left:-60px;border-radius:3px;background:var(--ink);opacity:.35}
.wcard{width:100%;border:0;font:inherit;text-align:left;cursor:pointer;perspective:1200px;transition:transform 160ms var(--ease-out)}
.wcard:active{transform:scale(.98)}
.wcard .face{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:space-between;padding:var(--space-4) var(--space-5);backface-visibility:hidden;transition:opacity 220ms ease,transform 420ms var(--ease-in-out)}
.wcard .back{opacity:0;transform:rotateY(-90deg)}
.wcard.flip .front{opacity:0;transform:rotateY(90deg)}
.wcard.flip .back{opacity:1;transform:none}
.wcard .back .who{font-size:.875rem;max-width:30ch}
.wcard .back .demo{align-self:flex-start}
.lock{display:flex;flex-direction:column;gap:var(--space-2)}
.lockn{display:flex;flex-direction:column;gap:2px;width:100%;padding:var(--space-3) var(--space-4);text-align:left;font-size:.875rem;color:var(--ink);background:var(--surface-0);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);transition:transform 160ms var(--ease-out)}
.lockn:not(.static):active{transform:scale(.98)}
.lockn .lk-h{display:flex;align-items:center;gap:var(--space-2);font-size:.75rem;color:var(--ink-muted)}
.lockn .lk-h svg{width:16px;height:16px;padding:2px;border-radius:5px;background:var(--brand);color:#fff}
.lockn .lk-h time{margin-left:auto}
.lockn>b{font-size:.9375rem}
.push{position:absolute;left:var(--space-3);right:var(--space-3);top:var(--space-2);z-index:8;display:flex;flex-direction:column;gap:2px;padding:var(--space-3) var(--space-4);text-align:left;font-size:.875rem;color:var(--ink);background:var(--surface-0);border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 30px rgba(11,27,43,.22)}
.push:not([hidden]){animation:drop 380ms var(--ease-out)}
.push .lk-h{display:flex;align-items:center;gap:var(--space-2);font-size:.75rem;color:var(--ink-muted)}
.push .lk-h svg{width:16px;height:16px;padding:2px;border-radius:5px;background:var(--brand);color:#fff}
.push .lk-h time{margin-left:auto}
.push>b{font-size:.9375rem}
@keyframes drop{from{opacity:0;transform:translateY(-110%)}to{opacity:1;transform:none}}
.shead{justify-content:space-between}
.shead .ic-btn:first-child{margin-right:auto}
.shead .ic-btn:first-child+.ttl{margin-right:auto}
.scr.tab .sbody{padding-bottom:88px}
.tabbar{position:absolute;left:0;right:0;bottom:0;z-index:5;display:grid;grid-template-columns:repeat(3,1fr);padding:var(--space-1) var(--space-2) var(--space-5);background:var(--surface-0);border-top:1px solid var(--line)}
.tabbar button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:52px;border:0;background:transparent;color:var(--ink-muted);font-size:.75rem;font-weight:700;border-radius:var(--radius-md)}
.tabbar button svg{width:22px;height:22px}
.tabbar button[aria-current="page"]{color:var(--brand-text)}
.bdg{position:absolute;top:4px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#b83232;color:#fff;font-size:.6875rem;line-height:18px;text-align:center}

.now{display:flex;flex-direction:column;gap:var(--space-3)}
.now-h{display:flex;align-items:center;gap:var(--space-3)}
.now-h .pin{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--brand-tint);color:var(--brand-text);flex:none}
.now-h .pin svg{width:20px;height:20px}
.now-h b{display:block}
.now-h span{font-size:.875rem;color:var(--ink-muted)}
.now-h .room-big{margin-left:auto;font-family:var(--font-display);font-weight:700;font-size:1.75rem;color:var(--ink);line-height:1}
.moved-note,.envline{display:flex;align-items:center;gap:var(--space-2);font-size:.875rem;color:var(--ink-muted)}
.moved-note{color:var(--ink);font-weight:700;padding:var(--space-2) var(--space-3);background:var(--brand-tint);border-radius:var(--radius-sm)}
.moved-note svg,.envline svg{width:16px;height:16px}
.mine-b{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:56px;padding:var(--space-3);text-align:left;background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md);transition:transform 160ms var(--ease-out)}
.mine-b:active{transform:scale(.98)}
.mine-b>svg{width:18px;height:18px;color:var(--ink-muted)}
.hrow{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:var(--space-2) var(--space-4)}
.tsched{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.tsched li{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md)}
.tsched li.now{border-color:var(--brand)}
.tsched .tm{width:56px;font-size:.8125rem;font-weight:700;color:var(--ink-muted);font-variant-numeric:tabular-nums}
.tsched .cl{flex:1;min-width:0}
.tsched .cl b{display:block}
.tsched .cl span{font-size:.875rem;color:var(--ink-muted)}
.tsched s{color:var(--ink-muted)}
.tsched .chip{background:var(--brand-tint);color:var(--brand-text)}
.notes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.note-b{position:relative;display:flex;flex-direction:column;gap:2px;width:100%;padding:var(--space-3) var(--space-4);text-align:left;background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-md);font-size:.9375rem}
.note-b .nt{display:flex;justify-content:space-between;gap:var(--space-2)}
.note-b time{font-size:.8125rem;color:var(--ink-muted)}
.note-b>span:last-child{color:var(--ink-muted);font-size:.875rem}
.note-b.unread{border-color:var(--brand)}
.note-b.unread::before{content:"";position:absolute;left:-5px;top:50%;width:10px;height:10px;margin-top:-5px;border-radius:50%;background:var(--brand)}
.detail:not([hidden]){animation:rise 220ms var(--ease-out)}
.seg.wrap3 label{flex:1 1 auto}
.phone .seg label{min-height:44px;padding:0 var(--space-4);font-size:.9375rem}

/* ================= v2: professor ================= */
.devsw{display:flex;flex-wrap:wrap;gap:var(--space-1);padding:3px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-0);align-self:flex-start}
.devsw button{display:inline-flex;align-items:center;gap:var(--space-2);min-height:44px;padding:0 var(--space-3);border:0;border-radius:9px;background:transparent;font-weight:700;font-size:.875rem;color:var(--ink-muted)}
.devsw button svg{width:18px;height:18px}
.devsw button[aria-pressed="true"]{background:var(--brand-tint);color:var(--brand-text)}
.mon-only{display:none}
.only-mob{display:none}
[data-dev="mobile"] .only-mob{display:inline}
[data-dev="mobile"] .only-desk{display:none}
[data-dev="mobile"] .monitor{display:flex;flex-direction:column;width:390px;max-width:100%;height:min(820px,calc(100dvh - var(--band-h) - var(--space-7)));min-height:640px;border:12px solid var(--frame);border-radius:52px}
[data-dev="mobile"] .monitor .mon-only{display:flex;flex:none;background:var(--surface-0)}
[data-dev="mobile"] .monitor .scr.on{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
[data-dev="mobile"] .monitor .scr{min-height:0}
[data-dev="mobile"] .login{padding:var(--space-5)}
[data-dev="mobile"] .monitor .sbar{background:#003b66;color:#fff}
[data-dev="mobile"] .dfoot{position:sticky;bottom:0;z-index:2}
@media (max-width:599px){[data-dev="mobile"] .monitor{width:100%;height:auto;min-height:0;border:0;border-radius:0}[data-dev="mobile"] .monitor .mon-only{display:none}}
.dfoot{gap:var(--space-2)}
.env-btn{margin-top:var(--space-4)}
.reps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.reps li{display:flex;gap:var(--space-3);align-items:flex-start;font-size:.9375rem}
.reps li>svg{width:20px;height:20px;color:var(--ink-muted);margin-top:2px}
.reps li b{display:block}
.reps li span span{font-size:.8125rem;color:var(--ink-muted)}
.moved{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2) var(--space-3);padding:var(--space-3) var(--space-4);background:var(--brand-tint);border-radius:var(--radius-md);font-weight:700}
.moved>svg{width:20px;height:20px;color:var(--brand-text)}
.moved .btn{margin-left:auto}
.aisteps label{display:flex;gap:var(--space-4);align-items:flex-start;width:100%;cursor:pointer}
.aisteps input{position:absolute;opacity:0;width:1px;height:1px}
.aisteps li{position:relative;transition:border-color 160ms ease,background-color 160ms ease}
.aisteps li:has(input:checked){border-color:var(--ok);background:var(--ok-soft)}
.aisteps li:has(input:focus-visible){outline:2px solid var(--focus-ring);outline-offset:2px}
.aisteps input:checked+.n{background:var(--ok)}
.aisteps .tx{flex:1}
.rooms{display:flex;flex-direction:column;gap:var(--space-2);max-width:640px}
.room-o{position:relative}
.room-o input{position:absolute;opacity:0;width:1px;height:1px}
.room-o label{display:flex;flex-direction:column;gap:2px;padding:var(--space-3) var(--space-4);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);cursor:pointer;transition:border-color 160ms ease,background-color 160ms ease}
.room-o label span{font-size:.875rem;color:var(--ink-muted)}
.room-o .okline,.room-o .warnline{display:flex;align-items:center;gap:var(--space-2);color:var(--ink)}
.room-o .okline svg{width:14px;height:14px;color:var(--ok)}
.room-o .warnline svg{width:14px;height:14px;color:var(--c-alt)}
.room-o input:checked+label{border-color:var(--brand);background:var(--brand-tint);box-shadow:inset 0 0 0 1px var(--brand)}
.room-o input:focus-visible+label{outline:2px solid var(--focus-ring);outline-offset:2px}
.room-o.dis label{cursor:not-allowed;background:var(--surface-200);border-color:var(--line)}
.room-o.dis label b{color:var(--ink-muted)}
.pushprev{max-width:420px;padding:var(--space-5);background:linear-gradient(160deg,#0a3a5e,#123f63);border-radius:var(--radius-lg)}
.sheet-bg{position:absolute;inset:0;z-index:20;background:rgba(11,27,43,.35)}
.sheet-bg:not([hidden]){animation:fadein 200ms ease}
.sheet{position:absolute;top:0;right:0;bottom:0;z-index:21;display:flex;flex-direction:column;width:min(380px,100%);background:var(--surface-0);border-left:1px solid var(--line);box-shadow:-8px 0 30px rgba(11,27,43,.18)}
.sheet:not([hidden]){animation:slidein 280ms var(--ease-out)}
@keyframes slidein{from{transform:translateX(100%)}to{transform:none}}
@keyframes fadein{from{opacity:0}to{opacity:1}}
@container mon (max-width:600px){.sheet{top:auto;left:0;width:auto;max-height:80%;border-left:0;border-top:1px solid var(--line);border-radius:var(--radius-lg) var(--radius-lg) 0 0}.sheet:not([hidden]){animation-name:slideup}}
@keyframes slideup{from{transform:translateY(100%)}to{transform:none}}
.sheet-h{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);padding:var(--space-3) var(--space-3) var(--space-3) var(--space-5);border-bottom:1px solid var(--line)}
.sheet-h h3{font-size:1.25rem}
.sheet-b{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-5);overflow:auto}
.sheet-b .st.big{font-size:1rem;color:var(--ink)}
.sheet-b .st i.bad{background:var(--c-crit)}
.stepper{display:flex;align-items:center;gap:var(--space-3)}
.stepper .ic-btn{border:1px solid var(--border)}
.stepper output{min-width:96px;text-align:center;font-family:var(--font-display);font-weight:700;font-size:2rem;font-variant-numeric:tabular-nums}

/* ================= v2: tècnic ================= */
.ctitle{font-family:var(--font-display);font-weight:700;font-size:1.125rem}
.ctabs{display:flex;gap:var(--space-1);padding:3px;border:1px solid var(--line);border-radius:var(--radius-md)}
.ctabs button{display:inline-flex;align-items:center;gap:var(--space-2);min-height:40px;padding:0 var(--space-3);border:0;border-radius:9px;background:transparent;font-weight:700;font-size:.875rem;color:var(--ink-muted)}
.ctabs button svg{width:18px;height:18px}
.ctabs button b{min-width:22px;padding:0 6px;border-radius:11px;background:var(--surface-200);color:var(--ink);font-size:.75rem;line-height:20px}
.ctabs button[aria-pressed="true"]{background:var(--brand-tint);color:var(--brand-text)}
.chips{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.chips button{min-height:40px;padding:0 var(--space-4);border:1px solid var(--border);border-radius:999px;background:var(--surface-0);font-weight:700;font-size:.875rem;color:var(--ink)}
.chips button[aria-pressed="true"]{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
.back-in{align-self:flex-start;margin-left:calc(var(--space-3) * -1)}
.resbox{display:flex;flex-direction:column;gap:var(--space-3)}
.resbox legend{font-weight:700;padding:0 var(--space-1)}
.opts{display:flex;flex-direction:column;gap:var(--space-1)}
.opt{display:flex;align-items:center;gap:var(--space-3);min-height:44px;cursor:pointer}
.opt input{width:20px;height:20px;margin:0}
.filters{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3)}
.filters .sel{min-width:200px}
.daylog{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.daylog li{display:grid;grid-template-columns:52px 28px 1fr;gap:var(--space-2);align-items:start;padding:var(--space-3) 0;border-bottom:1px solid var(--line);font-size:.9375rem}
.daylog li:last-child{border-bottom:0}
.daylog time{font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink-muted)}
.daylog .lk{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--surface-200);color:var(--ink-muted)}
.daylog .lk svg{width:15px;height:15px}
.daylog .lg-inc .lk{background:var(--c-crit-soft);color:var(--c-crit)}
.daylog .lg-chg .lk{background:var(--brand-tint);color:var(--brand-text)}
.daylog li.flash{animation:logflash 1400ms var(--ease-out)}
@keyframes logflash{0%{background:var(--brand-tint)}100%{background:transparent}}

/* ================= v2: registre i comentaris ================= */
.band .fb-open .lbl{display:inline}
@media (max-width:719px){.band .fb-open .lbl{display:none}}
.foot a{color:var(--brand-text);font-weight:700}
.plist{margin:0 0 var(--space-3);padding-left:1.2em;display:flex;flex-direction:column;gap:var(--space-1)}
.consent{position:fixed;left:var(--space-4);right:var(--space-4);bottom:var(--space-4);z-index:45;display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3) var(--space-4);max-width:760px;margin:0 auto;padding:var(--space-4) var(--space-5);background:var(--surface-0);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:0 12px 40px rgba(11,27,43,.18)}
.consent:not([hidden]){animation:rise 300ms var(--ease-out)}
.consent>svg{width:28px;height:28px;color:var(--brand-text)}
body.consenting main{padding-bottom:200px}
.consent .ctext{flex:1 1 280px;font-size:.9375rem;color:var(--ink-muted)}
.consent .ctext b{color:var(--ink)}
.consent a{color:var(--brand-text);font-weight:700}
.fb{width:min(520px,calc(100% - 32px));padding:0;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface-0);color:var(--ink);box-shadow:0 20px 60px rgba(11,27,43,.3)}
.fb::backdrop{background:rgba(11,27,43,.45)}
.fb[open]{animation:pop 220ms var(--ease-out)}
.fb form{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-5)}
.fb-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2)}
.fb-head h2{font-size:1.375rem}
.fb textarea{width:100%;padding:var(--space-3) var(--space-4);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);color:var(--ink);font:inherit;resize:vertical}
.fb .seg label{min-height:40px;padding:0 var(--space-3);font-size:.875rem}

/* ================= v2.1: pistes, facilitat i progrés ================= */
.hintb{align-self:flex-start;margin-left:calc(var(--space-3) * -1)}
.hintb svg{width:16px;height:16px}
.hintbox{padding:var(--space-3) var(--space-4);background:var(--brand-tint);border-radius:var(--radius-md);font-weight:500;color:var(--ink)}
.hintbox:not([hidden]){animation:rise 220ms var(--ease-out)}
.seq{display:flex;flex-direction:column;gap:var(--space-2);padding-top:var(--space-3);border-top:1px solid var(--line)}
.seq>p{font-weight:700}
.seqb{display:flex;gap:var(--space-1)}
.seqb button{flex:1;min-width:44px;min-height:44px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);font-family:var(--font-display);font-weight:700;font-size:1.125rem;color:var(--ink);transition:transform 160ms var(--ease-out),background-color 160ms ease,border-color 160ms ease}
.seqb button:active{transform:scale(.95)}
.seqb button[aria-pressed="true"]{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
.seq .ends{margin:0}
.prog{display:flex;align-items:center;gap:var(--space-2);font-size:.9375rem;font-weight:700;color:var(--ink)}
.prog svg{width:18px;height:18px;color:var(--brand-text)}
.role .est{display:flex;align-items:center;gap:var(--space-2);margin-top:auto;font-size:.875rem;color:var(--ink-muted)}
.role .est svg{width:16px;height:16px}
.role .est+.btn{margin-top:0}
.chips button,.ctabs button{min-height:44px}
@media (max-width:599px){
  .rolev.is-phone .hintb{margin:0;min-height:40px;font-size:.875rem}
  .rolev.is-phone .hintbox{font-size:.875rem;padding:var(--space-2) var(--space-3)}
  .consent{left:var(--space-2);right:var(--space-2);bottom:var(--space-2);padding:var(--space-3) var(--space-4)}
  .consent>svg{display:none}
}

/* ================= v2.2: ajustos de la prova amb usuaris ================= */
/* App del campus: capçalera blava, accessos directes i 4 pestanyes */
.tabbar{grid-template-columns:repeat(4,1fr)}
.tabbar button span{font-size:.6875rem}
.apphead{padding:var(--space-3) var(--space-5) var(--space-5);background:linear-gradient(180deg,#0069a6 0%,#007bc0 100%);color:#fff;border-radius:0 0 var(--radius-lg) var(--radius-lg)}
.apphead .ah-top{display:flex;align-items:center;justify-content:space-between;min-height:44px}
.apphead .app{display:flex;align-items:center;gap:var(--space-2);font-weight:700}
.apphead .app .mark{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:#fff;color:#0069a6}
.apphead .app .mark svg{width:16px;height:16px}
.apphead .avatar{background:rgba(255,255,255,.2);color:#fff}
.apphead h2{font-size:1.75rem;margin:var(--space-2) 0 var(--space-3)}
.apphead .now{padding:var(--space-3) var(--space-4);background:rgba(255,255,255,.14);border-radius:var(--radius-md)}
.apphead .now-h .pin{background:rgba(255,255,255,.2);color:#fff}
.apphead .now-h span,.apphead .now-h b,.apphead .now-h .room-big{color:#fff}
.apphead .moved-note{background:#fff;color:#003b66;margin-top:var(--space-2)}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-2)}
.tile{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);min-height:84px;padding:var(--space-3) var(--space-1);border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-0);font-weight:700;font-size:.8125rem;color:var(--ink);transition:transform 160ms var(--ease-out)}
.tile:active{transform:scale(.96)}
.tile svg{width:26px;height:26px;color:var(--brand-text)}
.scr.tab .apphead+.sbody{padding-top:var(--space-4)}

/* Carnet amb estil de cartera */
.scr.wallet{background:#101820}
.scr.wallet .shead{color:#fff;padding-left:var(--space-5)}
.scr.wallet .shead .ttl{font-size:1.5rem}
.scr.wallet .wcard{display:flex;flex-direction:column;justify-content:space-between;cursor:default}
.scr.wallet .wstack{background:#2a3644}
.nfcbox{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);margin-top:var(--space-4);color:#fff;text-align:center}
.nfc-wait{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);width:100%}
.nfc-wait p{font-weight:700;font-size:1.0625rem}
.tapr{position:relative;display:grid;place-items:center;width:96px;height:96px}
.tapr svg{position:relative;z-index:1;width:44px;height:44px;padding:10px;border-radius:50%;background:#007bc0;color:#fff}
.tapr i{position:absolute;inset:22px;border-radius:50%;border:2px solid #5bbcf5;animation:ring 2s var(--ease-out) infinite}
.tapr i+i{animation-delay:1s}
.nfc-ok{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-4);border-radius:var(--radius-md);background:#13351f;color:#fff;text-align:left;animation:pop 260ms var(--ease-out)}
.nfc-ok>svg{width:32px;height:32px;padding:6px;border-radius:50%;background:#4fd18b;color:#0b1b2b}
.nfc-ok b{display:block;font-size:1.125rem}
.nfc-ok span{color:#cfeedd;font-size:.875rem}
.wcard.mini{width:100%;max-width:260px;aspect-ratio:1.586;margin:var(--space-2) 0;padding:var(--space-3) var(--space-4);display:flex;flex-direction:column;justify-content:space-between;color:#fff;box-shadow:0 8px 24px rgba(0,0,0,.35)}
.wcard.mini .who{font-size:.8125rem}

/* Formulari: text lliure i foto discreta */
.txt{width:100%;min-height:48px;padding:0 var(--space-4);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);color:var(--ink);font:inherit;font-size:1rem}
.types{grid-template-columns:1fr 1fr}
#a-photo-add{min-height:48px;border-style:dashed;border-width:1px;font-size:.9375rem}
#a-photo-add small{display:inline;font-weight:500}
.eta-big{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4);margin-bottom:var(--space-3);background:var(--brand-tint);border-radius:var(--radius-md);text-align:left}
.eta-big>svg{width:28px;height:28px;color:var(--brand-text)}
.eta-big span span,.eta-big div span{display:block;font-size:.8125rem;color:var(--ink-muted)}
.eta-big b{font-family:var(--font-display);font-size:1.75rem;line-height:1.1}
#b-sent{max-width:none}
#b-sent .eta-big{margin:0}

/* Assistent: tria d'equip i passos visuals */
.picks{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-2);max-width:520px}
.pick{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-2);min-height:88px;padding:var(--space-3) var(--space-4);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-0);font-weight:700;text-align:left;transition:transform 160ms var(--ease-out),border-color 160ms ease}
.pick:active{transform:scale(.97)}
.pick svg{width:28px;height:28px;color:var(--brand-text)}
.prog3{display:flex;align-items:center;gap:var(--space-3);max-width:520px;font-size:.875rem;font-weight:700}
.pbar{flex:1;height:8px;border-radius:4px;background:var(--surface-200);overflow:hidden}
.pbar i{display:block;height:100%;background:var(--ok);border-radius:4px;transition:width 300ms var(--ease-out)}
.stepcs{list-style:none;margin:var(--space-3) 0 0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-2);max-width:620px}
.stepc{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);width:100%;min-height:132px;padding:var(--space-4) var(--space-2);border:2px solid var(--line);border-radius:var(--radius-md);background:var(--surface-0);text-align:center;transition:transform 160ms var(--ease-out),background-color 200ms ease,border-color 200ms ease}
.stepc:active{transform:scale(.96)}
.stepc>svg{width:34px;height:34px;color:var(--brand-text)}
.stepc b{font-size:.9375rem;line-height:1.25}
.stepc .sn{position:absolute;top:8px;left:8px;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--surface-200);font-size:.75rem;font-weight:700}
.stepc .sn svg{width:13px;height:13px}
.stepc.on{border-color:var(--ok);background:var(--ok-soft)}
.stepc.on .sn{background:var(--ok);color:#fff}
.stepc.on>svg{color:var(--ok)}
@container mon (max-width:600px){.stepcs{grid-template-columns:1fr}.stepc{flex-direction:row;justify-content:flex-start;min-height:64px;padding-left:44px;text-align:left}.stepc .sn{top:50%;margin-top:-12px}}
#b4 .ask{margin-top:var(--space-4)}
#b4 .yn .btn svg{width:18px;height:18px}

/* Clima de l'aula: visual, sense xifres grans */
.clima{display:flex;flex-direction:column;gap:var(--space-3)}
.cl-t{display:grid;grid-template-columns:auto 1fr;column-gap:var(--space-3);align-items:center}
.cl-t svg{width:28px;height:28px;color:var(--brand-text);grid-row:span 2}
.cl-t b{font-family:var(--font-display);font-size:2rem;line-height:1}
.cl-t span{font-size:.8125rem;color:var(--ink-muted)}
.cl-a{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);background:var(--surface-200)}
.cl-a>svg{width:20px;height:20px}
.cl-a b{flex:1}
.cl-a .btn{min-height:40px;padding:0 var(--space-3)}
.cl-a.ok{background:var(--ok-soft)} .cl-a.ok>svg{color:var(--ok)}
.cl-a.mid{background:var(--c-alt-soft)} .cl-a.mid>svg{color:var(--ink)}
.cl-a.bad{background:var(--c-crit-soft)} .cl-a.bad>svg{color:var(--c-crit)}
.cl-a.vent{background:var(--brand-tint)} .cl-a.vent>svg{color:var(--brand-text);animation:spin 2.4s linear infinite}
.airbar{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
.airbar i{height:6px;border-radius:3px;background:var(--surface-200)}
.airbar.ok i:nth-child(1),.airbar.vent i:nth-child(1){background:var(--ok)}
.airbar.mid i:nth-child(-n+2){background:var(--c-alt)}
.airbar.bad i{background:var(--c-crit)}
.noreg{margin-top:var(--space-3);padding-top:var(--space-3);border-top:1px solid var(--line)}
.noreg p{margin-bottom:var(--space-2)}
.tnow{display:flex;align-items:center;gap:var(--space-2)}
.tnow svg{width:22px;height:22px;color:var(--brand-text)}
.tnow b{font-family:var(--font-display);font-size:1.5rem}
@media (prefers-reduced-motion:reduce){.tapr i{animation:none;opacity:0}.cl-a.vent>svg{animation:none}}

/* ================= v2.3: app del campus amb l'estructura de l'app universitària ================= */
.appbar{position:relative;z-index:2;display:flex;align-items:center;gap:var(--space-2);min-height:60px;padding:0 var(--space-2);background:#0b5ea8;color:#fff}
.appbar .ttl{flex:1;font-family:var(--font-display);font-weight:700;font-size:1.25rem;color:#fff}
.appbar .ic-btn{color:#fff}
.appbar .bell{position:relative}
.appbar .bell .bdg{top:6px;left:auto;right:4px}
.btn.on-blue{color:#fff}
@media (hover:hover) and (pointer:fine){.btn.on-blue:hover{background:rgba(255,255,255,.15)}}
.btn.sm{min-height:40px;padding:0 var(--space-4);border-radius:999px;font-size:.875rem}
.phone .sbody{background:var(--surface-100)}
.hero-cta{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-4);text-align:left;border:0;border-radius:var(--radius-md);color:#fff;background:linear-gradient(120deg,#0b5ea8 0%,#007bc0 100%);transition:transform 160ms var(--ease-out)}
.hero-cta:active{transform:scale(.98)}
.hero-cta .hc-i{display:grid;place-items:center;width:48px;height:48px;border-radius:12px;background:rgba(255,255,255,.18)}
.hero-cta .hc-i svg{width:26px;height:26px}
.hero-cta .hc-t{flex:1}
.hero-cta b{display:block;font-family:var(--font-display);font-size:1.0625rem;line-height:1.25}
.hero-cta .hc-t span{font-size:.875rem;opacity:.95}
.hero-cta .chev{width:20px;height:20px}
.now-card{display:flex;align-items:stretch;overflow:hidden;border-radius:var(--radius-md);background:var(--surface-0);border:1px solid var(--line)}
.now-card .nc-t{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:72px;padding:var(--space-3);background:#d8ebf8;color:#0b1b2b}
.now-card .nc-t b{font-size:1.0625rem}
.now-card .nc-t span{font-size:.8125rem}
.now-card .nc-s{flex:1;display:flex;flex-direction:column;justify-content:center;padding:var(--space-3) var(--space-4)}
.now-card .nc-s span{font-size:.875rem;color:var(--ink-muted)}
.nowtag{align-self:center;margin-right:var(--space-3);padding:2px var(--space-2);border-radius:999px;background:var(--brand);color:var(--on-brand);font-size:.75rem;font-weight:700}
.sec-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);margin-top:var(--space-2)}
.sec-row h3{font-family:var(--font-display);font-size:1.125rem;color:var(--brand-text)}
.home-notes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.hn{display:grid;grid-template-columns:1fr auto;gap:2px var(--space-2);width:100%;padding:var(--space-3) var(--space-4);text-align:left;border:0;border-radius:var(--radius-sm);background:var(--surface-200);color:var(--ink)}
.hn b{font-size:.9375rem}
.hn span{grid-column:1;font-size:.875rem;color:var(--ink-muted)}
.hn time{grid-row:1;grid-column:2;font-size:.75rem;color:var(--ink-muted)}
.hn.unread{background:var(--brand-tint)}
.hn-empty{padding:var(--space-4);border-radius:var(--radius-sm);background:var(--surface-200);font-size:1rem}
/* Calendari */
.day-h{display:flex;align-items:center;gap:var(--space-2);font-size:1.375rem}
.day-h i{width:10px;height:10px;border-radius:50%;background:var(--brand)}
.cal{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.calc-i{display:flex;min-height:104px;overflow:hidden;border-radius:var(--radius-sm)}
.calc-i .ct{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:96px;padding:var(--space-3) var(--space-2);color:#0b1b2b}
.calc-i .ct b{font-size:1.0625rem}
.calc-i .ct span{font-size:.875rem}
.calc-i .ct em{margin-top:var(--space-1);padding:4px 10px;border-radius:999px;font-style:normal;font-size:.75rem;background:rgba(255,255,255,.55)}
.calc-i .cs{position:relative;flex:1;display:flex;flex-direction:column;justify-content:center;padding:var(--space-3) var(--space-4);color:#0b1b2b}
.calc-i .cs b{font-size:1rem;text-transform:uppercase;letter-spacing:.01em}
.calc-i .cs span{font-size:.875rem}
.calc-i .nowtag{position:absolute;top:8px;right:0}
.calc-i.c1 .ct{background:#9fd0f0}.calc-i.c1 .cs{background:#cfe8f8}
.calc-i.c2 .ct{background:#8fdcc8}.calc-i.c2 .cs{background:#c4efe3}
.calc-i.c3 .ct{background:#d6d9de}.calc-i.c3 .cs{background:#eceef1}
/* Notes */
.grade-h{font-size:1.125rem;text-align:center;text-transform:uppercase;line-height:1.3}
.term{text-align:center;font-weight:700;font-size:1.0625rem}
.subjects{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.subj{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);width:100%;min-height:56px;padding:0 var(--space-4);text-align:left;border:0;border-radius:var(--radius-sm);background:var(--surface-0);font-weight:700;color:var(--ink)}
.subj svg{width:20px;height:20px;color:var(--brand-text)}
.subj-d{padding:var(--space-2) var(--space-4) var(--space-3);font-size:.875rem;color:var(--ink-muted)}
/* Biblioteca */
.lib{display:flex;flex-direction:column;gap:var(--space-2)}
.lib-c{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4);border-radius:var(--radius-sm);background:var(--surface-0)}
.lib-c>svg{width:26px;height:26px;color:var(--brand-text)}
.lib-c div{flex:1}
.lib-c b{display:block}
.lib-c span{font-size:.875rem;color:var(--ink-muted)}
.lib-c.ok{background:var(--ok-soft)}
.lib-c.ok>svg{color:var(--ok)}
/* Carnet */
.idcard{flex:none;overflow:hidden;border-radius:var(--radius-md);background:var(--surface-0);border:1px solid var(--line);box-shadow:var(--shadow)}
.idc-top{display:flex;justify-content:space-between;gap:var(--space-3);padding:var(--space-4);background:linear-gradient(135deg,#0b5ea8 0%,#0a8ad0 100%);color:#fff;min-height:132px}
.idc-org b{display:block;font-size:.875rem;letter-spacing:.04em}
.idc-org span{font-size:.8125rem;opacity:.95}
.idc-ph{display:grid;place-items:end center;width:76px;height:96px;flex:none;overflow:hidden;border-radius:4px;background:#dfe7ef;color:#9aaab9}
.idc-ph svg{width:70px;height:70px;margin-bottom:-6px}
.idc-mid{display:flex;flex-direction:column;gap:2px;padding:var(--space-3) var(--space-4)}
.idc-mid b{font-size:1rem;letter-spacing:.02em}
.idc-mid span{font-size:.8125rem;color:var(--ink-muted)}
.idc-bar{display:flex;flex-direction:column;align-items:center;gap:4px;padding:0 var(--space-4) var(--space-4)}
.idc-bar .bars{width:100%;height:52px;background:repeating-linear-gradient(90deg,#0b1b2b 0 2px,transparent 2px 5px,#0b1b2b 5px 6px,transparent 6px 9px,#0b1b2b 9px 12px,transparent 12px 14px);opacity:.85}
.idc-bar .num{font-size:.75rem;font-weight:700;letter-spacing:.08em;color:var(--ink-muted)}
#a1 .nfcbox{color:var(--ink)}
#a1 .nfc-wait p{color:var(--ink)}
/* Barra inferior: pestanya activa en bloc blau */
.tabbar{grid-template-columns:repeat(5,1fr);padding:0 0 var(--space-4);gap:0}
.tabbar button{border-radius:0;min-height:60px}
.tabbar button[aria-current="page"]{background:#0b5ea8;color:#fff}
.tabbar button span{font-size:.6875rem}
/* Menú lateral */
.drawer-bg{position:absolute;inset:0;z-index:30;background:rgba(11,27,43,.45)}
.drawer-bg:not([hidden]){animation:fadein 200ms ease}
.drawer{position:absolute;top:0;bottom:0;left:0;z-index:31;width:82%;max-width:320px;overflow:auto;background:#0b5ea8;color:#fff;box-shadow:8px 0 30px rgba(0,0,0,.25)}
.drawer:not([hidden]){animation:drin 260ms var(--ease-out)}
@keyframes drin{from{transform:translateX(-100%)}to{transform:none}}
.dr-prof{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-3) var(--space-5) var(--space-4);border-bottom:1px solid rgba(255,255,255,.2)}
.dr-av{display:grid;place-items:end center;width:56px;height:56px;flex:none;overflow:hidden;border-radius:50%;background:#fff;color:#0b5ea8}
.dr-av svg{width:48px;height:48px;margin-bottom:-6px}
.dr-prof div{flex:1;min-width:0}
.dr-prof b{display:block}
.dr-prof span{font-size:.8125rem;opacity:.95}
.dr-prof .ic-btn{color:#fff}
.drawer ul{list-style:none;margin:0;padding:var(--space-2) 0}
.drawer li button{display:flex;align-items:center;gap:var(--space-4);width:100%;min-height:56px;padding:0 var(--space-5);border:0;background:transparent;color:#fff;font-size:1rem;font-weight:500;text-align:left}
.drawer li button svg{width:22px;height:22px}
@media (hover:hover) and (pointer:fine){.drawer li button:hover{background:rgba(255,255,255,.12)}}
.drawer .new{margin-left:auto;padding:2px 8px;border-radius:999px;background:#fff;color:#0b5ea8;font-size:.6875rem;font-weight:700}
.drawer :focus-visible{outline-color:#fff}
@media (prefers-reduced-motion:reduce){.drawer:not([hidden]),.drawer-bg:not([hidden]){animation:none}}

@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pop{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:none}}
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes draw{to{stroke-dashoffset:0}}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:1ms!important;animation-delay:0ms!important;transition-duration:1ms!important}
  .scr{transition:opacity 150ms ease!important}
  .scr[data-pos]{transform:none}
  .okmark svg{stroke-dashoffset:0}
  .btn .spin{animation:none;border-right-color:currentColor;opacity:.6}
  .reader .ring{animation:none;opacity:0}
  .reader .card-in{transition:opacity 150ms ease!important}
  .monitor .scr.on{animation:none}
  .push:not([hidden]),.sheet:not([hidden]),.consent:not([hidden]){animation:none}
  .wcard .face{transition:opacity 150ms ease!important;transform:none!important}
}

/* ================= v2.4: revisió UI/UX ================= */
/* Capçalera d'una sola fila al mòbil: més espai per a la tasca */
@media (max-width:599px){
  .band{gap:var(--space-2);padding:var(--space-1) var(--space-3) var(--space-2)}
  .band .logo{height:26px}
  .band .tools{gap:var(--space-1)}
  .band .tools .btn.ghost{min-width:44px;padding:0 var(--space-2)}
  .flag{padding:2px var(--space-2);font-size:.75rem}
  /* Professor i tècnic: el text de la tasca, més compacte */
  .rolev:not(.is-phone) .tpanel{gap:var(--space-2)}
  .rolev:not(.is-phone) .tpanel h1{font-size:1.25rem}
  .rolev:not(.is-phone) .tpanel .hint{font-size:.9375rem}
  .rolev:not(.is-phone) .tpanel .back{min-height:44px}
  .rolev.is-phone .hintb{min-height:44px}
}
/* Objectius tàctils de 44 px */
.btn.sm,.cl-a .btn{min-height:44px}
.foot a{display:inline-flex;align-items:center;min-height:44px}
/* Text mínim de 12 px */
.tabbar button span{font-size:.75rem}
.qrow .pv span{font-size:.75rem}
@media (max-width:719px){.qrow .side{justify-content:flex-start;gap:var(--space-2)}}
/* Calendari en mode fosc: colors apagats, sense enlluernar */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .calc-i .ct,:root:not([data-theme="light"]) .calc-i .cs{color:#e8f1f8}
  :root:not([data-theme="light"]) .calc-i .ct em{background:rgba(255,255,255,.12)}
  :root:not([data-theme="light"]) .calc-i.c1 .ct{background:#1d4f74}:root:not([data-theme="light"]) .calc-i.c1 .cs{background:#163a55}
  :root:not([data-theme="light"]) .calc-i.c2 .ct{background:#1b5a4c}:root:not([data-theme="light"]) .calc-i.c2 .cs{background:#15433a}
  :root:not([data-theme="light"]) .calc-i.c3 .ct{background:#3a4552}:root:not([data-theme="light"]) .calc-i.c3 .cs{background:#2b343e}
  :root:not([data-theme="light"]) .now-card .nc-t{background:#1d4f74;color:#e8f1f8}
}
:root[data-theme="dark"] .calc-i .ct,:root[data-theme="dark"] .calc-i .cs{color:#e8f1f8}
:root[data-theme="dark"] .calc-i .ct em{background:rgba(255,255,255,.12)}
:root[data-theme="dark"] .calc-i.c1 .ct{background:#1d4f74}:root[data-theme="dark"] .calc-i.c1 .cs{background:#163a55}
:root[data-theme="dark"] .calc-i.c2 .ct{background:#1b5a4c}:root[data-theme="dark"] .calc-i.c2 .cs{background:#15433a}
:root[data-theme="dark"] .calc-i.c3 .ct{background:#3a4552}:root[data-theme="dark"] .calc-i.c3 .cs{background:#2b343e}
:root[data-theme="dark"] .now-card .nc-t{background:#1d4f74;color:#e8f1f8}
