:root{
  --bg:#f6f1e7;--paper:#fffdf8;--panel:#f2ece1;--ink:#102444;--muted:#6e6a63;
  --yellow:#ffd21f;--yellow2:#ffbd00;--red:#e53935;--green:#58a63c;--blue:#2d75d7;--violet:#7251b5;
  --line:#ded6c8;--shadow:0 10px 28px rgba(30,32,38,.10);--soft-shadow:0 4px 12px rgba(30,32,38,.08);
  --radius:22px;--radius-sm:15px;--control:48px;--safe-bottom:max(10px,env(safe-area-inset-bottom));
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;overscroll-behavior:none}
body{overflow:hidden;-webkit-tap-highlight-color:transparent}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:3px solid #111;outline-offset:3px}
.skip-link{position:fixed;left:10px;top:-60px;z-index:9999;background:#111;color:#fff;padding:10px 14px;border-radius:10px}.skip-link:focus{top:10px}
.app-shell{height:100dvh;display:grid;grid-template-rows:76px 1fr 76px;background:radial-gradient(circle at 8% 5%,#fff 0,#f7f3eb 38%,#f2ebdf 100%);position:relative}
.topbar{display:grid;grid-template-columns:120px minmax(0,1fr) auto;align-items:center;gap:18px;padding:10px clamp(14px,3vw,46px);border-bottom:1px solid rgba(180,170,156,.32);background:rgba(255,253,248,.88);backdrop-filter:blur(18px);z-index:50}
.brand-button{border:0;background:transparent;padding:0;display:flex;align-items:center;justify-content:flex-start;height:58px}.brand-button img{max-width:92px;max-height:58px;object-fit:contain;object-position:left center}
.topbar-center{min-width:0;display:flex;align-items:center;gap:12px}.app-search{height:46px;width:min(720px,100%);border:1px solid #ddd4c5;background:white;border-radius:14px;box-shadow:var(--soft-shadow);padding:0 16px 0 44px;background-image:radial-gradient(circle at 19px 50%,transparent 0 7px,#18304d 7px 8.5px,transparent 9px),linear-gradient(45deg,transparent 47%,#18304d 48% 55%,transparent 56%);background-size:34px 34px,13px 13px;background-repeat:no-repeat;background-position:2px center,27px 28px}
.topbar-actions{display:flex;align-items:center;gap:8px}.lang-switch{display:flex;background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}.lang-switch button{border:0;background:transparent;padding:10px 14px;min-height:42px}.lang-switch button.active{background:var(--yellow);font-weight:800}.icon-btn{border:1px solid var(--line);background:white;width:46px;height:46px;border-radius:14px;font-size:20px;box-shadow:var(--soft-shadow)}
main{overflow:auto;min-height:0;padding:18px clamp(16px,4vw,56px) 28px;scrollbar-width:thin}
.bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);align-items:center;background:rgba(255,253,248,.95);backdrop-filter:blur(18px);border-top:1px solid var(--line);padding:6px clamp(8px,5vw,90px) var(--safe-bottom);z-index:40}.bottom-nav button{height:58px;border:0;background:transparent;border-radius:16px;display:flex;align-items:center;justify-content:center;gap:9px;font-size:14px}.bottom-nav button span{font-size:23px}.bottom-nav button b{font-weight:650}.bottom-nav button.active{background:#fff8ce;color:#111}.bottom-nav button.active span{filter:saturate(1.3)}
.app-menu{position:fixed;inset:0;z-index:100;background:rgba(10,15,24,.25);display:grid;place-items:end}.app-menu[hidden]{display:none}.menu-sheet{width:min(430px,100%);height:100%;background:#fffdf8;padding:24px;border-left:1px solid var(--line);box-shadow:-18px 0 50px rgba(0,0,0,.18)}.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.sheet-head h2{margin:0}.menu-sheet>button{display:block;width:100%;text-align:left;border:0;background:#f6f1e7;border-radius:14px;padding:15px;margin:8px 0}.toggle-row{display:flex;align-items:center;justify-content:space-between;padding:14px 2px;border-bottom:1px solid #eee}.toggle-row input{width:24px;height:24px;accent-color:var(--yellow2)}.privacy-note{font-size:13px;color:var(--muted);line-height:1.5}.toast{position:fixed;left:50%;bottom:94px;transform:translate(-50%,20px);background:#101820;color:#fff;padding:10px 16px;border-radius:999px;opacity:0;pointer-events:none;transition:.2s;z-index:200}.toast.show{opacity:1;transform:translate(-50%,0)}

/* Shared */
.view{max-width:1500px;margin:0 auto}.page-title{margin:0 0 3px;font-size:clamp(28px,3vw,42px);letter-spacing:-.035em}.subtle{color:var(--muted)}.card{background:rgba(255,255,255,.86);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--soft-shadow)}.section-title{display:flex;justify-content:space-between;align-items:center;margin:20px 0 10px}.section-title h2{font-size:19px;margin:0}.section-title button{border:0;background:transparent;font-weight:700}.pill-row{display:flex;gap:9px;overflow-x:auto;padding:3px 2px 8px;scrollbar-width:none}.pill-row::-webkit-scrollbar{display:none}.pill{border:1px solid var(--line);background:#fff;padding:10px 15px;border-radius:13px;white-space:nowrap;box-shadow:0 2px 6px rgba(0,0,0,.04)}.pill.active{background:var(--yellow);border-color:#f2bd00;font-weight:800}.rainbow-bar{height:4px;width:180px;border-radius:5px;background:linear-gradient(90deg,#ee3d32,#ff8a00,#f0ce16,#55b951,#22a7df,#4256c9,#8f4cc9)}

/* Home */
.home-actions{display:grid;grid-template-columns:repeat(6,1fr);gap:12px}.action-tile{min-height:126px;border:1px solid var(--line);background:rgba(255,255,255,.86);border-radius:20px;box-shadow:var(--soft-shadow);display:grid;place-items:center;padding:14px;transition:transform .18s,box-shadow .18s}.action-tile:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.action-tile.primary{background:linear-gradient(145deg,#fff3af,#ffd21f);border-color:#efb900}.action-icon{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;font-size:38px}.action-tile b{font-size:17px}.view-switch{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;padding:8px;background:#ebe4d8;border-radius:16px;margin:14px 0 8px}.view-switch button{border:0;background:transparent;border-radius:12px;padding:11px}.view-switch button.active{background:var(--yellow)}
.home-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:22px;align-items:start}.continue-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.project-card{overflow:hidden;position:relative}.project-art{aspect-ratio:1.28;background:#fafafa;display:grid;place-items:center;overflow:hidden}.project-art svg{width:100%;height:100%}.project-meta{padding:10px 12px}.project-meta b{display:block}.project-meta small{color:var(--muted)}
.interest-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.interest-card{border:1px solid var(--line);background:#fff;border-radius:16px;min-height:104px;padding:8px;display:grid;place-items:center;text-align:center}.interest-card span{font-size:34px}.interest-card b{font-size:13px}.home-controls{margin-top:15px}.material-strip{padding:14px 16px;margin-top:10px}.material-tabs{display:flex;align-items:center;gap:14px;border-bottom:1px solid #e3dbce;padding-bottom:9px}.material-tabs b{margin-right:auto}.mini-materials{display:grid;grid-template-columns:repeat(5,1fr);gap:18px;padding-top:10px}.mini-group{min-width:0}.mini-group h4{font-size:12px;margin:0 0 8px}.mini-tools{display:flex;align-items:flex-end;gap:7px;height:76px}.crayon,.pencil,.marker-tool{position:relative;display:block;width:19px;height:62px;border-radius:6px 6px 3px 3px;background:var(--c,#e33);box-shadow:inset -3px 0 4px rgba(0,0,0,.15)}.crayon:before{content:"";position:absolute;left:2px;right:2px;top:-9px;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:10px solid var(--c,#e33)}.pencil{width:11px;height:66px;border-radius:2px;background:linear-gradient(90deg,#c78c3f 0 18%,var(--c) 19% 80%,#c78c3f 81%)}.pencil:before{content:"";position:absolute;top:-10px;left:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:11px solid #d8ad73}.marker-tool{width:22px;height:57px;border-radius:5px}.paint-dot{width:35px;height:35px;border-radius:50%;background:var(--c);border:3px solid white;box-shadow:0 0 0 1px #ccc inset,0 2px 4px #ccc}

/* Canvas views */
.canvas-layout{height:calc(100dvh - 190px);min-height:610px;display:grid;grid-template-rows:auto 1fr auto;gap:10px}.studio-bar{display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px}.studio-bar label{font-size:13px}.studio-bar select,.studio-bar button{height:42px;border:1px solid var(--line);background:white;border-radius:12px;padding:0 14px}.canvas-stage{position:relative;min-height:0;border:1px solid var(--line);border-radius:24px;background:white;overflow:hidden;box-shadow:var(--shadow);touch-action:none}.paint-canvas,.lineart-layer{position:absolute;inset:0;width:100%;height:100%;touch-action:none}.lineart-layer{pointer-events:none}.lineart-layer svg{display:block;width:100%;height:100%}.mobile-home-search{display:none;margin:0 0 10px;width:100%}.canvas-side-tools{position:absolute;right:12px;top:50%;transform:translateY(-50%);display:grid;gap:9px;z-index:8}.canvas-side-tools button{width:46px;height:46px;border-radius:50%;border:1px solid var(--line);background:white;box-shadow:var(--soft-shadow);font-size:20px}.fluid-controls{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);width:min(510px,80%);padding:10px 14px;background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:15px;backdrop-filter:blur(10px);display:grid;gap:8px;z-index:7}.range-row{display:grid;grid-template-columns:55px 1fr 45px;gap:10px;align-items:center;font-size:12px}.range-row input{width:100%;accent-color:#1478d4}.material-dock{background:#fff;border:1px solid var(--line);border-radius:18px;padding:8px 12px}.dock-tabs{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;border-bottom:1px solid #eee;padding-bottom:6px}.dock-tabs button{height:42px;border:0;background:transparent;border-radius:11px;font-size:13px}.dock-tabs button.active{background:var(--yellow)}.color-dock{display:flex;gap:9px;align-items:center;overflow-x:auto;padding:9px 2px 2px;scrollbar-width:none}.color-swatch{flex:0 0 auto;width:42px;height:42px;border-radius:50%;border:3px solid white;box-shadow:0 0 0 1px #cfc7b8,0 3px 8px rgba(0,0,0,.12);background:var(--swatch);position:relative}.color-swatch.selected{box-shadow:0 0 0 3px #111,0 3px 8px rgba(0,0,0,.15)}.color-swatch[aria-label*="glitter"]::after{content:"✦";position:absolute;color:white;inset:0;display:grid;place-items:center;text-shadow:0 1px 3px #000}

/* Locked color */
.locked-view{max-width:880px;margin:0 auto}.locked-head{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:10px}.locked-head h1{font-size:25px;margin:0}.locked-canvas-wrap{height:min(66dvh,800px);min-height:420px;position:relative;border:1px solid var(--line);border-radius:25px;background:#fff;box-shadow:var(--shadow);overflow:hidden;touch-action:none}.locked-toolbar{padding:12px;background:#f1ebdf;border:1px solid var(--line);border-radius:22px;margin-top:12px}.locked-mode-row{display:flex;gap:10px;justify-content:center;margin-bottom:10px}.locked-mode-row button{border:1px solid var(--line);background:white;border-radius:13px;padding:10px 14px}.locked-mode-row button.active{background:var(--yellow)}.locked-colors{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.locked-color{width:62px;height:76px;border:0;border-radius:11px;background:var(--swatch);box-shadow:inset -6px -6px 12px rgba(0,0,0,.15),0 4px 7px rgba(0,0,0,.10);position:relative}.locked-color.selected{outline:4px solid #111;outline-offset:3px}.locked-color::after{content:"🔒";position:absolute;bottom:6px;left:0;right:0;text-align:center;font-size:14px;filter:grayscale(1) brightness(4)}

/* Materials */
.materials-layout{display:grid;grid-template-columns:230px minmax(0,1fr);gap:18px}.material-sidebar{padding:15px;height:max-content;position:sticky;top:0}.material-sidebar h3{margin:0 0 10px}.filter-btn{width:100%;border:0;background:transparent;border-radius:10px;padding:9px 10px;text-align:left;display:flex;justify-content:space-between}.filter-btn.active{background:var(--yellow)}.material-main{min-width:0}.material-header{display:flex;align-items:baseline;gap:10px}.material-header h1{margin:0}.palette-section{margin:18px 0}.palette-section h3{margin:0 0 9px}.swatch-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:9px}.swatch-card{border:1px solid var(--line);background:#fff;border-radius:12px;overflow:hidden;text-align:left;padding:0;box-shadow:0 2px 8px rgba(0,0,0,.04)}.swatch-preview{height:62px;background:var(--swatch);position:relative}.swatch-preview.texture-crayon{background-image:repeating-linear-gradient(17deg,rgba(255,255,255,.12) 0 1px,transparent 1px 5px),linear-gradient(var(--swatch),var(--swatch))}.swatch-preview.texture-pencil{background-image:repeating-linear-gradient(-12deg,rgba(255,255,255,.18) 0 1px,transparent 1px 3px),linear-gradient(var(--swatch),var(--swatch))}.swatch-info{padding:7px 8px}.swatch-info b{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.swatch-info small{color:var(--muted);font-size:10px}.tray{position:sticky;bottom:0;background:rgba(255,253,248,.96);backdrop-filter:blur(16px);border:1px solid var(--line);border-radius:16px;padding:10px;margin-top:20px;box-shadow:0 -7px 20px rgba(30,32,38,.07)}.tray-head{display:flex;justify-content:space-between;align-items:center}.tray-colors{display:flex;gap:7px;overflow-x:auto;margin-top:8px}.tray-chip{width:64px;flex:0 0 64px}.tray-chip .swatch-preview{height:45px;border-radius:9px}.tray-chip small{display:block;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Trace */
.trace-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:16px}.trace-main{min-width:0}.trace-tabs{display:grid;grid-template-columns:repeat(7,1fr);gap:7px;padding:8px}.trace-tabs button{border:0;background:transparent;border-radius:12px;padding:12px 7px}.trace-tabs button.active{background:var(--yellow)}.trace-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;padding:18px}.trace-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:14px;box-shadow:var(--soft-shadow);position:relative}.trace-card h2{margin:0}.trace-art{height:360px;display:grid;place-items:center}.trace-art svg{max-width:90%;max-height:95%}.trace-footer{display:flex;justify-content:space-between;align-items:center}.trace-footer button{border:0;background:#f5efe4;border-radius:10px;padding:8px 10px}.trace-modes{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:13px}.trace-modes button{border:1px solid var(--line);background:#fff;border-radius:14px;padding:13px}.trace-modes button.active{background:var(--yellow)}.trace-side{padding:14px;height:max-content}.trace-side h3{margin:0 0 10px}.learner-btn,.skill-btn{width:100%;border:1px solid var(--line);background:white;border-radius:12px;padding:12px;text-align:left;margin-bottom:8px}.learner-btn.active,.skill-btn.active{background:#fff0a8;border-color:#efbd00}.trace-side .toggle-row{font-size:13px}

/* Calm */
.calm-layout{display:grid;grid-template-columns:230px minmax(0,1fr) 270px;gap:12px;min-height:650px}.scene-rail,.calm-tools{padding:12px}.scene-rail h3,.calm-tools h3{margin:0 0 10px}.scene-card{height:100px;border:2px solid transparent;border-radius:14px;overflow:hidden;margin-bottom:10px;position:relative;background:linear-gradient(135deg,#314d68,#86b7cf);color:white;display:flex;align-items:end;padding:10px;font-weight:800;text-shadow:0 1px 3px #000}.scene-card.active{border-color:var(--yellow)}.scene-card:nth-child(3){background:linear-gradient(#475968,#8192a0 45%,#362a22 46%,#594333)}.scene-card:nth-child(4){background:linear-gradient(135deg,#194627,#7ba45e)}.scene-card:nth-child(5){background:radial-gradient(circle at 60% 20%,#fff 0 1px,transparent 2px),linear-gradient(#07142c,#102d55)}.scene-card:nth-child(6){background:linear-gradient(#a8d6ea,#dbead9 48%,#7f9879 49%)}.mandala-stage{position:relative;background:#fff;border:1px solid var(--line);border-radius:22px;overflow:hidden;touch-action:none;box-shadow:var(--soft-shadow)}.mandala-stage canvas,.mandala-stage svg{position:absolute;inset:0;width:100%;height:100%}.mandala-stage svg{pointer-events:none}.symmetry-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.symmetry-grid button{aspect-ratio:1;border:1px solid var(--line);background:#fff;border-radius:14px;font-size:13px}.symmetry-grid button.active{background:#fff0a8;border:2px solid var(--yellow2)}.calm-option{display:block;width:100%;border:0;border-radius:11px;padding:11px;margin:7px 0;text-align:left}.calm-option:nth-of-type(1){background:#edf4dd}.calm-option:nth-of-type(2){background:#e1eff7}.calm-option:nth-of-type(3){background:#eee5f7}.calm-option:nth-of-type(4){background:#fff2c5}.calm-option:nth-of-type(5){background:#ffe0d2}.calm-palette{grid-column:1/-1;padding:9px 14px;display:flex;align-items:center;gap:9px;overflow-x:auto}.calm-palette .tool-pill{border:1px solid var(--line);background:white;border-radius:10px;padding:9px 12px}.calm-palette .tool-pill.active{background:var(--yellow)}

/* Settings states */
body.reduced-motion *,body.reduced-motion *::before,body.reduced-motion *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}body.high-contrast{--bg:#fff;--paper:#fff;--panel:#fff;--ink:#000;--muted:#333;--line:#000;--shadow:none;--soft-shadow:none}body.large-controls{--control:60px}body.large-controls button{min-height:52px}body.large-controls .bottom-nav button{height:64px}

@media(max-width:1050px){
  .topbar{grid-template-columns:90px minmax(0,1fr) auto;padding-inline:16px}.brand-button img{max-width:70px}.lang-switch button{padding:9px}.home-grid{grid-template-columns:1fr}.interest-grid{grid-template-columns:repeat(5,1fr)}.home-actions{grid-template-columns:repeat(3,1fr)}.materials-layout{grid-template-columns:190px 1fr}.swatch-grid{grid-template-columns:repeat(5,1fr)}.trace-layout{grid-template-columns:1fr}.trace-side{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.trace-side h3{grid-column:1/-1}.trace-side .toggle-row{grid-column:span 2}.calm-layout{grid-template-columns:175px 1fr 220px}.mini-materials{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:760px){
  .mobile-home-search{display:block}
  .app-shell{grid-template-rows:66px 1fr 70px}.topbar{grid-template-columns:58px minmax(0,1fr) auto;gap:8px;padding:7px 10px}.brand-button{height:48px}.brand-button img{max-width:52px;max-height:46px}.topbar-center .app-search{height:42px}.lang-switch button{padding:8px 9px}.lang-switch button:last-child{display:none}.topbar-actions .icon-btn{display:none}main{padding:10px 10px 18px}.bottom-nav{padding-inline:4px}.bottom-nav button{gap:3px;flex-direction:column;font-size:10px}.bottom-nav button span{font-size:19px}.home-actions{grid-template-columns:repeat(3,1fr);gap:7px}.action-tile{min-height:92px;padding:8px}.action-icon{width:40px;height:40px;font-size:28px}.action-tile b{font-size:13px}.view-switch{grid-template-columns:repeat(5,1fr);overflow-x:auto}.view-switch button{font-size:11px}.continue-grid{grid-template-columns:repeat(3,80%);overflow-x:auto}.interest-grid{grid-template-columns:repeat(5,86px);overflow-x:auto}.home-grid{gap:12px}.material-strip{display:none}.canvas-layout{height:calc(100dvh - 158px);min-height:0}.studio-bar{justify-content:flex-start;overflow-x:auto}.canvas-stage{border-radius:16px}.fluid-controls{width:88%;bottom:10px}.material-dock{border-radius:14px}.dock-tabs{grid-template-columns:repeat(6,100px);overflow-x:auto}.dock-tabs button{font-size:11px}.color-swatch{width:38px;height:38px}.locked-view{max-width:none}.locked-head h1{font-size:19px}.locked-canvas-wrap{height:59dvh;min-height:330px}.locked-color{width:44px;height:58px}.materials-layout{grid-template-columns:1fr}.material-sidebar{display:flex;overflow-x:auto;position:static;padding:8px}.material-sidebar h3,.material-sidebar hr{display:none}.filter-btn{min-width:max-content}.swatch-grid{grid-template-columns:repeat(3,1fr)}.swatch-preview{height:54px}.trace-tabs{grid-template-columns:repeat(7,105px);overflow-x:auto}.trace-cards{grid-template-columns:repeat(3,86%);overflow-x:auto;padding:10px}.trace-art{height:330px}.trace-side{grid-template-columns:repeat(2,1fr)}.trace-modes{grid-template-columns:repeat(2,1fr)}.calm-layout{grid-template-columns:1fr;min-height:calc(100dvh - 165px)}.scene-rail{display:none}.mandala-stage{min-height:55dvh}.calm-tools{display:grid;grid-template-columns:1fr 1fr;gap:8px}.calm-tools h3{grid-column:1/-1}.symmetry-grid{grid-column:1/-1}.calm-palette{grid-column:1}.page-title{font-size:28px}
}
@media(max-width:430px){.home-actions{grid-template-columns:repeat(2,1fr)}.interest-grid{grid-template-columns:repeat(5,78px)}.swatch-grid{grid-template-columns:repeat(2,1fr)}.trace-cards{grid-template-columns:repeat(3,92%)}.locked-canvas-wrap{height:56dvh}.lang-switch button{font-size:12px}.topbar-center{display:none}.topbar{grid-template-columns:60px 1fr auto}.topbar-actions{grid-column:3}.bottom-nav button b{font-size:9px}}
.explore-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:10px}.explore-card{min-height:126px;border:1px solid var(--line);padding:13px 9px;display:grid;grid-template-rows:42px auto auto;place-items:center;text-align:center;background:#fff}.explore-card span{font-size:31px}.explore-card b{font-size:13px}.explore-card small{font-size:10px;color:var(--muted)}.brush-size-control{height:42px;border:1px solid var(--line);background:white;border-radius:12px;padding:0 10px;display:flex;align-items:center;gap:6px;font-size:12px}.brush-size-control input{width:95px;accent-color:var(--yellow2)}
@media(max-width:1050px){.explore-grid{grid-template-columns:repeat(5,1fr)}}
@media(max-width:760px){.explore-grid{grid-template-columns:repeat(3,1fr)}.explore-card{min-height:112px}.brush-size-control input{width:70px}}
@media(max-width:430px){.explore-grid{grid-template-columns:repeat(2,1fr)}}

/* v2.2 preset + reference-first system */
.preset-section{margin-top:14px}.preset-strip,.studio-preset-strip{display:flex;gap:9px;overflow-x:auto;scrollbar-width:none;padding:3px 2px 9px}.preset-strip::-webkit-scrollbar,.studio-preset-strip::-webkit-scrollbar{display:none}.preset-card{flex:0 0 150px;min-height:86px;border:1px solid var(--line);padding:10px;text-align:left;display:grid;grid-template-columns:34px 1fr;grid-template-rows:auto auto;align-items:center;gap:2px 8px;background:#fff}.preset-card span{font-size:25px;grid-row:1/3}.preset-card b{font-size:12px;line-height:1.15}.preset-card small{font-size:10px;color:var(--muted)}.preset-card.active{border:2px solid var(--yellow2);background:#fff8ce}.studio-preset-strip{max-width:1500px;margin:0 auto 7px}.studio-preset-strip .preset-card{min-height:58px;flex-basis:130px;padding:7px}.studio-preset-strip .preset-card span{font-size:20px}
.empty-project{min-height:170px;padding:20px;display:grid;place-content:center;text-align:center;gap:7px;border-style:dashed}.empty-project small{color:var(--muted);line-height:1.4}.saved-project{padding:0;text-align:left;overflow:hidden;border:1px solid var(--line)}.saved-project .project-art img{width:100%;height:100%;object-fit:cover;display:block}
.provenance-banner{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;padding:13px 16px;margin:12px 0 16px;background:#fff9d8;border-color:#e8cf52}.provenance-banner b{white-space:nowrap}.provenance-banner span{font-size:12px;line-height:1.35;color:#4e4a40}.provenance-banner button{border:0;background:var(--yellow);padding:10px 13px;border-radius:11px;font-weight:750}
.blank-canvas-note{position:absolute;inset:20% 12%;display:grid;place-content:center;gap:10px;text-align:center;pointer-events:none;color:var(--muted)}.blank-canvas-note b{font-size:21px;color:var(--ink)}.blank-canvas-note button{pointer-events:auto;justify-self:center;border:0;background:var(--yellow);border-radius:12px;padding:10px 15px}.blank-canvas-note small{max-width:470px;line-height:1.45}
.media-callout{display:grid;grid-template-columns:auto 1fr;gap:13px;align-items:center;padding:12px 14px;margin:10px 0}.media-callout span{font-size:12px;color:var(--muted);line-height:1.4}
.dynamics-panel{position:absolute;right:18px;top:18px;width:min(330px,calc(100% - 36px));z-index:20;padding:14px;background:rgba(255,253,248,.97);backdrop-filter:blur(16px)}.dynamics-panel[hidden]{display:none}.dynamics-panel .sheet-head{margin-bottom:6px}.dynamics-panel .sheet-head button{border:1px solid var(--line);background:#fff;border-radius:9px;width:34px;height:34px}.dynamic-row{display:grid;grid-template-columns:130px 1fr;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid #eee}.dynamic-row span{font-size:12px;font-weight:700}.dynamic-row output{font-variant-numeric:tabular-nums;color:var(--muted);font-weight:500}.dynamic-row input{width:100%;accent-color:var(--yellow2)}
.reference-view{max-width:1600px}.reference-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.reference-head p{max-width:820px;margin-top:5px}.reference-actions{display:flex;gap:8px;flex-wrap:wrap}.reference-actions button:disabled{opacity:.45}.reference-layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:14px}.reference-meta{padding:14px;height:max-content;position:sticky;top:0}.reference-meta h3{margin:0 0 10px}.reference-meta label{display:grid;gap:5px;font-size:11px;font-weight:700;margin:10px 0}.reference-meta input,.reference-meta select,.reference-meta textarea{width:100%;border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px;font-weight:400;resize:vertical}.reference-status{margin-top:12px;border:1px solid #e2b3a9;background:#fff0ec;border-radius:12px;padding:10px;display:grid;gap:3px}.reference-status.verified{border-color:#a4c89a;background:#edf7e9}.reference-status small{font-size:10px;color:var(--muted)}.reference-work{padding:10px;min-width:0}.reference-mode-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:9px}.reference-mode-row button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 12px}.reference-mode-row button.active{background:var(--yellow);font-weight:800}.reference-mode-row label{display:flex;align-items:center;gap:7px;font-size:11px;margin-left:auto}.reference-mode-row input{accent-color:var(--yellow2)}.reference-mode-row select{border:1px solid var(--line);border-radius:10px;padding:8px;background:#fff}.reference-canvas-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;min-height:600px}.overlay-mode .reference-canvas-grid{grid-template-columns:1fr}.overlay-mode .reference-source-panel{display:none}.reference-source-panel,.reference-draw-stage{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:16px;background:#fff;min-width:0}.reference-source-panel img{width:100%;height:100%;object-fit:contain;background:#f2eee7}.reference-draw-stage{touch-action:none}.reference-draw-stage canvas{position:absolute;inset:0;width:100%;height:100%;z-index:2}.reference-overlay{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;z-index:1}.reference-empty{width:100%;height:100%;min-height:430px;border:0;background:linear-gradient(145deg,#fff,#f5f0e7);display:grid;place-content:center;text-align:center;gap:8px;padding:20px}.reference-empty span{font-size:48px}.reference-empty small{max-width:340px;color:var(--muted);line-height:1.4}.reference-color-row{display:flex;gap:7px;overflow-x:auto;padding:9px 2px 0}.reference-card-body{min-height:280px;display:grid;place-content:center;text-align:center;padding:20px;color:var(--muted)}.reference-card-body b{color:var(--ink);font-size:18px}.reference-card-body p{line-height:1.45}

@media(max-width:1050px){.reference-layout{grid-template-columns:220px minmax(0,1fr)}.reference-canvas-grid{min-height:520px}.provenance-banner{grid-template-columns:1fr}.provenance-banner b{white-space:normal}.reference-head{flex-direction:column}.reference-actions{width:100%}.preset-card{flex-basis:140px}}
@media(max-width:760px){.preset-section{margin-top:9px}.preset-card{flex-basis:128px;min-height:72px}.studio-preset-strip{margin-bottom:4px}.reference-layout{grid-template-columns:1fr}.reference-meta{position:static;display:grid;grid-template-columns:1fr 1fr;gap:0 10px}.reference-meta h3,.reference-status{grid-column:1/-1}.reference-canvas-grid{grid-template-columns:1fr;min-height:unset}.reference-source-panel,.reference-draw-stage{min-height:52dvh}.side-mode .reference-source-panel{min-height:40dvh}.reference-mode-row label{margin-left:0}.provenance-banner{font-size:12px}.media-callout{grid-template-columns:1fr}.dynamics-panel{right:8px;top:8px}.dynamic-row{grid-template-columns:110px 1fr}}
@media(max-width:430px){.reference-meta{grid-template-columns:1fr}.reference-status{grid-column:1}.reference-actions button{flex:1}.reference-source-panel,.reference-draw-stage{min-height:56dvh}.preset-card{flex-basis:118px}.preset-card span{font-size:21px}.preset-card b{font-size:11px}}
.select-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px;padding:12px 2px;border-bottom:1px solid #eee}.select-row select{max-width:175px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:8px}
body[data-handedness="left"] .canvas-side-tools{left:12px;right:auto}body[data-handedness="left"] .dynamics-panel{left:18px;right:auto}body[data-handedness="right"] .canvas-side-tools{right:12px;left:auto}
.canvas-layout{grid-template-rows:auto auto minmax(0,1fr) auto}.dock-tabs{grid-template-columns:repeat(8,minmax(105px,1fr));overflow-x:auto;scrollbar-width:none}.dock-tabs::-webkit-scrollbar{display:none}
@media(max-width:760px){.canvas-layout{height:calc(100dvh - 158px);grid-template-rows:auto auto minmax(0,1fr) auto}.dock-tabs{grid-template-columns:repeat(8,105px)}}
.ref-divider{width:1px;height:28px;background:var(--line);margin:0 2px}.reference-meta select#refTarget{font-size:12px}
.saved-reference-block{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}.saved-reference-block h3{font-size:13px}.saved-reference-list{display:grid;gap:6px}.saved-reference-item{width:100%;border:1px solid var(--line);background:#fff;border-radius:10px;padding:7px;display:grid;grid-template-columns:28px 1fr;align-items:center;text-align:left;gap:5px}.saved-reference-item>span:first-child{font-size:18px}.saved-reference-item b,.saved-reference-item small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.saved-reference-item b{font-size:10px}.saved-reference-item small{font-size:8px;color:var(--muted);margin-top:2px}

/* =========================================================
   v3 platform: lifecycle, responsive application shell, pro,
   art-fidget, STEM, profile and canvas-lock systems
   ========================================================= */
:root{--app-vh:100dvh;--app-vw:100vw;--ui-scale:1;--studio-gap:10px;--chrome-top:76px;--chrome-bottom:76px}
.app-shell{height:var(--app-vh,100dvh);min-height:0}
main{min-width:0}
.system-launches{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:8px;margin-top:12px;background:#eee8dc}.system-launches button{border:0;background:#fff;border-radius:14px;padding:12px 14px;display:grid;grid-template-columns:42px 1fr;grid-template-rows:auto auto;text-align:left;gap:1px 8px}.system-launches span{grid-row:1/3;font-size:28px;align-self:center}.system-launches b{font-size:13px}.system-launches small{font-size:10px;color:var(--muted)}
#platformMenuGroup>button{display:block;width:100%;text-align:left;border:0;background:#f6f1e7;border-radius:14px;padding:15px;margin:8px 0}

/* Portal + onboarding */
.entry-layer{position:fixed;inset:0;z-index:5000;overflow:auto;background:linear-gradient(135deg,#fffdf8 0,#f5efe4 60%,#ece5d9 100%);color:var(--ink);padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.portal-shell{min-height:100%;max-width:1500px;margin:auto;display:grid;grid-template-rows:auto 1fr auto auto;padding:24px clamp(18px,4vw,62px);gap:22px}.portal-head{display:flex;align-items:center;justify-content:space-between;gap:20px}.portal-brand{display:flex;align-items:center;gap:14px;color:inherit;text-decoration:none}.portal-brand img{width:84px;height:72px;object-fit:contain}.portal-brand span{display:grid}.portal-brand b{font-size:22px}.portal-brand small{color:var(--muted);font-size:12px}.portal-language{display:flex;border:1px solid var(--line);border-radius:12px;overflow:hidden}.portal-language button{border:0;background:white;padding:10px 14px}.portal-language button.active{background:var(--yellow);font-weight:800}.portal-hero{display:grid;grid-template-columns:1.05fr .95fr;gap:clamp(25px,5vw,75px);align-items:center}.portal-kicker,.eyebrow{font-size:11px;letter-spacing:.16em;font-weight:850;color:#5c554b}.portal-hero h1{font-size:clamp(42px,6vw,84px);line-height:.94;letter-spacing:-.055em;max-width:950px;margin:13px 0 20px}.portal-hero p{max-width:760px;font-size:clamp(16px,1.6vw,21px);line-height:1.55;color:#554f46}.portal-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}.portal-actions button,.portal-foot button{border:1px solid var(--line);background:#fff;border-radius:13px;padding:13px 18px;font-weight:750}.portal-actions .portal-primary{background:var(--yellow);border-color:#dba900}.portal-preview{border:1px solid #d9d0c3;background:#fff;border-radius:32px;padding:18px;box-shadow:0 30px 70px rgba(24,29,39,.13);transform:rotate(1deg)}.preview-canvas{height:min(46vh,430px);border-radius:22px;background:radial-gradient(circle at 20% 20%,#ffe56e 0 4%,transparent 5%),radial-gradient(circle at 72% 24%,#e95ca3 0 8%,transparent 9%),radial-gradient(circle at 47% 58%,#43a5e4 0 11%,transparent 12%),linear-gradient(145deg,#fff,#eee8dd);position:relative;overflow:hidden}.preview-canvas:before,.preview-canvas:after{content:"";position:absolute;border-radius:50%;border:30px solid #7251b5aa;width:230px;height:230px;left:18%;top:18%;filter:blur(2px)}.preview-canvas:after{border-color:#49a95c99;width:320px;height:130px;left:40%;top:50%;transform:rotate(-23deg)}.preview-canvas i{position:absolute;width:130%;height:16px;border-radius:999px;background:linear-gradient(90deg,#e53935,#f57c00,#ffd21f,#55a63d,#2f75d7,#7251b5);left:-15%;top:48%;transform:rotate(-14deg);opacity:.85}.preview-canvas i:nth-child(2){top:56%;transform:rotate(9deg);opacity:.45}.preview-canvas i:nth-child(3){top:33%;transform:rotate(28deg);opacity:.35}.preview-canvas i:nth-child(4){top:68%;transform:rotate(-32deg);opacity:.3}.preview-canvas span{position:absolute;right:20px;bottom:15px;font-size:62px}.preview-palette{display:flex;gap:8px;padding:14px 5px 2px;overflow:hidden}.preview-palette i{height:54px;flex:1;border-radius:13px 13px 5px 5px;background:var(--c);box-shadow:inset 0 -9px 15px rgba(0,0,0,.13)}.portal-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.portal-grid article{background:#fff;border:1px solid var(--line);border-radius:18px;padding:17px}.portal-grid article span{font-size:29px}.portal-grid article b{display:block;margin:9px 0 4px}.portal-grid article p{font-size:12px;line-height:1.45;color:var(--muted);margin:0}.portal-foot{display:flex;justify-content:space-between;align-items:center;padding-top:12px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.onboarding-layer{display:grid;place-items:center;padding:18px}.onboard-shell{width:min(900px,100%);max-height:min(860px,calc(var(--app-vh) - 30px));overflow:auto;background:#fffdf8;border:1px solid var(--line);border-radius:28px;box-shadow:0 30px 100px rgba(16,24,40,.2);display:grid;grid-template-rows:auto auto 1fr auto}.onboard-shell>header{display:flex;align-items:center;gap:12px;padding:18px 22px}.onboard-shell>header img{width:56px;height:50px;object-fit:contain}.onboard-shell>header div{display:grid}.onboard-shell>header b{font-size:17px}.onboard-shell>header small{color:var(--muted)}.onboard-shell>header button{margin-left:auto;border:0;background:#eee7da;border-radius:50%;width:38px;height:38px;font-size:21px}.onboard-progress{height:4px;background:#e8e1d5}.onboard-progress i{display:block;height:100%;background:linear-gradient(90deg,#e53935,#ffd21f,#55a63d,#2f75d7,#7251b5);transition:width .2s}.onboard-shell>main{padding:28px clamp(20px,5vw,54px);overflow:auto}.onboard-shell h1{font-size:clamp(28px,4vw,46px);letter-spacing:-.04em;margin:0 0 8px}.onboard-shell>footer{display:flex;justify-content:space-between;gap:10px;padding:16px 22px;border-top:1px solid var(--line)}.onboard-shell>footer button{border:1px solid var(--line);background:white;padding:12px 18px;border-radius:12px}.onboard-shell>footer .primary,.pin-card .primary,.setting-actions .primary{background:var(--yellow);font-weight:800}.field,.support-grid>label,.setting-panel>label,.stem-controls label{display:grid;gap:7px;font-size:12px;font-weight:700;margin:12px 0}.field input,.support-grid select,.setting-panel select,.setting-panel input:not([type=checkbox]),.stem-controls input{border:1px solid var(--line);border-radius:11px;background:#fff;padding:11px;min-height:44px}.choice-cards{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:18px}.choice-cards button{border:1px solid var(--line);border-radius:16px;background:#fff;padding:16px;text-align:left;display:grid;gap:4px}.choice-cards button.selected,.interest-choices button.selected{border:2px solid #d6a800;background:#fff8c9}.choice-cards small{color:var(--muted)}.level-cards{grid-template-columns:repeat(5,1fr)}.interest-choices{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-top:18px}.interest-choices button{border:1px solid var(--line);background:#fff;border-radius:12px;padding:12px 8px}.support-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:2px 18px}.switch{display:flex!important;align-items:center;justify-content:space-between;border-bottom:1px solid #ece6da;padding:11px 0}.switch input{width:24px;height:24px;accent-color:var(--yellow2)}.ready-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}.ready-grid article{border:1px solid var(--line);background:#fff;border-radius:15px;padding:16px;display:grid;gap:4px}.ready-grid span{font-size:11px;color:var(--muted)}

/* Canvas lock */
body.canvas-locked .topbar,body.canvas-locked .bottom-nav{display:none!important}body.canvas-locked .app-shell{grid-template-rows:1fr!important}body.canvas-locked main{padding:0!important}body.canvas-locked .canvas-layout,body.canvas-locked .locked-view,body.canvas-locked .play-view,body.canvas-locked .pro-workspace{height:var(--app-vh)!important;max-width:none!important;margin:0!important;border-radius:0!important}body.canvas-locked .canvas-stage,body.canvas-locked .locked-canvas-wrap,body.canvas-locked .stim-stage,body.canvas-locked .pro-stage{border-radius:0!important;border:0!important}.canvas-lock-bar{position:fixed;z-index:9000;right:max(10px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));display:flex;align-items:center;gap:8px;background:rgba(16,24,32,.88);color:#fff;border-radius:999px;padding:6px 7px 6px 12px;backdrop-filter:blur(14px);font-size:11px}.canvas-lock-bar button{position:relative;overflow:hidden;border:0;border-radius:999px;background:#fff;color:#111;padding:9px 13px}.canvas-lock-bar button:before{content:"";position:absolute;inset:0 auto 0 0;width:0;background:#ffd21f88;transition:none}.canvas-lock-bar button.holding:before{width:100%;transition:width 1.4s linear}.pin-dialog{position:fixed;z-index:9500;inset:0;background:rgba(6,12,20,.45);display:grid;place-items:center;padding:16px}.pin-card,.profile-switch-card{width:min(420px,100%);background:#fffdf8;border-radius:22px;padding:22px;box-shadow:0 30px 80px rgba(0,0,0,.3)}.pin-card input{width:100%;height:52px;border:1px solid var(--line);border-radius:12px;font-size:24px;text-align:center;letter-spacing:.25em}.pin-card>div{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}.pin-card button,.profile-switch-card button{border:1px solid var(--line);background:#fff;border-radius:11px;padding:11px 14px}.profile-switch-card{display:grid;gap:8px}.profile-switch-card>button[data-profile]{display:grid;text-align:left}.profile-switch-card small{color:var(--muted)}

/* Pro studio */
.pro-workspace{height:calc(var(--app-vh) - var(--chrome-top) - var(--chrome-bottom) - 34px);max-width:1900px;margin:auto;display:grid;grid-template-columns:70px minmax(0,1fr) 310px;gap:9px;min-height:520px}.pro-toolbar,.pro-options,.pro-inspector .card{background:#fffdf9;border:1px solid var(--line);box-shadow:var(--soft-shadow)}.pro-toolbar{border-radius:18px;padding:7px;display:flex;flex-direction:column;gap:5px;overflow:auto}.pro-toolbar button{border:0;background:transparent;border-radius:10px;min-height:48px;display:grid;place-items:center;font-size:20px}.pro-toolbar button span{font-size:8px}.pro-toolbar button.active{background:var(--yellow)}.pro-center{min-width:0;display:grid;grid-template-rows:auto 1fr;gap:7px}.pro-options{min-height:52px;border-radius:14px;padding:6px 9px;display:flex;align-items:center;gap:8px;overflow-x:auto;white-space:nowrap}.pro-options select,.pro-options button{height:38px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:0 10px}.pro-options label{display:flex;align-items:center;gap:5px;font-size:10px}.pro-options input[type=range]{width:100px}.pro-options input[type=color]{width:42px;height:38px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:3px}.pro-stage{position:relative;overflow:auto;min-height:0;background:#cfcac0;border:1px solid #bbb3a7;border-radius:16px;display:grid;place-items:center;touch-action:none}.pro-stage.show-grid{background-image:linear-gradient(#aa9 1px,transparent 1px),linear-gradient(90deg,#aa9 1px,transparent 1px);background-size:20px 20px}.pro-stack{position:relative;width:100%;height:100%;min-height:420px;background:#fff;transform-origin:center center;box-shadow:0 4px 16px #0002}.pro-layer-canvas,.pro-vector,.pro-overlay{position:absolute;inset:0;width:100%;height:100%}.pro-layer-canvas{touch-action:none}.pro-vector{z-index:20;pointer-events:none}.pro-overlay{z-index:30;pointer-events:none;touch-action:none}.selection-actions{position:absolute;z-index:40;left:50%;bottom:12px;transform:translateX(-50%);display:flex;gap:6px;background:#fff;padding:6px;border-radius:12px;box-shadow:var(--shadow)}.selection-actions[hidden]{display:none}.selection-actions button{border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px}.pro-inspector{min-width:0;display:grid;align-content:start;gap:8px;overflow:auto}.pro-inspector .card{border-radius:16px;padding:12px}.pro-inspector header{display:flex;align-items:center;justify-content:space-between}.pro-inspector header h3,.pro-inspector h3{margin:0 0 9px}.pro-inspector header button{border:1px solid var(--line);background:#fff;border-radius:8px;width:32px;height:32px}.pro-layers{display:grid;gap:5px}.pro-layer{display:grid;grid-template-columns:28px minmax(0,1fr) 78px 68px;gap:4px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:4px;background:#fff}.pro-layer.active{border-color:#e0ad00;background:#fff9d4}.pro-layer button{border:0;background:transparent}.pro-layer button[data-act]{display:flex;align-items:center;gap:5px;text-align:left;min-width:0}.layer-thumb{width:26px;height:24px;border:1px solid #ddd;background:linear-gradient(45deg,#eee 25%,#fff 25% 50%,#eee 50% 75%,#fff 75%);background-size:10px 10px}.pro-layer b{font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pro-layer select{width:78px;font-size:8px}.pro-layer input{width:64px}.pro-inspector label{display:grid;gap:5px;font-size:10px;margin:9px 0}.pro-inspector input[type=range]{width:100%}.file-button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:10px;display:block!important;cursor:pointer}.file-button input{display:none}

/* Art fidget */
.play-view{height:calc(var(--app-vh) - var(--chrome-top) - var(--chrome-bottom) - 34px);max-width:1600px;margin:auto;display:grid;grid-template-rows:auto 1fr;gap:10px;min-height:500px}.play-head{display:flex;justify-content:space-between;align-items:end;gap:20px}.play-head h1,.stem-view h1,.settings-title h1{font-size:clamp(28px,4vw,52px);letter-spacing:-.045em;margin:4px 0}.play-head p,.stem-view header p,.settings-title p{margin:0;color:var(--muted);max-width:780px}.play-head button{border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px}.play-layout{display:grid;grid-template-columns:230px 1fr;gap:9px;min-height:0}.play-controls{padding:10px;overflow:auto}.play-controls h3{font-size:12px;margin:10px 4px 7px}.play-controls>button{width:100%;border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px;margin:3px 0;display:flex;align-items:center;gap:10px;text-align:left}.play-controls>button span{font-size:22px}.play-controls>button.active{background:#fff7c4;border-color:#dfb000}.range-stack{display:grid;gap:6px;font-size:10px;padding:7px 3px}.range-stack input{width:100%}.stim-stage{position:relative;overflow:hidden;border-radius:22px;border:1px solid var(--line);background:radial-gradient(circle at center,#fff 0,#f7f2e9 68%,#ece5d8 100%);touch-action:none;min-height:0}.stim-stage canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}.stim-colors{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);max-width:92%;display:flex;gap:5px;background:#fffdf8dd;padding:6px;border-radius:999px;overflow-x:auto;backdrop-filter:blur(12px)}.stim-colors button{flex:0 0 34px;width:34px;height:34px;border:3px solid #fff;border-radius:50%;background:var(--c);box-shadow:0 0 0 1px #aaa}.stim-colors button.active{outline:3px solid #111}.visual-schedule{position:absolute;z-index:5;left:10px;top:10px;display:flex;gap:4px;background:#fffdf8e8;padding:5px;border-radius:10px}.visual-schedule[hidden]{display:none}.visual-schedule span{padding:5px 7px;border-radius:7px;font-size:7px;color:var(--muted)}.visual-schedule span b{font-size:9px;color:var(--ink)}.visual-schedule span.active{background:var(--yellow)}

/* STEM */
.stem-view{max-width:1550px;margin:auto}.stem-tabs{display:flex;gap:7px;overflow-x:auto;margin:14px 0}.stem-tabs button{flex:1;min-width:130px;border:1px solid var(--line);background:#fff;border-radius:13px;padding:10px;display:flex;align-items:center;justify-content:center;gap:7px}.stem-tabs button span{font-size:22px}.stem-tabs button.active{background:var(--yellow);border-color:#d8a900;font-weight:800}.stem-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:10px;height:min(62vh,680px);min-height:430px}.stem-stage{padding:8px;min-height:0}.stem-stage canvas{width:100%;height:100%;display:block;border-radius:14px;background:#fff}.stem-controls{padding:16px;overflow:auto}.stem-controls h3{font-size:20px;margin:0 0 15px}.stem-controls label{margin:13px 0}.stem-controls label input{width:100%;padding:0}.stem-controls p{font-size:12px;line-height:1.5;color:var(--muted)}.stem-note{margin-top:10px;padding:12px 15px;display:grid;grid-template-columns:auto 1fr;gap:12px}.stem-note span{font-size:11px;color:var(--muted);line-height:1.4}

/* Settings */
.settings-view{max-width:1500px;margin:auto}.settings-title{display:flex;justify-content:space-between;align-items:end;gap:20px}.settings-title button{border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px}.settings-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}.setting-panel{padding:16px}.setting-panel h2{font-size:17px;margin:0 0 13px}.profile-summary{display:flex;align-items:center;gap:11px;padding:10px;background:#f5efe5;border-radius:14px}.profile-avatar{width:46px;height:46px;border-radius:50%;background:var(--yellow);display:grid;place-items:center;font-size:20px;font-weight:900}.profile-summary div{display:grid}.profile-summary small{color:var(--muted)}.setting-actions{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.setting-actions button,.workspace-buttons button{border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px 10px;font-size:11px}.storage-meter{background:#f3eee5;border-radius:12px;padding:12px;display:grid;gap:4px;font-size:12px}.storage-meter span{font-size:10px;color:var(--muted)}.device-panel dl{display:grid;grid-template-columns:1fr auto;gap:7px 12px;font-size:11px}.device-panel dt{color:var(--muted)}.device-panel dd{margin:0;font-weight:700}.workspace-buttons{display:grid;grid-template-columns:repeat(2,1fr);gap:7px}

/* Choice-limiting support: hide only discovery extras, never core actions */
body[data-choice-limit="6"] .interest-grid>.interest-card:nth-child(n+7),body[data-choice-limit="6"] .preset-strip>.preset-card:nth-child(n+7){display:none}body[data-choice-limit="9"] .interest-grid>.interest-card:nth-child(n+10),body[data-choice-limit="9"] .preset-strip>.preset-card:nth-child(n+10){display:none}body[data-choice-limit="12"] .interest-grid>.interest-card:nth-child(n+13){display:none}

/* Display classes */
body[data-formfactor="desktop"] .view{max-width:1700px}body[data-formfactor="desktop"] .canvas-layout{height:calc(var(--app-vh) - 174px)}body[data-formfactor="desktop"] .canvas-stage{min-height:480px}
body[data-formfactor="tablet"] .app-shell{grid-template-rows:70px 1fr 70px;--chrome-top:70px;--chrome-bottom:70px}body[data-formfactor="tablet"] main{padding:12px 16px 18px}body[data-formfactor="tablet"] .canvas-layout{height:calc(var(--app-vh) - 160px);min-height:0}body[data-formfactor="tablet"] .action-tile{min-height:108px}
body[data-formfactor="phone"] .app-shell{grid-template-rows:58px 1fr 64px;--chrome-top:58px;--chrome-bottom:64px}body[data-formfactor="phone"] .topbar{padding:5px 9px;grid-template-columns:48px minmax(0,1fr) auto;gap:7px}.brand-button img{max-width:70px}.app-menu .menu-sheet{overflow:auto;padding:16px}.bottom-nav{padding:3px 3px var(--safe-bottom)}body[data-formfactor="phone"] main{padding:8px 8px 12px}.bottom-nav button{height:50px;gap:2px;flex-direction:column}.bottom-nav button span{font-size:19px}.bottom-nav button b{font-size:9px}.canvas-layout{height:calc(var(--app-vh) - 132px);min-height:0;grid-template-rows:auto minmax(0,1fr) auto}.studio-preset-strip{display:none}.studio-bar{justify-content:flex-start;overflow-x:auto;min-height:42px}.studio-bar>*{flex:0 0 auto}.studio-bar label:first-child{display:none}.material-dock{padding:5px}.fluid-controls{bottom:8px;width:92%;padding:7px}.canvas-side-tools{top:12px;right:8px;transform:none;grid-auto-flow:column}.canvas-side-tools button{width:40px;height:40px}.home-actions{grid-template-columns:repeat(3,1fr);gap:6px}.action-tile{min-height:82px;border-radius:15px;padding:7px}.action-icon{font-size:26px;width:38px;height:38px}.action-tile b{font-size:11px}.system-launches{grid-template-columns:1fr}.view-switch{grid-template-columns:repeat(5,86px);overflow:auto}.home-grid{grid-template-columns:1fr}.continue-grid{grid-template-columns:repeat(3,80%);overflow-x:auto}.interest-grid{display:flex;overflow-x:auto}.interest-card{flex:0 0 82px;min-height:88px}.material-strip{display:none}.portal-hero{grid-template-columns:1fr}.portal-preview{display:none}.portal-grid{grid-template-columns:1fr 1fr}.portal-shell{padding:16px}.portal-brand img{width:55px;height:48px}.portal-brand b{font-size:16px}.portal-brand small{display:none}.portal-hero h1{font-size:39px}.portal-hero p{font-size:15px}.portal-foot{align-items:flex-start;gap:10px}.level-cards{grid-template-columns:1fr}.choice-cards,.support-grid,.ready-grid{grid-template-columns:1fr}.interest-choices{grid-template-columns:repeat(2,1fr)}.onboard-shell{max-height:calc(var(--app-vh) - 10px);border-radius:18px}.onboard-shell>main{padding:20px 16px}.pro-workspace{height:calc(var(--app-vh) - 132px);grid-template-columns:52px minmax(0,1fr);gap:5px}.pro-inspector{display:none}.pro-toolbar{border-radius:12px;padding:4px}.pro-toolbar button{min-height:42px}.pro-options{border-radius:10px}.pro-options label:nth-of-type(n+2){display:none}.pro-stack{min-height:320px}.play-view{height:calc(var(--app-vh) - 132px);grid-template-rows:auto 1fr}.play-head p{display:none}.play-layout{grid-template-columns:1fr}.play-controls{display:flex;overflow-x:auto;padding:5px}.play-controls h3,.play-controls .range-stack,.play-controls .switch{display:none}.play-controls>button{flex:0 0 92px;margin:0 3px;display:grid;place-items:center;text-align:center}.stim-stage{min-height:0}.stem-layout{grid-template-columns:1fr;height:auto;min-height:0}.stem-stage{height:44vh}.stem-controls{max-height:28vh}.stem-note{grid-template-columns:1fr}.settings-title{align-items:start}.settings-grid{grid-template-columns:1fr}.settings-title p{display:none}}

@media(max-width:1050px) and (min-width:561px){.portal-grid{grid-template-columns:repeat(2,1fr)}.level-cards{grid-template-columns:repeat(2,1fr)}.interest-choices{grid-template-columns:repeat(3,1fr)}.settings-grid{grid-template-columns:repeat(2,1fr)}.pro-workspace{grid-template-columns:62px minmax(0,1fr) 250px}.pro-layer{grid-template-columns:24px minmax(0,1fr)}.pro-layer select,.pro-layer input{display:none}.stem-layout{grid-template-columns:minmax(0,1fr) 260px}}
@media(max-height:650px) and (orientation:landscape){body[data-formfactor="phone"] .topbar{display:none}body[data-formfactor="phone"] .app-shell{grid-template-rows:1fr 54px;--chrome-top:0px;--chrome-bottom:54px}body[data-formfactor="phone"] .canvas-layout,body[data-formfactor="phone"] .play-view,body[data-formfactor="phone"] .pro-workspace{height:calc(var(--app-vh) - 60px)}.play-head,.stem-view>header{display:none}.stem-layout{height:calc(var(--app-vh) - 120px);grid-template-columns:1fr 260px}.stem-stage{height:auto}.portal-head{position:sticky;top:0;background:#fffdf8ee;z-index:2}}
@media(min-width:1600px){:root{--control:52px}.topbar{grid-template-columns:150px minmax(0,1fr) auto}.brand-button img{max-width:110px}.pro-workspace{grid-template-columns:78px minmax(0,1fr) 360px}.pro-stack{min-height:650px}.play-layout{grid-template-columns:270px 1fr}.settings-grid{grid-template-columns:repeat(3,1fr)}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}
@media(forced-colors:active){.portal-primary,.pill.active,.action-tile.primary,.preset-card.active,.stem-tabs button.active,.pro-toolbar button.active{forced-color-adjust:auto;border:2px solid ButtonText}.preview-canvas,.portal-preview{display:none}.color-swatch,.stim-colors button{forced-color-adjust:none}}

/* v3 profile-aware home continuation */
.profile-home-strip{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:center;padding:13px 15px;margin:14px 0;background:linear-gradient(100deg,rgba(255,255,255,.94),rgba(255,247,200,.8))}
.profile-home-strip>div:first-child{display:flex;align-items:center;gap:10px;min-width:0}.profile-home-strip>div:first-child span:last-child{display:grid;min-width:0}.profile-home-strip small{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.profile-avatar.small{width:40px;height:40px;font-size:16px;flex:0 0 40px}.profile-track{display:flex;gap:8px;overflow:auto;scrollbar-width:none;padding:2px}.profile-track::-webkit-scrollbar{display:none}.profile-track button,.profile-home-strip>[data-profile-settings]{border:1px solid var(--line);background:#fff;border-radius:999px;padding:9px 12px;white-space:nowrap}.profile-home-strip>[data-profile-settings]{font-weight:750}
@media(max-width:720px){.profile-home-strip{grid-template-columns:1fr auto}.profile-track{grid-column:1/-1;grid-row:2}.profile-home-strip>[data-profile-settings]{grid-column:2;grid-row:1}.profile-home-strip small{max-width:190px}}
.stim-stage[data-tone="dark"]{background:radial-gradient(circle at center,#28303a 0,#161d25 72%,#0d1218 100%)}
.stim-stage[data-tone="black"]{background:#000}
.play-controls select{width:100%;height:38px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:0 8px}

/* v3.2 bounded Studio viewport: document pixels are independent of viewport pixels. */
.pro-stage{overflow:hidden!important;contain:layout paint size;isolation:isolate;position:relative;overscroll-behavior:contain;min-width:0;min-height:0}
.pro-stage:focus-within{outline:2px solid color-mix(in srgb,var(--yellow) 72%,#111);outline-offset:-2px}
.pro-bezel-safe{position:absolute;inset:8px;border:1px dashed rgba(17,24,39,.16);border-radius:12px;pointer-events:none;z-index:1}
.pro-stack{position:absolute!important;left:50%;top:50%;width:1600px;height:1200px;min-width:0!important;min-height:0!important;max-width:none;max-height:none;transform:translate(-50%,-50%);transform-origin:center center;will-change:transform;overflow:hidden;z-index:2;background:#fff;box-shadow:0 8px 30px #0003}
.pro-stage.is-panning{cursor:grab}.pro-stage.is-panning:active{cursor:grabbing}
.pro-layer-canvas,.pro-vector,.pro-overlay{width:100%!important;height:100%!important;display:block}
.pro-doc-info{font:700 12px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;background:#f4efe5;border-radius:9px;padding:8px;margin:0 0 8px;overflow-wrap:anywhere}
body[data-formfactor="phone"] .pro-bezel-safe{inset:4px}.canvas-locked .pro-bezel-safe{display:none}

/* v3.2 C.R.E.A.T.E. platform environments */
.create-environment-shelf{margin:18px 0 10px}.create-environment-shelf>.section-title{align-items:flex-end}.create-environment-shelf .eyebrow,.create-hub-head .eyebrow{display:block;font-size:10px;font-weight:850;letter-spacing:.12em;color:#746b5c;margin-bottom:4px}.create-environment-shelf h2{margin:0;font-size:22px}
.create-env-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.create-env-card{min-width:0;border:1px solid var(--line);background:rgba(255,255,255,.9);border-radius:17px;padding:13px;text-align:left;display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;box-shadow:var(--soft-shadow)}.create-env-card>span{width:42px;height:42px;border-radius:13px;background:#fff4ae;display:grid;place-items:center;font-size:21px;font-weight:900}.create-env-card>div{min-width:0;display:grid;gap:2px}.create-env-card b{font-size:14px}.create-env-card small{font-size:10px;color:#665f54}.create-env-card p{font-size:10px;line-height:1.35;color:var(--muted);margin:3px 0 0}.create-env-card:hover{border-color:#d0a800;box-shadow:var(--shadow)}
.create-hub-view{max-width:1540px;margin:0 auto}.create-hub-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:4px 0 18px}.create-hub-head>div:first-child{max-width:900px}.create-hub-head h1{font-size:clamp(32px,4vw,58px);line-height:.98;letter-spacing:-.045em;margin:0 0 10px}.create-hub-head p{color:var(--muted);line-height:1.55;margin:0;max-width:900px}.create-hub-head>button,.guide-actions button{border:1px solid var(--line);background:#fff;border-radius:13px;padding:12px 16px}.create-hub-head>button.primary{background:var(--yellow);border-color:#d6ab00;font-weight:800}
.studio-mode-grid,.kids-path-grid,.motion-cards,.lab-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.studio-mode-grid>button,.kids-path-grid>button,.motion-cards>button,.lab-grid>button{min-height:150px;border:1px solid var(--line);background:#fff;border-radius:20px;padding:18px;text-align:left;display:grid;align-content:start;gap:7px;box-shadow:var(--soft-shadow)}.studio-mode-grid>button span,.kids-path-grid>button span,.motion-cards>button span,.lab-grid>button span{font-size:30px;font-weight:850}.studio-mode-grid>button b,.kids-path-grid>button b,.motion-cards>button b,.lab-grid>button b{font-size:18px}.studio-mode-grid>button small,.kids-path-grid>button small,.motion-cards>button small,.lab-grid>button small{color:var(--muted);line-height:1.4}.workspace-principle,.child-design-note,.learn-principle{margin-top:12px;padding:15px 17px;display:grid;grid-template-columns:auto 1fr;gap:12px}.workspace-principle p,.child-design-note p,.learn-principle p{margin:0;color:var(--muted);line-height:1.45}.safety-badge{background:#e8f5df;border:1px solid #afd19e;padding:10px 13px;border-radius:999px;font-size:11px;font-weight:750;max-width:260px}
.learn-mode-switch{display:flex;background:#ece5d9;padding:4px;border-radius:12px}.learn-mode-switch button{border:0;background:transparent;border-radius:9px;padding:9px 12px}.learn-mode-switch button.active{background:var(--yellow);font-weight:800}.learn-track-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.learn-track{border:1px solid var(--line);background:#fff;border-radius:16px;padding:13px;display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:11px;align-items:center}.learn-track>span{width:42px;height:42px;border-radius:12px;background:#f4eee3;display:grid;place-items:center;font-weight:850}.learn-track b{font-size:14px}.learn-track p{font-size:11px;color:var(--muted);margin:3px 0 0;line-height:1.35}.learn-track button{border:1px solid var(--line);background:#fff8cb;border-radius:10px;padding:9px 11px;font-size:11px;font-weight:750}.guide-card{padding:22px;display:grid;grid-template-columns:60px minmax(0,1fr);gap:18px;align-items:start}.guide-card>span{width:60px;height:60px;border-radius:18px;background:var(--yellow);display:grid;place-items:center;font-size:30px;font-weight:900}.guide-card ul{padding-left:20px;line-height:1.7;color:var(--muted)}.guide-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}

/* onboarding role + avatar */
.onboard-subhead{font-size:17px;margin:20px 0 10px}.onboard-avatar-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:7px}.onboard-avatar-grid button{min-height:54px;border:1px solid var(--line);background:#fff;border-radius:13px;font-size:22px}.onboard-avatar-grid button.selected{background:#fff4ae;border-color:#d6aa00;box-shadow:0 0 0 2px #ffd21f55}.onboard-avatar-colors{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.onboard-avatar-colors button{width:34px;height:34px;border-radius:50%;border:3px solid #fff;background:var(--c);box-shadow:0 0 0 1px #bbb}.onboard-avatar-colors button.selected{box-shadow:0 0 0 3px #111}

@media(max-width:980px){.create-env-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.studio-mode-grid,.kids-path-grid,.motion-cards,.lab-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.learn-track-grid{grid-template-columns:1fr}}
@media(max-width:600px){.create-env-grid{display:flex;overflow-x:auto;padding-bottom:4px;scroll-snap-type:x proximity}.create-env-card{flex:0 0 82%;scroll-snap-align:start}.create-env-card p{display:none}.create-hub-head{align-items:flex-start;flex-direction:column;gap:10px}.create-hub-head h1{font-size:34px}.create-hub-head p{font-size:13px}.studio-mode-grid,.kids-path-grid,.motion-cards,.lab-grid{grid-template-columns:1fr 1fr;gap:7px}.studio-mode-grid>button,.kids-path-grid>button,.motion-cards>button,.lab-grid>button{min-height:110px;padding:12px}.studio-mode-grid>button span,.kids-path-grid>button span,.motion-cards>button span,.lab-grid>button span{font-size:24px}.studio-mode-grid>button b,.kids-path-grid>button b,.motion-cards>button b,.lab-grid>button b{font-size:14px}.workspace-principle,.child-design-note,.learn-principle{grid-template-columns:1fr}.learn-track{grid-template-columns:36px minmax(0,1fr) auto;padding:9px;gap:8px}.learn-track>span{width:36px;height:36px}.learn-track p{display:none}.onboard-avatar-grid{grid-template-columns:repeat(5,1fr)}}

/* v3.2 expanded local avatar system */
.avatar-v31{position:relative;display:inline-grid;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--avatar,#ffd21f);border:2px solid rgba(17,24,39,.18);font-weight:900;line-height:1;overflow:visible}.avatar-v31>span{display:grid;place-items:center;width:100%;height:100%}.avatar-v31 em{position:absolute;right:-6px;bottom:-5px;width:22px;height:22px;border-radius:50%;background:#fff;border:1px solid var(--line);display:grid;place-items:center;font-size:12px;font-style:normal;box-shadow:var(--soft-shadow)}.avatar-v31.large{width:74px;height:74px;font-size:28px}.avatar-v31.small{width:40px;height:40px;font-size:16px}.avatar-v31.avatar-style-person>span{font-size:24px}.avatar-v31.avatar-style-creature>span{font-size:26px}.avatar-v31.avatar-style-robot{border-radius:14px}.avatar-v31.avatar-style-abstract{border-radius:34% 66% 58% 42%/44% 38% 62% 56%}.avatar-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.avatar-detail-grid label{display:grid;gap:5px;font-size:10px}.avatar-detail-grid select{height:38px;border:1px solid var(--line);background:#fff;border-radius:9px;padding:0 8px}
@media(max-width:600px){.avatar-detail-grid{grid-template-columns:1fr}}

/* v3.2 Research, role/security and Maker surfaces */
.role-access-panel label,.security-panel label,.research-notebook label,.research-search label,.maker-controls label{display:grid;gap:5px;font-size:11px;margin:9px 0}.role-access-panel select,.security-panel input,.research-notebook input,.research-notebook textarea,.research-search input,.research-search select,.maker-controls select,.maker-controls input[type=text],.maker-controls input:not([type=range]):not([type=checkbox]){width:100%;min-height:40px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:8px}.permission-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:10px}.permission-grid .switch{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 8px;border:1px solid #e8e0d3;border-radius:9px;background:#fff}.permission-grid .switch input{width:20px;height:20px}.policy-note{display:grid;gap:2px;background:#fff8cf;border:1px solid #ead078;border-radius:11px;padding:9px;margin-top:10px}.policy-note span{font-size:10px;color:var(--muted)}
.avatar-editor-preview{display:flex;align-items:center;gap:14px;margin:4px 0 12px}.avatar-editor-preview>div{display:grid}.avatar-editor-preview small{color:var(--muted)}.avatar-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.avatar-grid button{border:1px solid var(--line);background:#fff;border-radius:10px;min-height:58px;padding:6px;display:grid;place-items:center;gap:2px}.avatar-grid button span{font-size:20px}.avatar-grid button small{font-size:8px}.avatar-grid button.active{background:#fff4ae;border-color:#d7ab00}.avatar-colors{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.avatar-colors button{width:31px;height:31px;border-radius:50%;border:3px solid white;background:var(--c);box-shadow:0 0 0 1px #bbb}.avatar-colors button.active{box-shadow:0 0 0 3px #111}.safety-log>div{max-height:50vh;overflow:auto}.safety-log article{display:grid;padding:8px;border-bottom:1px solid #eee}.safety-log article small{color:var(--muted)}
.research-view,.maker-view{max-width:1600px;margin:auto}.research-head,.maker-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:14px}.research-head h1,.maker-head h1{font-size:clamp(30px,4vw,52px);margin:0 0 5px;letter-spacing:-.04em}.research-head p,.maker-head p{margin:0;color:var(--muted);max-width:900px;line-height:1.45}.research-head button,.maker-head button,.research-query button{border:1px solid var(--line);background:#fff;border-radius:11px;padding:10px 12px}.research-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 310px;gap:10px}.research-grid>.card{padding:15px}.research-grid h2{margin:0 0 11px;font-size:17px}.research-query{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}.provider-details{display:grid;gap:3px;background:#f4efe5;border-radius:10px;padding:10px;margin-top:8px}.provider-details span{font-size:10px;color:var(--muted);line-height:1.4}.research-method ol{padding-left:19px;font-size:11px;line-height:1.55}.research-notebook textarea{resize:vertical;min-height:100px}
.maker-layout{display:grid;grid-template-columns:280px minmax(0,1fr) 280px;gap:10px;min-height:620px}.maker-layout>.card{padding:14px}.maker-controls,.maker-info{overflow:auto}.maker-controls h2,.maker-info h2{margin:0 0 10px;font-size:17px}.maker-types{display:grid;grid-template-columns:1fr 1fr;gap:5px}.maker-types button{min-height:48px;border:1px solid var(--line);background:#fff;border-radius:10px;display:flex;align-items:center;gap:8px;text-align:left;font-size:10px}.maker-types button span{font-size:18px}.maker-types button.active{background:#fff3a8;border-color:#d5aa00;font-weight:800}.maker-controls input[type=range]{width:100%}.maker-stage{display:grid;place-items:center;overflow:hidden;background:#d6d0c5;min-width:0;min-height:0}.maker-sheet{--sheet-ratio:8.5/11;--maker-margin:.25in;--maker-bleed:0in;width:min(88%,760px);max-height:94%;aspect-ratio:var(--sheet-ratio);background:#fff;box-shadow:0 10px 40px #0003;position:relative;padding:clamp(10px,calc(var(--maker-margin) * .55),46px);overflow:hidden}.maker-sheet.show-guides:after{content:"";position:absolute;inset:var(--maker-margin);border:1px dashed #1774c8;pointer-events:none}.maker-sheet.show-bleed:before{content:"";position:absolute;inset:max(0px,calc(var(--maker-margin) - var(--maker-bleed)));border:1px dashed #d33;pointer-events:none}.maker-items{width:100%;height:100%;display:grid;grid-template-columns:repeat(var(--maker-cols,1),minmax(0,1fr));grid-template-rows:repeat(var(--maker-rows,1),minmax(0,1fr));gap:8px}.maker-item{min-width:0;min-height:0;margin:0;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border-radius:4px}.maker-item img{width:100%;height:100%;min-height:0;object-fit:contain;display:block}.maker-item figcaption{font-size:9px;margin-top:3px}.maker-empty{height:100%;display:grid;place-items:center;align-content:center;text-align:center;gap:4px;color:var(--muted)}.maker-info dl{display:grid;grid-template-columns:1fr;gap:5px}.maker-info dt{font-weight:750;font-size:11px}.maker-info dd{margin:0 0 10px;color:var(--muted);font-size:10px;line-height:1.4}
@media(max-width:1050px){.research-grid{grid-template-columns:1fr 1fr}.research-method{grid-column:1/-1}.maker-layout{grid-template-columns:240px minmax(0,1fr)}.maker-info{grid-column:1/-1}.permission-grid{grid-template-columns:1fr}}
@media(max-width:650px){.research-head,.maker-head{align-items:flex-start;flex-direction:column}.research-grid{grid-template-columns:1fr}.research-method{grid-column:auto}.research-query{grid-template-columns:1fr}.maker-layout{grid-template-columns:1fr;min-height:0}.maker-controls{order:2}.maker-stage{order:1;min-height:55vh}.maker-info{order:3;grid-column:auto}.maker-types{grid-template-columns:repeat(4,minmax(0,1fr));overflow-x:auto}.maker-types button{min-width:105px}.avatar-grid{grid-template-columns:repeat(3,1fr)}}

/* C.R.E.A.T.E. bounded Studio + production controls */
.pro-workspace{width:100%;max-width:100%;min-width:0;overflow:hidden;container-type:inline-size;container-name:create-studio}
.pro-center,.pro-stage,.pro-inspector{min-width:0;max-width:100%}
.pro-stage{max-width:100%;max-height:100%;clip-path:inset(0 round 16px)}
.pro-bezel-safe{position:absolute;z-index:1;inset:10px;border:1px solid rgba(255,255,255,.35);border-radius:11px;pointer-events:none}
.pro-document-panel>button{width:100%;min-height:38px;border:1px solid var(--line);border-radius:9px;background:#fff;font-weight:750}
.pro-doc-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px}.pro-doc-grid label{margin:0}.pro-doc-grid input,.pro-document-panel select{box-sizing:border-box;width:100%;min-width:0;height:36px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:0 7px;font:inherit}.pro-doc-info{font-weight:800;font-size:11px;line-height:1.35}
@container create-studio (max-width: 780px){.pro-doc-grid{grid-template-columns:1fr}.pro-document-panel{font-size:10px}}
body[data-formfactor="phone"] .pro-workspace{grid-template-columns:48px minmax(0,1fr)}
body[data-formfactor="phone"] .pro-stage{clip-path:inset(0 round 10px)}
body[data-formfactor="phone"] .pro-options{max-width:100%;scrollbar-width:none}.pro-options::-webkit-scrollbar{height:4px}

/* Maker production preview */
.maker-custom-size{grid-template-columns:1fr 1fr;gap:6px}.maker-custom-size:not([hidden]){display:grid}.maker-custom-size label{margin:0}
.maker-export-actions{display:grid!important;grid-template-columns:1fr 1fr}.maker-export-actions button:last-child{grid-column:1/-1}
.maker-sheet.show-safe .maker-items:before{content:"SAFE";position:absolute;z-index:8;inset:clamp(8px,.14in,18px);border:1px dotted #24935c;pointer-events:none;color:#23764c;font:700 7px/1 system-ui;padding:3px;text-align:right}
.maker-sheet[data-type="card"].show-guides .maker-items:after{content:"FOLD";position:absolute;z-index:9;top:0;bottom:0;left:50%;border-left:1px dashed #666;pointer-events:none;color:#555;font:700 7px/1 system-ui;padding:4px;writing-mode:vertical-rl}
.maker-items{position:relative}
.maker-quality{margin-top:10px;border-radius:10px;border:1px solid var(--line);background:#f5f1e8;padding:9px;display:grid;gap:2px}.maker-quality b{font-size:12px}.maker-quality span{font-size:9px;line-height:1.35;color:var(--muted)}.maker-quality.good{border-color:#74a87d;background:#eef8ef}.maker-quality.fair{border-color:#c9a83d;background:#fff8d8}.maker-quality.low{border-color:#cf746c;background:#fff0ed}
@media(max-width:650px){.maker-export-actions{grid-template-columns:1fr}.maker-export-actions button:last-child{grid-column:auto}.maker-sheet{width:min(92%,620px);max-height:88%}}
