/* Class Painter v163: approved teacher-facing palette; no paid/proprietary fonts.
   Fredoka (headings) and Nunito (body) load from Google Fonts, both OFL-licensed.
   The application still works with local font fallbacks if a school blocks Google Fonts. */
:root{--cp-ink:#282044;--cp-purple:#6a51bf;--cp-purple-dark:#4e388f;--cp-purple-light:#ede8fc;--cp-yellow:#ffe782;--cp-yellow-soft:#fff2b2;--cp-cream:#fffdf7;--cp-line:#ded5f3;}
header{background:linear-gradient(115deg,#fffaf0,#fffdf9 68%,#f8f4ff);border-color:#eee3ce;box-shadow:0 2px 14px #4e388f0b;padding:12px 22px;color:var(--cp-ink)}
header .cp-brand{display:flex;align-items:center;gap:12px;min-width:0}
header .cp-palette-logo{width:48px;height:48px;flex:none;filter:drop-shadow(0 2px 1px #6b55a322)}
header h1{font:700 clamp(25px,2.4vw,34px)/1.06 'Fredoka','Nunito',system-ui,sans-serif;letter-spacing:-.5px;color:#47327c}
header .small{color:#534872;font-size:12px;font-weight:700;margin-top:3px}
#mainHeaderNav>button,#teacherAccountTop>button{background:#f5f0ef;border:1px solid #f0e7e4;color:#392967;font-weight:800;min-height:40px;padding:9px 16px}
#mainHeaderNav>button:hover,#teacherAccountTop>button:hover{background:#eae3fb;border-color:#c9b9f2}
#teacherAccountTop #taTopAccount{background:linear-gradient(180deg,#7860cf,#6248b4);color:white;border-color:#6248b4}
#teacherAccountTop #taTopStatus{color:#55447b;font-size:12px;font-weight:700}
/* Teacher's reusable classroom setup, not the drawing canvas or student painter. */
#homeView{background:var(--cp-cream);border-color:#eee3d8;color:var(--cp-ink);background-image:none}
#homeView>h2,#teacherView h2,#teacherView h3{font-family:'Fredoka','Nunito',system-ui,sans-serif;color:#302356}
#homeView>h2{font-size:26px;margin:6px 0 14px}
#homeView .teacher-setup{background:linear-gradient(155deg,#fcf9ff,#faf5ff);border:1px solid #e7dcf5;border-radius:16px;padding:16px}
#homeView .teacher-setup>b{font-family:'Fredoka','Nunito',system-ui,sans-serif;font-size:21px;color:var(--cp-ink)}
#homeView button.purple,#homeView .ta-activity-setup button,#homeView #taSaveActivity,#homeView #taOpenBanks{background:#6951bf;color:white}
#homeView label,#teacherView label{font-weight:700;color:#32264f}
#homeView select,#homeView input:not([type=checkbox]),#teacherView select{border:1px solid #cbbce8;border-radius:10px;background:#fff;padding:9px 11px;max-width:100%}
#homeView #createClassBtn{background:linear-gradient(180deg,#7960d3,#6244b4);color:white;border-radius:12px;box-shadow:0 3px 8px #6951bf25}
/* File Manager remains a dialog with the same input ids, events, ownership checks, and server calls. */
#teacherAccountDialog{width:min(1090px,97vw)!important;max-width:97vw!important;max-height:92dvh!important;padding:0!important;border:1px solid #ddd1f3!important;border-radius:21px!important;background:var(--cp-cream)!important;color:var(--cp-ink)!important;font:400 15.5px/1.5 'Nunito',system-ui,-apple-system,sans-serif!important;box-shadow:0 18px 55px #2a194842}
#teacherAccountDialog .ta-header{position:sticky;top:0;z-index:8;padding:14px 22px;background:linear-gradient(100deg,#fffaf0,#fffefb);border-bottom:1px solid #ece2ed;box-shadow:0 3px 10px #33245506}
#teacherAccountDialog .ta-header h2{font:600 24px/1.2 'Fredoka','Nunito',sans-serif;color:#342461;margin:0}
#teacherAccountDialog #taStatus{margin:0;padding:4px 22px;min-height:0;color:#5c4e76;font-size:12px}
#teacherAccountDialog #taFilesPanel{padding:0 17px 22px}
#teacherAccountDialog #taAccountPanel{padding:6px 22px 24px;max-width:760px;margin:auto}
#teacherAccountDialog #taAccountPanel h3{font-family:'Fredoka','Nunito',sans-serif;color:#2f2256}
#teacherAccountDialog #taBilling{background:#fff;padding:17px;border-color:#e2d8f4;border-radius:13px}
#teacherAccountDialog .ta-file-layout{display:grid;grid-template-columns:215px minmax(0,1fr);gap:20px;align-items:start}
#teacherAccountDialog .ta-file-nav{position:sticky;top:81px;align-self:start;padding:14px 10px 15px;border-radius:17px;background:linear-gradient(155deg,#fefcff,#f8f2ff);border:1px solid #eee3f7;display:flex;flex-direction:column;gap:5px}
#teacherAccountDialog .ta-file-nav-title{font:600 19px/1.2 'Fredoka','Nunito',sans-serif;color:#312552;padding:7px 8px 14px}
#teacherAccountDialog .ta-nav-link{text-decoration:none;color:#3b3162;border-radius:10px;padding:10px 8px;display:flex;gap:10px;align-items:center;font-size:14px;font-weight:800;line-height:1.25}
#teacherAccountDialog .ta-nav-link:hover{background:#f4eecf}
#teacherAccountDialog .ta-nav-link.ta-nav-current,#teacherAccountDialog .ta-nav-link:focus-visible{background:linear-gradient(90deg,#ffe17b,#ffeb99);color:#312451;outline:1px solid #f0d167}
#teacherAccountDialog .ta-nav-symbol{font-size:20px;min-width:22px;text-align:center;color:#574394}
#teacherAccountDialog .ta-nav-help{border-top:1px solid #e6daf2;margin:12px 5px 0;padding:12px 4px 0;color:#6a5c82;font-size:12px;line-height:1.5}
#teacherAccountDialog .ta-file-main{min-width:0;padding:2px 2px 20px}
#teacherAccountDialog .ta-files-top{padding:12px 6px 14px;align-items:start;gap:10px}
#teacherAccountDialog .ta-files-top h3{font:600 23px/1.2 'Fredoka','Nunito',sans-serif;color:#322450}
#teacherAccountDialog .ta-files-top .ta-muted{color:#615474;font-size:13px;margin:4px 0}
#teacherAccountDialog .ta-files-right{max-width:340px;flex:1;min-width:210px}
#teacherAccountDialog .ta-files-right small{font:700 12px/1.4 'Nunito',sans-serif;color:#655879}
#teacherAccountDialog .ta-section{margin:12px 0 18px;padding:0 15px 18px;border:1px solid #e9e2f1;border-radius:16px;background:#fffefa;box-shadow:0 3px 12px #2d22500b;scroll-margin-top:105px}
#teacherAccountDialog .ta-section>h3{margin:0 -15px 13px;padding:13px 16px;background:linear-gradient(98deg,#ffe681,#ffefab 75%,#fff7ce);border-bottom:1px solid #f1d87e;border-radius:16px 16px 10px 10px;font:600 21px/1.25 'Fredoka','Nunito',system-ui,sans-serif;letter-spacing:0;color:#30234d}
#teacherAccountDialog #taExpiringSection{border:1px solid #e7dfef;padding-bottom:12px}
#teacherAccountDialog #taExpiringSection>h3{background:linear-gradient(95deg,#fff2bf,#fff8df);font-size:18px}
#teacherAccountDialog #taExpiringSoon{font-size:14px}
#teacherAccountDialog .ta-section>p{margin:5px 0 12px;color:#554b6e;line-height:1.46;font-size:14px}
#teacherAccountDialog button:not(.ta-order-button):not(.ta-class-grip){background:linear-gradient(180deg,#795fd0,#6249b7);border:1px solid #634bb7;border-radius:10px;color:#fff;font-weight:800;line-height:1.25;padding:10px 15px;margin:4px 4px 4px 0;box-shadow:0 2px 5px #36256517;transition:background .14s ease,transform .14s ease}
#teacherAccountDialog button:hover:not(:disabled){filter:brightness(1.06)}
#teacherAccountDialog button:active:not(:disabled){transform:translateY(1px)}
#teacherAccountDialog .ta-header #taClose,#teacherAccountDialog #taShowBanks,#teacherAccountDialog #taRefresh{background:#e9e3fa;border-color:#d8cdf3;color:#473777}
#teacherAccountDialog #taBankControls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px;background:#fdfbff;border:1px solid #e9e2fa;border-radius:13px;margin:14px 0 12px}
#teacherAccountDialog #taBankControls>label{grid-column:1/-1;display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px;align-items:center;color:#30274d;font-weight:800;line-height:1.4}
#teacherAccountDialog input:not([type=checkbox]),#teacherAccountDialog select{font-family:'Nunito',system-ui,sans-serif;font-size:15px;color:#322750;min-width:0;max-width:100%;border:1px solid #cfc4e9;border-radius:9px;background:white;padding:9px 11px;line-height:1.3}
#teacherAccountDialog input[type=file]{padding:5px;max-width:100%;width:100%;font-size:13px}
#teacherAccountDialog input[type=file]::file-selector-button{font:700 13px 'Nunito',system-ui,sans-serif;background:#eee8fb;border:0;border-radius:8px;color:#40306f;padding:8px 12px;margin-right:10px;cursor:pointer}
#teacherAccountDialog #taBankControls>p,#teacherAccountDialog #taBankControls>#taBankStatus,#teacherAccountDialog #taBankControls>#taBankList,#teacherAccountDialog #taBankControls>#taBankPreview{grid-column:1/-1}#teacherAccountDialog #taBankControls>p{font-size:12px;color:#695e80;margin:0 0 2px 140px}
#teacherAccountDialog #taBankControls>button{justify-self:stretch;white-space:normal}
#teacherAccountDialog .ta-files-card{border:1px solid #d8cdee;background:#fff;border-radius:11px;padding:11px 12px;margin:9px 0}
#teacherAccountDialog .ta-files-card:hover{border-color:#aa97df}
#teacherAccountDialog .ta-files-card summary{color:#36295f;font-size:15px}
#teacherAccountDialog .ta-files-card .ta-class-order{padding-left:8px}
#teacherAccountDialog .ta-class-order button{background:#eee8fa!important;border:1px solid #ded4f3!important;color:#433374!important;box-shadow:none!important;min-width:30px}
#teacherAccountDialog .ta-files-card.ta-drag-over{outline-color:#6a51bf;background:#f4eeff}
#teacherAccountDialog #taSavedClasses{margin:12px 0}
#teacherAccountDialog .ta-activity-card{background:#faf7ff;border:1px solid #e5def4;border-radius:10px;padding:10px;margin:7px 0}
#teacherAccountDialog :is(button,input,select,a,summary):focus-visible{outline:3px solid #aa80f3;outline-offset:2px}
@media(max-width:860px){#teacherAccountDialog .ta-file-layout{grid-template-columns:1fr;gap:4px}#teacherAccountDialog .ta-file-nav{position:static;display:flex;flex-direction:row;overflow-x:auto;padding:7px;gap:6px;scrollbar-width:thin;border-radius:12px}#teacherAccountDialog .ta-file-nav-title,#teacherAccountDialog .ta-nav-help{display:none}#teacherAccountDialog .ta-nav-link{white-space:nowrap;font-size:12px;padding:9px 12px}#teacherAccountDialog .ta-files-top{padding:10px 2px}}
@media(max-width:560px){header{padding:9px 12px;gap:8px}header .cp-palette-logo{width:38px;height:38px}header h1{font-size:24px}#teacherAccountDialog{width:98vw!important;max-width:98vw!important;max-height:96dvh!important}#teacherAccountDialog .ta-header{padding:12px}#teacherAccountDialog #taFilesPanel{padding:0 9px 14px}#teacherAccountDialog .ta-files-right{align-items:flex-start;text-align:left}#teacherAccountDialog .ta-section{padding:0 10px 12px}#teacherAccountDialog .ta-section>h3{margin:0 -10px 12px;font-size:19px}#teacherAccountDialog #taBankControls{padding:10px;grid-template-columns:1fr}#teacherAccountDialog #taBankControls>label{grid-template-columns:1fr;gap:5px}#teacherAccountDialog #taBankControls>p{margin-left:0}#teacherAccountDialog .ta-file-nav{margin-top:4px}}
@media(prefers-reduced-motion:reduce){#teacherAccountDialog button{transition:none!important}}

/* Keep the policy visible next to the annual purchase action. */
#teacherAccountDialog .ta-billing-policy{margin:10px 0;max-width:58ch;font-size:13px;line-height:1.55;color:#413d51}
#teacherAccountDialog .ta-billing-policy a{color:#4636a5;text-decoration:underline;font-weight:650}
#teacherAccountDialog .ta-billing-policy a:focus-visible{outline:2px solid #4636a5;outline-offset:2px}
