:root{--nav:#0e2139;--nav2:#193656;--navtext:#d9e6f8;--bg:#f4f7fb;--surface:#fff;--surface2:#f8fafd;--text:#152b44;--muted:#52657b;--line:#dce4ee;--accent:#156ad3;--accentbg:#e8f2ff;--orange:#eb8c3a;--green:#087f65;--shadow:0 5px 24px rgba(29,50,78,.07);color-scheme:light;font-family:Inter,'Segoe UI',Arial,sans-serif}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-size:15px;line-height:1.5}body.dark{--bg:#0d1726;--surface:#17253a;--surface2:#1c2d44;--text:#edf3fb;--muted:#afc2d8;--line:#35516b;--accent:#6cb2ff;--accentbg:#1b385b;--green:#6ce0ba;--shadow:none;color-scheme:dark}a{color:var(--accent)}button,input,select,textarea{font:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #ffb45f;outline-offset:2px}.skip-link{position:absolute;top:-100px;z-index:1000;background:#fff;padding:8px}.skip-link:focus{top:3px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.app-shell{display:flex;min-height:100vh}.sidebar{width:260px;flex:0 0 260px;background:var(--nav);color:var(--navtext);padding:27px 17px;display:flex;flex-direction:column;min-height:100vh}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:#fff;padding:0 9px 40px}.brand-mark{background:linear-gradient(145deg,#52c7f8,#166cd6);border-radius:13px;display:grid;place-items:center;width:47px;height:47px;font-size:30px;font-weight:900;letter-spacing:-4px}.brand-mark span{font-size:18px;color:#fbd269;position:relative;left:2px}.brand strong{font-size:14px;letter-spacing:.09em}.brand small{display:block;font-size:9px;letter-spacing:.13em;color:#9ab5d2}.nav-kicker{font-size:10px;letter-spacing:.22em;color:#789bc0;font-weight:800;padding-left:15px;margin:8px 0 14px}.sidebar nav{display:grid;gap:5px}.nav-item{display:flex;align-items:center;gap:13px;color:var(--navtext);text-decoration:none;padding:12px 13px;border-radius:10px;font-weight:600;font-size:13px}.nav-item span{font-size:22px;width:25px;text-align:center;color:#a4d4ff}.nav-item:hover,.nav-item.active{background:var(--nav2);color:#fff}.nav-item.active{box-shadow:inset 3px 0 #4ab8ff}.sidebar-bottom{margin-top:auto;color:#9eb6ce;border-top:1px solid #294564;padding:19px 10px 0;font-size:12px}.sidebar-bottom small{font-size:10px}.main-area{min-width:0;flex:1;display:flex;flex-direction:column}.topbar{height:68px;display:flex;align-items:center;gap:16px;justify-content:space-between;background:var(--surface);border-bottom:1px solid var(--line);padding:0 35px}.breadcrumb{font-size:12px;color:var(--muted);font-weight:600}.top-controls{display:flex;align-items:center;gap:10px}select,input,textarea{border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);padding:11px 12px;max-width:100%}.top-controls select{padding:7px 12px}.iconbtn{background:var(--surface2);border:1px solid var(--line);color:var(--text);border-radius:9px;padding:8px 11px}.menu-btn{display:none}main{width:100%;flex:1}.content-wrap{max-width:1290px;margin:0 auto;padding:34px 35px 65px}.eyebrow{font-size:11px;font-weight:900;letter-spacing:.18em;color:var(--accent);text-transform:uppercase}.hero{display:grid;grid-template-columns:1.5fr 1fr;gap:35px;border-radius:18px;background:linear-gradient(110deg,#193a65,#0c223e);color:#fff;padding:34px 40px;overflow:hidden;position:relative}.hero:after{content:'π';position:absolute;right:15px;bottom:-105px;color:rgba(255,255,255,.04);font-size:320px;font-family:Georgia,serif;pointer-events:none}.hero .eyebrow{color:#89d8ff}.hero h1{margin:12px 0 13px;font-size:clamp(28px,3.5vw,43px);line-height:1.16;letter-spacing:-.04em}.hero p{color:#d1dfed;max-width:580px}.hero-art{display:flex;align-items:center;justify-content:center;gap:13px;min-height:210px}.math-tile{border:1px solid #6294d3;background:#2c5889;border-radius:19px;color:white;display:grid;place-items:center;width:95px;height:98px;font-size:49px;box-shadow:0 10px 32px #091a2b80;transform:rotate(-8deg)}.math-tile:nth-child(2){background:#f2a044;transform:rotate(8deg) translateY(28px)}.math-tile:nth-child(3){background:#29a69b;transform:rotate(-3deg) translateY(-14px)}.action-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:22px}.btn{border-radius:10px;padding:11px 17px;font-weight:800;border:1px solid transparent;display:inline-flex;align-items:center;justify-content:center;gap:7px;line-height:1.25;text-decoration:none;transition:transform .12s}.btn:hover{transform:translateY(-1px)}.btn.primary{background:#146cd9;color:white}.btn.light{background:white;color:#163255}.btn.secondary{background:var(--surface2);border-color:var(--line);color:var(--text)}.btn.ghost{background:transparent;border:1px solid #8db8ed;color:white}.btn.small{font-size:12px;padding:8px 11px}.section-head{display:flex;justify-content:space-between;gap:20px;align-items:end;margin:33px 0 17px}.section-head h2{font-size:23px;letter-spacing:-.035em;margin:6px 0}.section-head p{color:var(--muted);margin:0}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin:22px 0}.stat{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:18px;box-shadow:var(--shadow)}.stat strong{font-size:26px;display:block;letter-spacing:-.04em}.stat span{font-size:12px;color:var(--muted)}.course-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.course-card{display:flex;flex-direction:column;gap:11px;background:var(--surface);border:1px solid var(--line);padding:22px;border-radius:14px;text-decoration:none;color:var(--text);box-shadow:var(--shadow);position:relative;min-height:190px}.course-card:hover{border-color:var(--accent);transform:translateY(-2px)}.course-card .circle{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;font-size:22px;font-weight:900}.course-card h3{font-size:18px;margin:2px 0 0}.course-card p{color:var(--muted);margin:0;font-size:12px}.course-card .circle{background:#eaf0ff;color:#265db5}.course-card:nth-child(2) .circle{background:#e5f5f1;color:#157b66}.course-card:nth-child(3) .circle{background:#fff0e2;color:#ba6429}.course-card:nth-child(4) .circle{background:#eeeaff;color:#6c50a9}.course-card:nth-child(5) .circle{background:#fce9ef;color:#ad406c}.course-card:nth-child(6) .circle{background:#fef6d9;color:#9a7416}.tag{font-size:11px;background:var(--accentbg);color:var(--accent);border-radius:999px;padding:5px 9px;display:inline-block;font-weight:800;width:fit-content}.muted{color:var(--muted)}.muted-sm{color:var(--muted);font-size:12px}.panel{background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:23px;box-shadow:var(--shadow)}.panel h3{margin:0 0 12px}.toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:end}.toolbar label,.field{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:800;min-width:135px;flex:1}.toolbar input,.toolbar select{width:100%}.sheet-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin-top:20px}.sheet-card{border:1px solid var(--line);background:var(--surface);border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:9px;box-shadow:var(--shadow)}.sheet-card h3{margin:0;font-size:16px}.sheet-card p{margin:0;font-size:12px;color:var(--muted)}.sheet-card .actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:auto;padding-top:10px}.sheet-card .actions a,.sheet-card .actions button{font-size:11px;padding:8px}.sheet-id{color:var(--accent);font-size:11px;font-weight:900;letter-spacing:.1em}.two-cols{display:grid;grid-template-columns:1.1fr 1fr;gap:18px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.preview{background:var(--surface2);border:1px dashed var(--line);border-radius:12px;padding:20px;min-height:280px}.preview ol{padding-left:23px}.preview li{margin-bottom:12px}.preview .answer{color:var(--green);font-size:12px;font-weight:800}.tabs{display:flex;gap:8px;flex-wrap:wrap}.tab{padding:8px 12px;border-radius:8px;border:1px solid var(--line);background:var(--surface);color:var(--text);font-weight:700}.tab.active{background:var(--accent);color:#fff}.notice{border:1px solid var(--line);background:var(--surface2);padding:15px;border-radius:10px;font-size:13px}.notice.warning{border-left:4px solid #e49b28}.unit{margin-bottom:15px}.unit h3{margin:4px 0}.list-simple{margin:7px 0 0;padding-left:20px}.list-simple li{margin:5px 0}.progress{background:var(--line);height:7px;border-radius:9px;overflow:hidden}.progress>div{height:100%;background:var(--green)}.game-question{font-size:clamp(24px,3vw,40px);font-weight:900;text-align:center;padding:25px;margin:13px 0;border:1px solid var(--line);border-radius:12px;background:var(--surface2)}.answers{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.answers button{font-size:20px;padding:15px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:10px}.answers button:hover{border-color:var(--accent)}.question-feedback{font-weight:700;min-height:26px;margin:8px 0;color:var(--green)}.footer{padding:23px 35px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}.footer span{display:block;margin-top:5px}#toast{position:fixed;right:15px;bottom:17px;z-index:400;background:var(--nav);color:#fff;padding:12px 18px;border-radius:10px;display:none;max-width:350px}.empty{padding:25px;text-align:center;background:var(--surface);border:1px dashed var(--line);border-radius:10px;color:var(--muted)}.print-sheet{display:none}@media(max-width:1150px){.sheet-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.course-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.sidebar{position:fixed;z-index:200;inset:0 auto 0 0;transform:translateX(-100%);transition:transform .2s;box-shadow:10px 0 30px #0004}.sidebar.open{transform:translateX(0)}.menu-btn{display:block}.topbar{padding:0 16px}.content-wrap{padding:22px 16px 45px}.hero{grid-template-columns:1fr;padding:26px}.hero-art{min-height:120px}.math-tile{width:67px;height:75px;font-size:34px}.two-cols{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.footer{padding:20px 16px}}@media(max-width:520px){.course-grid,.sheet-grid,.form-grid{grid-template-columns:1fr}.hero h1{font-size:31px}.hero-art{display:none}.section-head{display:block}.breadcrumb{font-size:11px}.stat strong{font-size:23px}.panel{padding:17px}.top-controls select{max-width:100px}.stats{gap:8px}}@media print{@page{size:A4;margin:14mm}body{font-family:Arial,sans-serif;background:#fff!important;color:#111!important}.sidebar,.topbar,.footer,#toast,.content-wrap,.skip-link{display:none!important}.print-sheet{display:block!important;font-size:12pt}.print-sheet h1{font-size:18pt;margin-bottom:4px}.print-sheet .heading{border-bottom:1px solid #222;padding-bottom:14px;margin-bottom:18px}.print-sheet .name-row{display:flex;justify-content:space-between}.print-sheet ol{padding-left:24px}.print-sheet li{margin:0 0 22px;break-inside:avoid}.print-sheet li .writing-space{height:24px;border-bottom:1px dotted #bbb}.print-sheet .print-answer{margin:0 0 10px}.print-sheet .page-break{break-before:page}.print-sheet a{color:#111;text-decoration:none}}

/* === Laboratori Tàctil 2.0 — resilient touch-first layout === */
.tl-home-promo{margin:18px 0 27px;background:linear-gradient(110deg,#125a9c,#164268 65%,#12685f);color:#fff;border-radius:18px;padding:28px 32px;display:grid;grid-template-columns:1.5fr .65fr;gap:15px;overflow:hidden}
.tl-home-promo h3{font-size:25px;margin:9px 0 7px;letter-spacing:-.035em}.tl-home-promo p{max-width:630px;color:#e0effc;font-size:14px}.tl-home-shapes{display:flex;align-items:center;justify-content:center;gap:12px;transform:rotate(-6deg)}.tl-home-shapes span{background:#ffffff19;border:1px solid #ffffff65;border-radius:18px;padding:12px;font-size:43px;box-shadow:0 15px 30px #00243a70}.tl-home-shapes span:nth-child(2){background:#f3b85435;transform:translateY(24px)}
.touch-lab{color:var(--text);max-width:100%}.tl-intro{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:18px 20px;background:linear-gradient(115deg,#102f58,#1a647e);border-radius:13px;color:white}.tl-intro h3{font-size:22px;margin:3px 0 5px;color:white}.tl-intro p{font-size:13px;color:#deeffa;margin:2px 0}.tl-kicker{font-size:11px!important;font-weight:900;letter-spacing:.15em;color:#83ddfb!important}.tl-noads{flex-shrink:0;border:1px solid #c6e5fba8;padding:8px 11px;border-radius:30px;color:#e7fcff;font-size:11px;font-weight:800}
.tl-top{margin:16px 0;display:grid;gap:12px}.tl-field{display:grid;gap:5px;font-size:12px;font-weight:800}.tl-field select{max-width:400px}.tl-tags{display:flex;flex-wrap:wrap;gap:7px}.tl-chip{padding:9px 11px;display:flex;align-items:center;gap:5px;border:1px solid var(--line);background:var(--surface2);color:var(--text);border-radius:999px;font-size:12px;font-weight:800;cursor:pointer}.tl-chip.selected{background:#1666cc;color:white;border-color:#1666cc;box-shadow:0 4px 12px #1056b033}.tl-chip small{font-size:9px;opacity:.73}.tl-chip:focus-visible,.tl-nudge:focus-visible,.tl-actions .btn:focus-visible{outline:3px solid #f0aa26;outline-offset:3px}
.tl-workarea{border:1px solid var(--line);border-radius:16px;background:var(--surface);overflow:hidden;box-shadow:var(--shadow)}.tl-content{padding:16px}.tl-mission{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--accentbg);border:1px solid var(--line);padding:14px 17px;border-radius:12px;margin-bottom:14px}.tl-section{font-weight:900;font-size:10px;letter-spacing:.16em;color:var(--accent)}.tl-task{font-size:clamp(16px,2.2vw,21px);font-weight:900;line-height:1.3;color:var(--text);margin:5px 0}.tl-help{font-size:13px;color:var(--muted);margin:0}.tl-target{white-space:nowrap;background:var(--surface);color:var(--accent);padding:9px 11px;font-size:12px;border-radius:9px;font-weight:900}
.tl-board{position:relative;background:#f8fbff;border:2px solid #c5daf2;border-radius:15px;overflow:hidden;max-width:920px;margin:0 auto;box-shadow:0 8px 24px #194d7910}.tl-board svg,.tl-board canvas{width:100%;height:auto;display:block;aspect-ratio:640 / 420;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.tl-board .tl-grab{cursor:grab}.tl-board .tl-tap,.tl-board .tl-peg{cursor:pointer}.tl-board .tl-grab:active{cursor:grabbing}.tl-gpu{position:absolute;top:9px;right:9px;padding:6px 10px;background:#183d67dd;color:#fff;border-radius:6px;font-size:11px;font-weight:800;pointer-events:none}
.tl-data{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:15px 0}.tl-metric{min-width:95px;background:var(--surface2);border:1px solid var(--line);padding:9px 15px;border-radius:10px;display:grid;gap:2px;text-align:center}.tl-metric span{color:var(--muted);font-size:11px}.tl-metric strong{font-size:18px;color:var(--text);font-variant-numeric:tabular-nums}
.tl-controls{min-height:44px;display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;padding:7px}.tl-controls>span,.tl-controls>label{font-size:13px;color:var(--muted);font-weight:800}.tl-controls select{padding:7px 11px}.tl-nudge{border:1px solid #a6c4e5;background:var(--accentbg);color:var(--accent);border-radius:11px;font-size:18px;font-weight:900;min-width:48px;min-height:44px;padding:8px 11px;cursor:pointer;touch-action:manipulation}.tl-nudge:hover{background:#d6eaff}.tl-rotate{display:flex;gap:8px}.tl-dimensions{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.tl-dimensions label{display:grid;gap:5px;font-size:12px;font-weight:800;color:var(--muted)}.tl-dimensions input{width:100%;accent-color:#176cce}
.tl-feedback{padding:12px 14px;background:var(--surface2);border-radius:10px;font-size:13px;color:var(--muted);min-height:41px}.tl-feedback.visible{color:#885215;background:#fff4df;border:1px solid #f3d08b}.tl-feedback.good{background:#e7f7f1;color:#0c7254;border:1px solid #96d9c3;font-weight:800}.tl-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.tl-actions .btn{font-size:12px;min-height:44px;padding:9px 12px}.tl-bottom{font-size:11px;color:var(--muted);margin:12px 3px}
.dark .tl-board{border-color:#507497}.dark .tl-chip:not(.selected){background:#223f5c}.dark .tl-feedback.visible{background:#513b23;color:#ffe6b0;border-color:#846842}.dark .tl-feedback.good{background:#164738;color:#bbffe0;border-color:#397d61}.dark .tl-nudge:hover{background:#345e8d}
@media(max-width:820px){.tl-home-promo{grid-template-columns:1fr}.tl-home-shapes{display:none}}@media(max-width:520px){.tl-intro{display:block;padding:17px}.tl-noads{display:inline-flex;margin-top:10px}.tl-content{padding:9px}.tl-mission{padding:12px;align-items:start}.tl-help{font-size:12px}.tl-target{padding:5px}.tl-chip{font-size:11px;padding:7px 9px}.tl-data{gap:5px}.tl-metric{padding:6px 8px;min-width:85px;flex:1}.tl-metric strong{font-size:16px}.tl-dimensions{grid-template-columns:1fr}.tl-controls{gap:6px}.tl-actions{gap:6px}.tl-actions .btn{flex:1 1 40%;padding:9px}.tl-board{border-radius:9px}.tl-home-promo{padding:21px}}
@media print{
 body:has(#tactile-lab) .sidebar,body:has(#tactile-lab) .topbar,body:has(#tactile-lab) .footer,body:has(#tactile-lab) #toast,body:has(#tactile-lab) .section-head,body:has(#tactile-lab) .lab-tabs,body:has(#tactile-lab) #quizArea,body:has(#tactile-lab) #manipulator{display:none!important}
 body:has(#tactile-lab) .content-wrap{display:block!important;max-width:none;padding:0!important}body:has(#tactile-lab) #touchArea{display:block!important}body:has(#tactile-lab) .panel{padding:0!important;border:0!important;box-shadow:none!important}body:has(#tactile-lab) .tl-top,body:has(#tactile-lab) .tl-controls,body:has(#tactile-lab) .tl-actions,body:has(#tactile-lab) .tl-feedback{display:none!important}body:has(#tactile-lab) .tl-intro{background:white!important;color:black!important;border:1px solid #ddd}body:has(#tactile-lab) .tl-intro h3,body:has(#tactile-lab) .tl-intro p{color:black!important}body:has(#tactile-lab) .tl-mission,body:has(#tactile-lab) .tl-data{background:white!important;color:black!important}body:has(#tactile-lab) .tl-board{max-height:145mm}body:has(#tactile-lab) .tl-board svg,body:has(#tactile-lab) .tl-board canvas{max-height:145mm}
}
/* === Operacions tàctils 2.1: salts, matrius i repartiment === */
.tl-arithmetic{width:100%;background:#f8fbff}.ar-shell{padding:10px;max-width:100%;box-sizing:border-box}.ar-shell svg{width:100%;height:auto;display:block;aspect-ratio:640/420;touch-action:none;user-select:none;-webkit-user-select:none;background:#f7fbff;border-radius:10px}.ar-shell .ar-hit{cursor:pointer}.ar-shell .ar-grab{cursor:grab}.ar-shell .ar-grab:active{cursor:grabbing}.ar-controls{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:9px;margin:12px auto 4px;max-width:800px}.ar-button{min-width:49px;min-height:46px;padding:9px 14px;border:1.5px solid #a5bee1;border-radius:12px;background:white;color:#174a83;font-size:16px;font-weight:800;cursor:pointer;touch-action:manipulation}.ar-button:hover{background:#e6f2ff}.ar-button:focus-visible,.ar-shell select:focus-visible,.ar-shell svg:focus-visible{outline:3px solid #e49b16;outline-offset:3px}.ar-control-title{font-size:13px;font-weight:850;color:#234d7c}.ar-control-title select{min-width:55px;border:1px solid #b8cbde;border-radius:9px;padding:10px;background:white;color:#183451;margin-left:5px;font-size:16px}.ar-instruction{font-size:12px;line-height:1.5;text-align:center;color:#476581;font-weight:650;margin:8px 5px 11px}.dark .tl-arithmetic,.dark .ar-shell{background:#edf5ff}.dark .ar-instruction{color:#234d70}.dark .ar-control-title{color:#1b4778}
@media(max-width:520px){.ar-shell{padding:5px}.ar-controls{gap:5px;margin-top:8px}.ar-button{min-width:43px;padding:6px 9px;font-size:15px}.ar-control-title{font-size:11px}.ar-instruction{font-size:11px;margin:6px 2px}}
@media print{body:has(#tactile-lab) .ar-controls,body:has(#tactile-lab) .ar-instruction{display:none!important}body:has(#tactile-lab) .tl-arithmetic{background:white!important}}

/* MATHSVERSE PRIMÀRIA 2.2 · Nombres i operacions manipulables */
.tl-manipulative{width:100%;background:#f8fbff;padding:10px;box-sizing:border-box}
.ml-shell{width:100%;margin:0 auto;max-width:900px;color:#244362}
.ml-shell svg{width:100%;height:auto;display:block;aspect-ratio:640/420;touch-action:none;user-select:none;-webkit-user-select:none;border-radius:13px;background:#f7fbff}
.ml-shell .ml-grab{cursor:grab;touch-action:none}
.ml-shell .ml-grab:active{cursor:grabbing}
.ml-shell .ml-hit{cursor:pointer;touch-action:none}
.ml-instructions{min-height:18px;text-align:center;font-size:13px;line-height:1.55;font-weight:650;color:#496582;margin:8px 5px}
.ml-controls{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:7px;margin:10px auto 3px}
.ml-controls>span{font-size:13px;font-weight:800;color:#214b78}
.ml-btn{min-height:44px;min-width:48px;padding:9px 12px;border:1.5px solid #a4c7e8;border-radius:11px;background:white;color:#164e81;font-size:14px;font-weight:800;cursor:pointer;touch-action:manipulation}
.ml-btn:hover{background:#e3f1ff}
.ml-btn:focus-visible,.ml-shell svg:focus-visible{outline:3px solid #f2a832;outline-offset:3px}
.ml-undo{margin-left:4px;background:#ecf6ff}
.dark .tl-manipulative,.dark .ml-shell{background:#eef6ff;color:#234463}
@media(max-width:520px){.tl-manipulative{padding:5px}.ml-controls{gap:5px}.ml-btn{font-size:13px;min-width:43px;padding:8px 9px}.ml-instructions{font-size:12px}}
@media print{body:has(#tactile-lab) .ml-controls,body:has(#tactile-lab) .ml-instructions{display:none!important}}

/* Laboratori Tàctil 2.3 — Geometria i Mesures */
.tl-geometry{width:100%;min-width:0;padding:10px 9px 7px;background:#edf5ff;border-radius:16px}
.geo-module{width:100%;min-width:0}
.geo-svg{display:block;width:100%;height:auto;aspect-ratio:640/420;border-radius:12px;background:#f8fbff;touch-action:none;user-select:none;-webkit-user-select:none;outline-offset:3px}
.geo-svg:focus-visible{outline:3px solid #1b69d4}
.geo-grab,.geo-paint{cursor:grab;touch-action:none}
.geo-grab:active,.geo-paint:active{cursor:grabbing}
.geo-actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin-top:12px;padding:9px;background:#f8fbff;border:1px solid #c9def5;border-radius:12px;color:#1d3b60}
.geo-actions label{display:inline-flex;align-items:center;gap:7px;flex-wrap:wrap;font-weight:700}
.geo-actions select,.geo-actions input{max-width:220px;min-height:42px;border-radius:9px;border:1px solid #9bb8d6;background:white;color:#1e395a;font:inherit;padding:5px 9px}
.geo-actions input[type=range]{min-width:110px;max-width:150px;accent-color:#246fda}
.geo-btn{min-width:44px;min-height:44px;border-radius:10px;border:1.5px solid #9ebee1;background:white;color:#193b69;padding:7px 12px;font-size:16px;font-weight:800;cursor:pointer}
.geo-btn:hover{background:#e2efff}
.geo-btn:focus-visible{outline:3px solid #256acf;outline-offset:2px}
.geo-btn.geo-selected{background:#174d97;border-color:#174d97;color:white}
@media(max-width:640px){.tl-geometry{padding:5px}.geo-actions{gap:6px;padding:7px}.geo-btn{min-width:44px}.geo-actions label{width:100%;justify-content:space-between}.geo-actions select{max-width:65%}}
@media print{.geo-actions{display:none!important}.tl-geometry{padding:0;background:white}}
/* Laboratoris de raonament, estadística i probabilitat 2.4 */
.tl-reasoning{width:100%;min-width:0;padding:10px 9px 7px;background:#edf5ff;border-radius:16px}
.rl-module{width:100%;min-width:0}
.rl-svg{display:block;width:100%;height:auto;aspect-ratio:640/420;border-radius:12px;background:#f6faff;touch-action:none;user-select:none;-webkit-user-select:none;outline-offset:3px}
.rl-svg:focus-visible{outline:3px solid #246fce}
.rl-hit{cursor:pointer;touch-action:none}
.rl-hit:focus-visible{outline:4px solid #2167c9;outline-offset:3px;stroke:#163f83!important;stroke-width:3px}
.rl-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:12px;padding:10px;background:#f9fbff;border:1px solid #c7dced;border-radius:12px;color:#1a395c}
.rl-controls label{display:inline-flex;gap:9px;align-items:center;font-size:14px;font-weight:700;flex-wrap:wrap}
.rl-controls select{background:white;color:#183c60;border:1px solid #9ab9d8;border-radius:9px;padding:8px;min-height:44px;font-size:16px}
.rl-controls input[type=range]{min-width:145px;accent-color:#2878ce}
.rl-label{font-size:13px;font-weight:700;color:#325272;flex-basis:100%}
.rl-btn{background:white;border:1.5px solid #9ebfe1;color:#183c60;border-radius:11px;min-height:44px;min-width:44px;padding:9px 13px;font:800 14px system-ui,sans-serif;cursor:pointer}
.rl-btn:hover{background:#e6f1ff}.rl-btn:focus-visible{outline:3px solid #246fce;outline-offset:2px}
@media(max-width:640px){.tl-reasoning{padding:5px}.rl-controls{gap:6px;padding:7px}.rl-controls label{width:100%;justify-content:space-between}.rl-btn{padding:8px 10px}.rl-controls select{max-width:70%}}
@media print{.rl-controls{display:none!important}.tl-reasoning{padding:0;background:#fff}}

/* 3.0 universal board invitation */
.tl-board-promo{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;margin:15px 0;background:linear-gradient(115deg,#e1f4ff,#eff5ff);border:1px solid #b4d9f1;border-radius:16px;color:#173a5e}
.tl-board-promo b{font-size:18px}.tl-board-promo p{margin:5px 0 0;font-size:13px;color:#486c8b}.tl-board-promo .btn{white-space:nowrap}
@media(max-width:650px){.tl-board-promo{flex-direction:column;align-items:start}.tl-board-promo .btn{width:100%}}
.dark .tl-board-promo{background:#244a68;color:#e4f5ff}.dark .tl-board-promo p{color:#d5ebff}

/* 3.1: Laboratoris de resolució de problemes */
.tl-problem{width:100%;min-width:0;padding:9px;background:#edf5ff;border-radius:16px}.pl-shell{color:#173d65;box-sizing:border-box}.pl-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px;min-height:53px;padding:10px}.pl-btn{min-height:44px;min-width:50px;padding:8px 13px;border-radius:11px;border:1px solid #97b8db;background:white;color:#13466c;cursor:pointer;font-weight:850;font-size:14px}.pl-btn:hover{background:#dbeeff}.pl-btn:focus-visible,.pl-scene:focus-visible{outline:3px solid #efb33a;outline-offset:2px}.pl-toolbar>span{font-weight:800}.pl-scene{display:block;width:100%;height:auto;aspect-ratio:640/420;background:#f8fbff;border:1px solid #bad1e9;border-radius:12px;touch-action:none;user-select:none;-webkit-user-select:none}.pl-grab{cursor:grab;touch-action:none}.pl-instruction{margin:10px 7px;font-size:13px;color:#335777}.dark .tl-problem{background:#204461}.dark .pl-instruction{color:#d8e9ff}.dark .pl-toolbar{color:#f0f8ff}@media(max-width:560px){.tl-problem{padding:4px}.pl-toolbar{gap:6px}.pl-btn{padding:8px 9px;min-width:44px}.pl-instruction{font-size:12px}}@media print{.pl-toolbar,.pl-instruction{display:none!important}.tl-problem{background:white;padding:0}}

/* 3.2 · Laboratoris d'espai i mesura */
.tl-spatial{width:100%;min-width:0;background:#edf5ff;padding:9px;border-radius:16px;box-sizing:border-box}
.sp-shell{min-width:0;width:100%;color:#1d4769}.sp-toolbar{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:7px;min-height:55px;padding:10px;background:#f2f8ff;border-radius:12px}
.sp-toolbar span,.sp-toolbar strong{font-size:14px;font-weight:800}.sp-btn{border:1.5px solid #9cbedf;background:white;color:#1b4e78;border-radius:11px;min-height:44px;min-width:44px;padding:8px 11px;cursor:pointer;font-size:14px;font-weight:800;touch-action:manipulation}
.sp-btn:hover{background:#dff0ff}.sp-btn:focus-visible,.sp-scene:focus-visible,.sp-tile:focus-visible{outline:3px solid #d98b20;outline-offset:3px}.sp-scene{display:block;width:100%;height:auto;aspect-ratio:640/420;border-radius:12px;border:1px solid #adc9e4;background:#f8fbff;touch-action:none;user-select:none;-webkit-user-select:none}
.sp-tile{cursor:pointer;touch-action:none}.sp-grab{cursor:grab;touch-action:none}.sp-grab:active{cursor:grabbing}.sp-description{font-size:13px;color:#335875;font-weight:650;text-align:center;line-height:1.5;padding:11px 4px}
.dark .tl-spatial{background:#24445d}.dark .sp-toolbar{background:#e4f2ff}.dark .sp-description{color:#eaf6ff}@media(max-width:600px){.tl-spatial{padding:4px}.sp-toolbar{gap:5px;padding:6px}.sp-btn{padding:7px 9px;font-size:13px}.sp-description{font-size:12px}}@media print{.sp-toolbar,.sp-description{display:none!important}.tl-spatial{background:white;padding:0}}
