:root{--ink:#253052;--muted:#6f7892;--violet:#7255e8;--violet-dark:#563cc9;--pink:#fb779d;--mint:#35c8aa;--yellow:#ffc85b;--sky:#70baf6;--paper:#faf9f5;--white:#fff;--line:#e8e9f1;--shadow:0 14px 35px rgba(34,43,86,.065);--r:22px;font-family:ui-rounded,"Trebuchet MS",system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink)}button,select,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #ffc85b;outline-offset:3px}a{color:inherit}button{touch-action:manipulation}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(2rem,3vw,3.15rem);line-height:1.12;letter-spacing:-.05em}h2{font-size:clamp(1.45rem,2.15vw,2rem);letter-spacing:-.035em}h3{font-size:1.12rem;letter-spacing:-.02em}p{line-height:1.58}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.app-layout{display:grid;grid-template-columns:256px minmax(0,1fr);min-height:100vh}.sidebar{height:100vh;position:sticky;top:0;background:white;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:28px 16px 18px;z-index:9}.brand{display:flex;align-items:center;gap:12px;padding:6px 12px 25px}.brand-mark{display:grid;place-items:center;width:49px;height:49px;border-radius:17px;background:var(--violet);color:#ffe177;font-size:26px;box-shadow:0 8px 18px #7357e837}.brand strong{font-size:1.1rem;letter-spacing:-.035em;display:block}.brand small{font-size:.73rem;color:var(--muted);font-weight:700}.nav-label{font-size:.68rem;font-weight:900;color:#97a0b1;letter-spacing:.15em;padding:12px 15px 7px}.nav-link{width:100%;border:0;background:transparent;color:#63708a;text-align:left;display:flex;align-items:center;gap:12px;font-size:.93rem;font-weight:800;border-radius:14px;padding:12px 13px;margin:3px 0;transition:background .15s,color .15s}.nav-link:hover,.nav-link:focus-visible{background:#f4f0ff}.nav-link.active{background:#efeaff;color:var(--violet-dark)}.nav-link .nav-emoji{font-size:1.22rem;width:27px;display:inline-grid;place-items:center}.sidebar-scroll{overflow:auto;scrollbar-width:thin;flex:1}.sidebar-footer{border-top:1px solid var(--line);padding:15px 11px 0;color:#858e9f;font-size:.74rem;line-height:1.5}.content{min-width:0;padding:27px clamp(18px,3.1vw,48px) 60px;max-width:1620px;width:100%;margin:auto}.topbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:25px}.eyebrow{font-size:.78rem;font-weight:900;color:#9886dd;text-transform:uppercase;letter-spacing:.12em}.top-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.profile-select{padding:12px 35px 12px 15px;background:#fff;border:1px solid var(--line);border-radius:14px;color:var(--ink);font-weight:900;min-height:46px}.chip,.mini-btn{border:1px solid var(--line);background:white;color:#55627b;border-radius:999px;font-weight:800;padding:9px 13px;min-height:40px}.chip.active{background:var(--ink);color:#fff;border-color:var(--ink)}.btn{border:0;border-radius:15px;display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:13px 20px;font-weight:900;background:#edeaff;color:#5742c9;min-height:47px;text-decoration:none}.btn:hover{filter:brightness(.97)}.btn.primary{background:var(--violet);color:#fff;box-shadow:0 6px 13px #7255e82a}.btn.green{background:#dffbf3;color:#168e78}.btn.orange{background:#fff0d1;color:#9f6a11}.btn.ghost{background:#fff;border:1px solid var(--line);color:var(--ink)}.btn.danger{background:#fff0ef;color:#b5423a}.btn.small{padding:9px 12px;min-height:38px;border-radius:12px;font-size:.87rem}.btn-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.hero{background:linear-gradient(112deg,#6e55d9,#9876ed);color:white;border-radius:29px;min-height:270px;padding:clamp(24px,4vw,44px);display:grid;grid-template-columns:1.25fr .75fr;align-items:center;gap:15px;overflow:hidden;position:relative}.hero:after{content:"";position:absolute;width:250px;height:250px;border:45px solid #ffffff0d;border-radius:50%;right:-90px;top:-150px}.hero .eyebrow{color:#e0d4ff}.hero h1{max-width:690px;margin:10px 0 14px}.hero p{max-width:540px;color:#f1ebff;margin-bottom:22px}.hero .btn{background:#fff;color:#5b43cd}.hero-art{display:grid;place-items:center;position:relative;min-height:208px}.hero-book{background:#fff;border:10px solid #e6ddff;border-radius:25px;box-shadow:0 18px 0 #4b35a64b;transform:rotate(-8deg);width:210px;height:166px;display:flex;align-items:center;justify-content:center;gap:7px;color:#634bd7;font-size:4.1rem;font-weight:1000}.hero-book b:last-child{color:#ff987a}.hero-spark{position:absolute;font-size:3rem;filter:drop-shadow(0 7px 7px #39217b44)}.hero-spark.a{left:6%;top:0}.hero-spark.b{right:3%;bottom:0}.section-head{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;margin:29px 0 17px}.section-head h2,.section-head p{margin:0}.section-head p{font-size:.91rem;color:var(--muted);margin-top:5px}.module-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}.module-card{border:1px solid #eceaf4;background:white;box-shadow:var(--shadow);border-radius:22px;padding:21px;min-height:178px;text-align:left;display:flex;flex-direction:column;align-items:flex-start;transition:transform .2s,border-color .2s}.module-card:hover{transform:translateY(-3px);border-color:#beb4f6}.module-icon{width:53px;height:53px;border-radius:17px;display:grid;place-items:center;font-size:1.9rem;margin-bottom:17px}.module-card strong{font-size:1rem;letter-spacing:-.02em}.module-card small{color:var(--muted);margin-top:4px;font-size:.82rem}.module-card .module-count{margin-top:auto;padding-top:12px;color:var(--violet);font-size:.74rem;font-weight:900}.stat-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:19px 0}.stat{background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px;display:flex;align-items:center;gap:14px}.stat-icon{width:46px;height:46px;display:grid;place-items:center;font-size:1.65rem;background:#f0ecff;border-radius:14px}.stat b{font-size:1.65rem;letter-spacing:-.05em;display:block}.stat span{color:var(--muted);font-weight:700;font-size:.78rem}.page-heading{margin-bottom:22px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}.page-heading h1{margin:6px 0 7px}.page-heading p{color:var(--muted);margin-bottom:0}.step-pills{display:flex;gap:9px;flex-wrap:wrap;margin:0 0 19px}.step-pill{padding:8px 14px;border-radius:999px;background:#fff;font-size:.81rem;font-weight:800;color:#626d84;border:1px solid var(--line)}.step-pill.active{color:var(--violet);background:#efebff;border-color:#e1dafa}.searchbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:17px}.searchbar input{width:230px;max-width:100%;background:#fff;border:1px solid var(--line);padding:12px 14px;border-radius:13px;color:var(--ink)}.lesson-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:13px}.lesson-card{background:#fff;border:1px solid var(--line);border-radius:21px;min-height:182px;padding:15px 12px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:space-between;box-shadow:0 7px 17px #26305208;transition:transform .15s,border-color .15s;position:relative}.lesson-card:hover{transform:translateY(-2px);border-color:#c8baff}.lesson-card.done:after{content:'✓';position:absolute;right:9px;top:9px;background:#dff8ec;border-radius:50%;color:#179c6c;font-size:.75rem;display:grid;place-items:center;width:23px;height:23px;font-weight:900}.lesson-symbol{font-size:clamp(2.1rem,4.3vw,3.4rem);font-weight:1000;line-height:1.16;color:var(--violet-dark);letter-spacing:-.08em}.lesson-symbol.word-symbol{font-size:2.9rem;letter-spacing:0}.lesson-symbol .lower{font-size:.65em;color:#aa9de5}.lesson-label{font-weight:900;font-size:.86rem;line-height:1.35}.lesson-label small{display:block;color:var(--muted);font-weight:700;margin-top:3px;font-size:.75rem}.lesson-card .tiny-play{border:0;background:#f2efff;color:#6a54ce;border-radius:99px;font-size:.72rem;padding:7px 11px;font-weight:900}.lesson-card .tiny-play:hover{background:#e6dfff}.dots{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;max-width:130px;gap:5px}.dots i{display:block;width:10px;height:10px;border-radius:50%;background:#ffbd71}.modal-backdrop{position:fixed;inset:0;z-index:30;background:#1c2347a8;padding:24px;display:flex;justify-content:center;align-items:center;overflow:auto}.detail-modal{max-width:930px;width:100%;background:white;border-radius:29px;box-shadow:0 25px 100px #0b123360;max-height:calc(100vh - 42px);overflow:auto;padding:25px}.modal-top{display:flex;align-items:center;justify-content:space-between;gap:15px}.close-btn{width:43px;height:43px;border:0;background:#f2f1f8;border-radius:14px;font-size:1.5rem}.detail-layout{display:grid;grid-template-columns:.86fr 1.14fr;gap:22px;padding-top:17px}.detail-visual{border-radius:23px;background:#f4efff;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:250px;padding:22px;text-align:center}.detail-glyph{font-size:clamp(5rem,10vw,8rem);font-weight:1000;color:var(--violet);letter-spacing:-.09em;line-height:1.08}.detail-glyph.emoji{font-size:7rem;letter-spacing:normal}.detail-examples{font-size:1.18rem;line-height:1.65;font-weight:800}.detail-examples small{display:block;font-size:.86rem;color:#728097}.detail-practice{padding:7px 0}.detail-practice h3{margin-bottom:10px}.audio-panel{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:17px}.audio-panel .btn{font-size:.86rem;padding:12px 8px}.fine-print{color:#7d8497;font-size:.77rem;line-height:1.5}.trace-box{border:2px dashed #d9d2f2;background:#fff;border-radius:20px;padding:10px;margin:13px 0 14px}.trace-canvas{display:block;width:100%;height:260px;border-radius:13px;touch-action:none;cursor:crosshair;background:#fff}.tool-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.swatch{border:3px solid white;box-shadow:0 0 0 1px #dce0ec;width:35px;height:35px;border-radius:50%;padding:0;transition:transform .1s}.swatch.selected{box-shadow:0 0 0 3px var(--violet);transform:scale(1.1)}.card-panel{background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);padding:24px;border-radius:25px}.practice-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:18px;align-items:start}.prompt-symbol{font-size:4rem;font-weight:1000;text-align:center;color:var(--violet);margin:14px 0}.quiz-question{font-size:1.25rem;text-align:center;font-weight:900;line-height:1.5}.answer-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:23px}.answer{background:#f8f7fd;color:#364363;border:2px solid #efedf7;border-radius:16px;min-height:79px;padding:10px;font-size:1.3rem;font-weight:900}.answer.correct{background:#d8f9e9;border-color:#56caa3}.answer.incorrect{background:#ffe8e8;border-color:#f4a2a2}.quiz-feedback{margin-top:13px;text-align:center;min-height:43px;font-weight:900;font-size:1rem}.quiz-info{border-radius:18px;background:#f1ecff;padding:19px;color:#5743af}.quiz-info p{color:#6d628f;font-size:.87rem}.memory-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;max-width:600px;margin:17px auto}.memory-tile{border:2px solid #e7e3fc;background:linear-gradient(130deg,#8a70ec,#6a50d8);border-radius:16px;min-height:96px;color:#fff;font-size:1.5rem;font-weight:1000;padding:8px;overflow-wrap:anywhere}.memory-tile.open{background:#fff;color:var(--ink)}.memory-tile.matched{background:#e2f8ed;color:#267a5c;border-color:#9ce4c4}.paint-layout{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,.7fr);gap:20px;align-items:start}.paint-paper{background:white;border:1px solid var(--line);border-radius:25px;box-shadow:var(--shadow);padding:19px;min-width:0}.painting{width:100%;height:auto;display:block;aspect-ratio:4/3;border-radius:19px;background:#fffdf8;border:1px solid #eeeef5;touch-action:none}.painting [data-paint]{cursor:pointer;stroke:#30344d;stroke-width:5;stroke-linejoin:round;stroke-linecap:round;transition:fill .15s}.painting [data-paint]:hover{stroke:#6550d8;stroke-width:6}.paint-palette{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:11px;margin:15px 0}.paint-palette .swatch{width:42px;height:42px}.paint-menu{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.paint-choice{background:#fff;border:2px solid #eeedf4;border-radius:15px;padding:10px 5px;display:flex;align-items:center;flex-direction:column;gap:5px;font-size:.8rem;font-weight:900}.paint-choice span{font-size:1.7rem}.paint-choice.active{border-color:#8165e6;background:#f5f1ff}.paint-instructions{font-size:.9rem;color:var(--muted)}.progress-section{display:grid;grid-template-columns:1fr 1fr;gap:17px}.progress-list{display:grid;gap:13px}.progress-item{display:grid;gap:8px}.progress-head{display:flex;justify-content:space-between;gap:12px;font-size:.91rem;font-weight:800}.bar{height:10px;background:#eeebf7;border-radius:100px;overflow:hidden}.bar-fill{height:100%;background:linear-gradient(90deg,#7860e8,#45c9ba);border-radius:100px}.recommendation{background:#fffbef;border:1px solid #fbe6b9;padding:18px;border-radius:17px}.recommendation b{display:block;margin-bottom:8px}.recommendation p{font-size:.9rem;color:#746544;margin:0}.parent-plan{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.day-plan{background:#f7f6fc;border-radius:17px;padding:17px;min-height:155px}.day-plan strong{display:block;margin-bottom:9px}.day-plan p{font-size:.81rem;margin:0;color:#6a7590}.banner-note{border:1px solid #e4e1f7;background:#f4f1ff;border-radius:17px;padding:17px 20px;font-size:.9rem;line-height:1.55;color:#655994}.initial-load{padding:70px;text-align:center;font-size:1.15rem;font-weight:900}.print-area{display:none}.empty-state{text-align:center;padding:40px;background:#fff;border-radius:20px;color:var(--muted)}.text-accent{color:var(--violet)}.pill-badge{font-size:.72rem;font-weight:900;border-radius:99px;background:#e7f8ee;color:#15906d;padding:6px 10px}.level-badge{border-radius:999px;padding:8px 12px;background:#ffecfa;color:#ac3d86;font-size:.75rem;font-weight:900}.content-footer{text-align:center;color:#9299a8;font-size:.75rem;margin:35px 0 0}.visually-hide{display:none!important}
@media(max-width:1250px){.module-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.lesson-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:960px){.app-layout{display:block}.sidebar{height:auto;position:static;padding:12px 16px;border-bottom:1px solid var(--line);border-right:0}.brand{padding:2px 4px 10px}.brand-mark{width:41px;height:41px;border-radius:13px}.sidebar-scroll{display:flex;flex-wrap:nowrap;overflow:auto;gap:6px}.nav-label,.sidebar-footer{display:none}.nav-link{width:auto;flex:none;padding:10px 14px;white-space:nowrap}.nav-link .nav-emoji{width:auto}.content{padding:23px 19px 55px}.module-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:650px){.topbar{align-items:flex-start}.eyebrow{font-size:.67rem}.hero{grid-template-columns:1fr;padding:26px 23px;min-height:auto}.hero h1{font-size:2rem}.hero p{font-size:.94rem}.hero-art{display:none}.module-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.module-card{padding:16px;min-height:150px}.module-icon{margin-bottom:11px;width:46px;height:46px;font-size:1.6rem}.stat-row{gap:8px}.stat{padding:13px 10px;gap:7px;flex-direction:column;text-align:center}.stat b{font-size:1.35rem}.stat-icon{width:36px;height:36px;font-size:1.3rem}.lesson-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.lesson-card{min-height:161px;border-radius:17px;padding:13px 6px}.lesson-symbol{font-size:2.3rem}.lesson-symbol.word-symbol{font-size:2rem}.lesson-label{font-size:.79rem}.detail-modal{padding:17px;max-height:calc(100vh - 16px);border-radius:20px}.modal-backdrop{padding:8px}.detail-layout,.practice-grid,.paint-layout,.progress-section{grid-template-columns:1fr}.detail-visual{min-height:150px}.detail-glyph{font-size:4.5rem}.detail-glyph.emoji{font-size:4.2rem}.detail-practice h3{font-size:1rem}.trace-canvas{height:205px}.memory-tile{min-height:72px;font-size:1.07rem}.paint-menu{grid-template-columns:repeat(4,1fr)}.paint-palette{grid-template-columns:repeat(6,1fr)}.paint-palette .swatch{width:35px;height:35px}.parent-plan{grid-template-columns:1fr 1fr}.day-plan{min-height:110px}.answer{min-height:68px;font-size:1.13rem}.searchbar input{width:100%}.profile-select{font-size:.86rem}.top-actions{gap:5px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
@media print{
 @page{size:letter;margin:.55in}
 body{background:white;color:black}.app-layout,.modal-backdrop,.content,.sidebar{display:none!important}.print-area{display:block!important;font-family:Arial,sans-serif;color:black}.print-title{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid #111;padding-bottom:13px;margin-bottom:16px}.print-title h1{font-size:23pt;letter-spacing:0;margin:0}.print-title p{margin:5px 0 0;font-size:10pt}.print-identity{font-size:10pt;text-align:right}.print-glyph{font-family:Arial,sans-serif;font-size:140pt;font-weight:800;-webkit-text-stroke:2px #222;color:white;line-height:1.4;text-align:center;letter-spacing:5px}.print-glyph.small{font-size:100pt}.print-traces{display:flex;justify-content:space-between;gap:15px;margin:14px 0}.print-traces span{color:white;-webkit-text-stroke:2px #555;font-weight:800;font-size:74pt;letter-spacing:0}.print-guidelines{height:70px;border-top:2px solid #aaa;border-bottom:2px solid #aaa;position:relative;margin:18px 0}.print-guidelines:after{content:"";position:absolute;left:0;right:0;top:50%;border-top:1px dashed #aaa}.print-words{font-size:14pt;border:1px solid #ccc;padding:12px;border-radius:9px}.print-art{max-width:610px;margin:15px auto}.print-art svg{max-width:100%;height:auto}.print-art [data-paint]{fill:white!important;stroke:black!important;stroke-width:5!important}.print-footer{text-align:center;margin-top:20px;font-size:9pt;color:#666}
}

/* PWA: installer and iOS safe-area support */
.install-pwa-btn{border:1px solid #d7c9ff;background:#f2efff;color:#6047c4;border-radius:999px;padding:11px 15px;font-weight:900;white-space:nowrap;box-shadow:0 3px 9px rgba(80,61,155,.08)}
.install-pwa-btn:hover{background:#e8e0ff}
.install-pwa-btn:disabled{opacity:.7;cursor:default}
.install-sheet{position:relative;background:#fff;border-radius:24px;padding:26px;width:min(95vw,540px);max-height:min(92vh,820px);overflow:auto;box-shadow:0 22px 70px #151b4160}
.install-sheet-head{display:flex;align-items:center;gap:14px;margin-bottom:17px}
.install-sheet-head img{border-radius:17px}
.install-sheet-head h2{font-size:1.45rem;margin:5px 15px 0 0}
.install-sheet-head .close-btn{margin-left:auto;flex-shrink:0}
.install-steps{padding-left:27px;display:grid;gap:13px;font-weight:650;line-height:1.5}
.install-steps li{padding-left:7px}
@supports(padding:max(0px)){
 .topbar{padding-top:max(12px,env(safe-area-inset-top))}
 .content-footer{padding-bottom:max(16px,env(safe-area-inset-bottom))}
}
@media(max-width:680px){.install-pwa-btn{font-size:.77rem;padding:9px 11px}.install-sheet{padding:19px}.install-sheet-head h2{font-size:1.15rem}}
@media print{.install-pwa-btn,.install-backdrop{display:none!important}}

@media(max-width:650px){
 .topbar{flex-direction:column;align-items:stretch;gap:11px}
 .top-actions{width:100%;gap:7px}
 .top-actions .profile-select{flex:1;min-width:116px;padding:10px 22px 10px 10px}
 .top-actions .chip{flex:0 0 auto}
 .top-actions .install-pwa-btn{order:4;width:100%;min-height:40px}
}

/* ============================================================
   CREATIVE STUDIO v3.0 — clean, tactile, kid-friendly workspace
   ============================================================ */
.studio-mode{display:block}
.studio-mode .sidebar,.studio-mode .content-footer{display:none}
.studio-mode .content{max-width:1680px;padding:16px clamp(14px,2.8vw,42px) 40px}
.studio-mode .topbar{padding:4px 0 12px;margin-bottom:4px;border-bottom:1px solid #edecf5}
.studio-mode .topbar>div:first-child{display:none}
.studio-mode .top-actions{margin-left:auto}
.studio-shell{max-width:1550px;margin:auto;--violet:#7055d7}
.studio-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:14px 0 12px}
.studio-heading>div{display:flex;align-items:center;gap:15px;flex-wrap:wrap}
.studio-heading h1{font-size:clamp(1.45rem,2.5vw,2.2rem);letter-spacing:-.045em;margin:0;font-weight:950}
.studio-heading-icon{font-size:.8em}
.studio-heading .eyebrow{font-size:.68rem;color:#8a87ab}
.studio-back,.studio-focus-btn{border:1px solid #e1def0;border-radius:13px;background:white;color:#485274;font-weight:900;min-height:44px;padding:9px 14px}
.studio-focus-btn{background:#f2effd;color:#5643a9;white-space:nowrap}
.studio-tabs{display:flex;gap:8px;margin-bottom:11px;overflow-x:auto;scrollbar-width:none;padding:3px 1px}
.studio-tabs::-webkit-scrollbar{display:none}
.studio-tab{border:1px solid #e6e4ee;background:white;border-radius:14px;white-space:nowrap;color:#606a81;font-weight:850;padding:11px 18px;min-height:48px}
.studio-tab.active{background:#ebe5ff;border-color:#b2a3ed;color:#583abd}
.studio-gallery{display:flex;gap:10px;overflow-x:auto;padding:4px 3px 12px;scrollbar-width:thin;scrollbar-color:#cbc1ea transparent;max-width:100%}
.studio-gallery-item{background:white;flex:0 0 62px;height:62px;border:2px solid #e5e6ee;border-radius:16px;color:#5c47c5;font-size:1.95rem;font-weight:1000;display:grid;place-items:center;box-shadow:0 2px 6px #393b5510;line-height:1}
.studio-gallery-item.active{border-color:#7157e0;background:#f2edff;box-shadow:0 0 0 3px #7d63e824}
.studio-gallery-item:hover,.studio-tool:hover,.studio-brush:hover{border-color:#9582ed}
.studio-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(274px,302px);gap:19px;align-items:start}
.studio-workarea{min-width:0;border:1px solid #e4e3ef;background:white;border-radius:23px;box-shadow:0 8px 32px #2830590b;padding:15px;overflow:hidden}
.studio-paper-top{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:0 3px 13px}
.studio-art-name{display:flex;align-items:center;gap:12px;min-width:0}
.studio-art-icon{display:grid;place-items:center;background:#f1edff;border-radius:15px;width:51px;height:51px;font-size:1.6rem;flex-shrink:0}
.studio-art-name strong{font-size:1.35rem;font-weight:950;display:block;line-height:1.24}
.studio-art-name small{display:block;color:#7b8499;font-size:.86rem;font-weight:700}
.studio-audio{display:flex;gap:7px}
.studio-audio-btn{border:1px solid #e4e2f0;background:#f9f7ff;color:#5848a1;border-radius:13px;padding:10px 13px;font-size:.88rem;font-weight:900;min-height:44px}
.studio-canvas-wrap{position:relative;background:white;border:2px solid #ebe9f1;border-radius:18px;padding:6px;overflow:hidden;min-height:300px;background-image:radial-gradient(#f0eff5 1px,transparent 1px);background-size:28px 28px}
.studio-canvas-wrap .painting{display:block;width:100%;height:auto;aspect-ratio:4/3;background:white;border:0;box-shadow:0 3px 10px #7e78aa08;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:crosshair;max-height:min(73vh,900px)}
.studio-canvas-wrap .painting [data-paint]{fill:#fff;stroke:#263451;stroke-width:5;cursor:crosshair;transition:none;stroke-linecap:round;stroke-linejoin:round;paint-order:normal}
.studio-canvas-wrap .painting [data-paint]:hover{stroke:#263451;stroke-width:5}
.studio-canvas-wrap .painting text[data-paint]{stroke-width:4;paint-order:stroke fill}
.canvas-watermark{position:absolute;right:17px;bottom:12px;color:#d1cfdd;pointer-events:none;font-size:.66rem;font-weight:950;letter-spacing:.11em;opacity:.6}
.studio-board-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 4px 0}
.studio-hint{font-size:.85rem;font-weight:750;color:#6e7792;line-height:1.45}
.studio-autosave{color:#328670;font-weight:800;font-size:.75rem;white-space:nowrap}
.studio-controls{background:white;border:1px solid #e4e3ee;border-radius:23px;padding:19px;box-shadow:0 10px 30px #28305909}
.studio-control-header{display:flex;justify-content:space-between;align-items:center;margin:0 0 12px;font-size:1.2rem;font-weight:1000}
.studio-control-header span:last-child{font-size:1.6rem}
.studio-tool-chooser{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.studio-tool{border:2px solid #e5e4ef;border-radius:13px;background:#fff;min-height:65px;padding:6px 2px;font-size:.78rem;font-weight:900;color:#535e75;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
.studio-tool span{font-size:1.5rem}
.studio-tool.active{background:#efebff;border-color:#8f7de6;color:#553dbb}
.studio-divider{height:1px;background:#eeeef5;margin:17px 0}
.studio-section-title{font-size:.87rem;font-weight:950;color:#384363;margin:0 0 10px}
.studio-brush-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.studio-brush{border:1.5px solid #e5e3ee;background:white;border-radius:12px;min-height:65px;padding:5px 0;color:#58637b;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px}
.studio-brush span{font-size:1.45rem}
.studio-brush small{font-size:.64rem;font-weight:850}
.studio-brush.active{border-color:#8e7ae2;background:#f5f1ff;color:#5742be}
.studio-slider-label{display:flex;justify-content:space-between;align-items:center;margin:18px 0 8px;font-weight:800;font-size:.82rem}
.studio-slider-label strong{background:#f1edff;border-radius:8px;padding:5px 10px;color:#5a42c5}
#brush-size{display:block;width:100%;accent-color:#7255df;min-height:32px;cursor:pointer}
.studio-color-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:10px 0 14px}
.studio-swatch{border:3px solid #fff;background:var(--swatch);border-radius:50%;width:39px;height:39px;max-width:100%;padding:0;box-shadow:0 0 0 1px #d4d5e2;min-height:39px;justify-self:center}
.studio-swatch.selected{box-shadow:0 0 0 3px #8568e5;transform:scale(1.03)}
.studio-custom-wrap{display:flex;align-items:center;gap:10px;color:#6b7389;font-size:.81rem;font-weight:850}
.studio-custom-wrap label{white-space:nowrap}
#studio-custom-color{width:48px;height:38px;border:1px solid #e7e3f3;border-radius:9px;padding:2px;background:white;cursor:pointer}
.studio-active-color{margin-left:auto;width:26px;height:26px;border-radius:50%;border:2px solid white;box-shadow:0 0 0 1px #ccc;flex-shrink:0}
.studio-case{width:100%;padding:11px;border:1px solid #d9d4f5;background:#f5f2ff;border-radius:11px;color:#5941bf;font-size:.85rem;font-weight:900;margin-top:14px;min-height:44px}
.studio-history{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.studio-secondary{border:1px solid #e4e3ef;background:#fff;color:#4f5876;padding:11px 10px;border-radius:12px;min-height:44px;font-size:.85rem;font-weight:900;width:100%}
.studio-secondary:disabled{opacity:.35}
.studio-clear{width:100%;margin-top:9px}
.studio-save{display:grid;gap:9px;margin-top:15px}
.studio-primary{background:#7053d7;color:white;border:0;border-radius:13px;min-height:49px;padding:12px;font-weight:950;width:100%;box-shadow:0 5px 14px #7353d72b}
.studio-focus .topbar,.studio-focus .studio-tabs,.studio-focus .studio-gallery{display:none}
.studio-focus .studio-heading{margin:8px 0 14px}
.studio-focus .studio-workarea{box-shadow:0 3px 18px #29305910}
.trace-brushes{display:flex;gap:7px;flex-wrap:wrap;margin:7px 0 9px}
.trace-brush{min-height:41px;padding:6px 10px;border:1px solid #dfdbf3;background:white;color:#5d5877;font-size:.76rem;border-radius:11px;font-weight:900}
.trace-brush.active{border-color:#8d78e4;background:#eee9ff;color:#573cb4}
.trace-caption{display:block;text-align:center;color:#6b6b88;font-size:.8rem;font-weight:800;padding:8px 5px 3px}
.trace-box{padding:7px}
.trace-canvas{aspect-ratio:740/350;height:auto;max-height:350px;touch-action:none}
@media(max-width:1100px){
 .studio-workspace{grid-template-columns:minmax(0,1fr) minmax(240px,270px);gap:13px}
 .studio-controls{padding:14px}
 .studio-board-bottom{align-items:start;flex-wrap:wrap}
}
@media(max-width:820px){
 .studio-workspace{grid-template-columns:minmax(0,1fr)}
 .studio-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;align-items:center}
 .studio-control-header,.studio-tool-chooser,.studio-color-grid,.studio-brush-grid,.studio-history,.studio-save,.studio-case{grid-column:1/-1}
 .studio-controls .studio-divider{display:none}
 .studio-control-header{margin-bottom:0}
 .studio-section-title{margin:4px 0}
 .studio-slider-label{margin:4px 0}
 .studio-gallery-item{flex-basis:58px;height:58px}
 .studio-tool{min-height:56px}
 .studio-workarea{padding:10px}
 .studio-canvas-wrap{min-height:200px}
}
@media(max-width:540px){
 .studio-mode .content{padding:8px 9px 30px}
 .studio-mode .topbar{padding:5px 3px 10px;gap:6px}
 .studio-mode .top-actions{justify-content:flex-start;width:100%}
 .studio-mode .install-pwa-btn{font-size:.68rem;padding:7px 8px;min-height:38px}
 .studio-mode .profile-select{padding:9px 28px 9px 9px;min-height:40px;font-size:.76rem}
 .studio-mode .top-actions .chip{padding:8px 9px;min-height:38px}
 .studio-heading{margin:9px 3px 11px;gap:8px}
 .studio-heading>div{gap:8px}
 .studio-heading h1{font-size:1.3rem}
 .studio-heading .eyebrow{display:none}
 .studio-back,.studio-focus-btn{font-size:.73rem;min-height:38px;padding:7px 9px}
 .studio-focus-btn{white-space:normal;max-width:125px}
 .studio-tabs{margin-bottom:5px;gap:6px}
 .studio-tab{padding:9px 12px;min-height:43px;font-size:.83rem}
 .studio-gallery{padding-bottom:8px;gap:8px}
 .studio-gallery-item{height:49px;flex-basis:49px;border-radius:12px;font-size:1.55rem}
 .studio-art-icon{width:41px;height:41px;font-size:1.22rem;border-radius:11px}
 .studio-art-name{gap:7px}
 .studio-art-name strong{font-size:1rem}
 .studio-art-name small{font-size:.71rem}
 .studio-audio-btn{padding:8px;min-height:41px;font-size:.72rem}
 .studio-paper-top{margin-bottom:9px}
 .studio-workarea{padding:8px;border-radius:16px}
 .studio-canvas-wrap{border-radius:13px;padding:2px;min-height:185px}
 .canvas-watermark{font-size:.46rem;bottom:7px;right:8px}
 .studio-board-bottom{padding:9px 3px 0}
 .studio-hint{font-size:.73rem}
 .studio-autosave{font-size:.68rem}
 .studio-controls{padding:12px;gap:9px;border-radius:17px}
 .studio-color-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}
 .studio-swatch{width:43px;height:43px;min-height:43px}
 .studio-brush{min-height:58px}
 .studio-brush small{font-size:.66rem}
 .trace-canvas{height:auto;max-height:245px}
 .detail-modal{max-height:96dvh}
 .detail-layout{gap:10px}
 .detail-visual{padding:12px;min-height:120px}
 .detail-glyph{font-size:3.6rem}
 .detail-examples{font-size:.98rem}
}
@media print{
 .studio-shell{display:none!important}
}

/* Quick palette stays near the canvas on touch screens. */
.studio-number-range{display:flex;gap:7px;margin:0 0 6px}
.studio-number-range button{background:#fff;border:1px solid #dedcec;border-radius:10px;color:#64708e;padding:7px 17px;font-weight:900;min-height:38px}
.studio-number-range button.active{border-color:#a891e4;background:#f1eaff;color:#6346c7}
.studio-quickbar{display:none}
.studio-mode .install-pwa-btn{display:none}
.studio-focus .studio-heading .eyebrow,.studio-focus .studio-heading h1{display:none}
@media(max-width:820px){
.studio-quickbar{display:flex;align-items:center;gap:7px;padding:0 0 9px;width:100%;min-width:0}
.studio-quicktools{display:flex;align-items:center;gap:4px;flex-shrink:0}
.studio-quicktools button{width:39px;height:39px;border:1px solid #dcd8e8;background:#fff;border-radius:10px;font-size:1.2rem;flex-shrink:0}
.studio-quicktools button.active{background:#ebe6ff;border:2px solid #8f7bea}
.studio-quickcolors{display:flex;overflow-x:auto;align-items:center;gap:6px;scrollbar-width:none;min-width:0;padding:4px 3px}
.studio-quickcolors::-webkit-scrollbar{display:none}
.studio-quick-swatch{min-width:32px;width:32px;height:32px;border:2px solid white;border-radius:50%;box-shadow:0 0 0 1px #cecfdb;padding:0;flex-shrink:0}
.studio-quick-swatch.selected{box-shadow:0 0 0 2.5px #7b63d8}
}
@media(max-width:540px){.studio-quicktools button{height:36px;width:36px}.studio-quick-swatch{min-width:31px;width:31px;height:31px}}
