/* Account, recovery and workspace controls. */
#auth-dialog{border:1px solid #b7dcd4;border-radius:24px;max-width:440px;width:calc(100% - 32px);padding:28px;color:#174e46;background:#fffef8;font:inherit}#auth-dialog::backdrop{background:#083f466b}#auth-form{display:grid;gap:14px}#auth-form label{display:grid;gap:6px}#auth-form input,.scope-bar input{font:inherit;min-height:44px;border:1px solid #b9d5ce;border-radius:10px;padding:8px 12px;max-width:100%;box-sizing:border-box}#auth-form .check{display:flex;align-items:center;gap:8px}#auth-form input[type=checkbox]{min-height:24px}#auth-error{color:#a12e3a;min-height:1.4em}#auth-close{float:right;border:0;background:transparent;font-size:24px}#auth-invite-label[hidden]{display:none}.import-errors{color:#a12e3a}.bank-table{width:100%;border-collapse:collapse}.bank-table td,.bank-table th{text-align:left;padding:8px;border-bottom:1px solid #d2e5df}.bank-scroll{overflow:auto}.bank-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}

.factory-question{display:flex;align-items:flex-start;gap:10px;margin:12px 0}.factory-question input{min-width:24px;min-height:24px}.factory-print-preview{background:#fff;color:#172b28;border:1px solid #bdd3cd;padding:24px;margin:20px 0}.factory-print-preview li{margin-bottom:18px}.factory-print-preview p{white-space:pre-wrap}#factory-form fieldset{border:1px solid #bdd3cd;margin:18px 0;max-height:420px;overflow:auto}#factory-form input[name=title]{font:inherit;width:100%;min-height:44px;border-radius:10px;border:1px solid #bdd3cd;padding:8px}

.factory-preview-image{display:block;max-width:100%;max-height:240px;object-fit:contain;margin:12px 0}.factory-preview-image.grayscale{filter:grayscale(1)}

#account-dialog,#recover-dialog{border:1px solid #b7dcd4;border-radius:24px;max-width:460px;width:calc(100% - 32px);max-height:85dvh;overflow:auto;padding:24px;color:#174e46;background:#fffef8;font:inherit;box-sizing:border-box}#account-dialog::backdrop,#recover-dialog::backdrop{background:#083f466b}#account-dialog label,#recover-form label{display:grid;gap:6px;margin:12px 0}#account-dialog input,#account-dialog textarea,#recover-dialog input,#factory-criteria{font:inherit;min-height:44px;min-width:0;width:100%;max-width:100%;box-sizing:border-box;border:1px solid #b9d5ce;border-radius:10px;padding:8px 10px}#account-codes{font-size:11px;word-break:break-all}#account-close,#recover-close{float:right;border:0;background:transparent;font-size:24px}#account-dialog button,#recover-dialog button{max-width:100%;white-space:normal}
/* Keep the added account controls inside narrow V2 headers. */
#auth-dialog{box-sizing:border-box;max-height:calc(100dvh - 24px);overflow:auto}.topbar-end{min-width:0}#factory-builder,#factory-controls{min-width:0}
@media(max-width:540px){.teacher-topbar{height:auto;min-height:49px;flex-wrap:wrap;padding-top:8px;padding-bottom:8px}.teacher-topbar .crumb{min-width:0;overflow-wrap:anywhere}.topbar-end{flex-wrap:wrap;gap:8px;max-width:100%}.topbar-end .action-button{font-size:12px;padding:8px 12px;min-height:40px}.student-topbar>[data-account-security],.student-topbar>[data-secure-logout]{font-size:11px;padding:7px 10px;min-height:40px}}
/* Drawer navigation keeps V2 content and approved artwork intact. */
.teacher-app:not([hidden]){display:block}.teacher-topbar,.student-topbar{display:flex;align-items:center;gap:12px;height:auto;min-height:72px;padding:12px 24px;background:linear-gradient(110deg,#e8fff5,#f3fdff)}.header-brand{flex:1;min-width:0;color:#126875}.header-brand img{width:40px;height:40px;object-fit:contain}.header-brand strong{font-size:18px}.header-brand small{font-size:8px;letter-spacing:.12em}.menu-toggle{width:46px;min-height:46px;border:0;border-radius:14px;font-size:25px;background:#08aaa4;color:white;cursor:pointer;flex-shrink:0}.profile-toggle{display:flex;align-items:center;gap:7px;border:1px solid #b7dcd4;border-radius:30px;padding:5px 11px 5px 5px;background:white;color:#174e46;font:inherit;font-size:12px;font-weight:800;cursor:pointer;min-height:46px;flex-shrink:0}.profile-toggle .avatar-bubble{font-size:11px;max-width:42px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.current-section{font-size:12px;font-weight:900;color:#00877f;margin:0 0 8px}.workspace-drawer{inset:0 auto 0 0;margin:0;border:0;padding:0;border-radius:0 24px 24px 0;width:min(340px,calc(100vw - 32px));max-width:none;height:100dvh;max-height:100dvh;background:#123c47;color:white;overflow:auto;box-sizing:border-box}.workspace-drawer::backdrop,.profile-popover::backdrop{background:#082f426b;backdrop-filter:blur(2px)}.workspace-drawer[open]{animation:vee-drawer-in .18s ease-out}.workspace-drawer .teacher-sidebar,.student-drawer-content{display:flex!important;flex-direction:column;width:100%;min-height:100%;height:auto;padding:24px;box-sizing:border-box;position:static}.drawer-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}.drawer-heading h2{font-size:18px;margin:0}.drawer-heading [data-menu-close]{width:40px;min-height:40px;border:0;border-radius:12px;background:#ffffff20;color:inherit;font-size:26px;cursor:pointer}.workspace-drawer nav{display:flex;flex-direction:column;gap:10px;margin:22px 0;overflow:visible;width:100%}.workspace-drawer nav button{display:flex;align-items:center;gap:12px;min-height:52px;width:100%;border:0;border-radius:14px;padding:12px 15px;background:#ffffff10;color:white;text-align:left;font:inherit;font-size:14px;font-weight:800;cursor:pointer;white-space:normal}.workspace-drawer nav button[aria-current=page]{background:#14bbb0;color:#073841;box-shadow:0 5px 16px #002e4022}.workspace-drawer .progress-nav{border:1px solid #ffe18a;background:#ffe18a22;color:#ffe8a8}.student-drawer-content .brand{font-size:20px}.student-drawer-content .brand img{width:44px;height:44px}.student-drawer-content .switch-world{margin-top:auto}.profile-popover{inset:76px 16px auto auto;margin:0;width:min(330px,calc(100vw - 24px));max-height:calc(100dvh - 100px);overflow:auto;border:1px solid #b7dcd4;border-radius:22px;padding:22px;background:#fffef9;color:#174e46;box-sizing:border-box}.profile-popover .drawer-heading{margin-bottom:14px}.profile-popover .drawer-heading [data-menu-close]{background:#e6f6ef}.profile-popover strong{display:block;overflow-wrap:anywhere}.profile-action{display:block;width:100%;min-height:46px;margin:10px 0 0;border:0;border-radius:12px;padding:12px;background:#e6f8f3;text-align:left;color:#126875;font:inherit;font-size:13px;font-weight:800;cursor:pointer}.profile-action[hidden]{display:none}.signout-action{background:#ffe3d9;color:#963b28}.profile-popover p{font-size:13px;color:#668986}.menu-toggle:focus-visible,.profile-toggle:focus-visible,.workspace-drawer button:focus-visible,.profile-action:focus-visible{outline:3px solid #ffcb55;outline-offset:3px}@keyframes vee-drawer-in{from{transform:translateX(-25px);opacity:.4}to{transform:translateX(0);opacity:1}}@media(max-width:540px){.teacher-topbar,.student-topbar{gap:8px;min-height:64px;padding:9px 12px;flex-wrap:nowrap}.header-brand img{width:32px;height:32px}.header-brand strong{font-size:15px}.header-brand small{font-size:6px}.profile-toggle{padding-right:8px}.profile-toggle>span:last-child{display:none}.menu-toggle{width:44px;min-height:44px}.profile-popover{top:66px}}@media(prefers-reduced-motion:reduce){.workspace-drawer[open]{animation:none}}

.attendance-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid #bce6df;flex-wrap:wrap}.attendance-row span{overflow-wrap:anywhere}.attendance-row select{min-height:46px;max-width:100%}#attendance-day{display:block;min-height:46px;max-width:100%;margin-top:8px}

.factory-paper-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.factory-paper-choice{display:grid!important;justify-items:center;gap:5px;border:2px solid #d8cbe6;border-radius:14px;padding:10px;background:#fff;color:#352842;cursor:pointer}.factory-paper-choice:has(input:checked){background:#f2e8ff;border-color:#8050b1}.factory-paper-choice input{width:20px;height:20px;accent-color:#8050b1}.factory-paper-choice b{font-size:12px}.factory-paper-thumb{display:block;width:75px;height:75px;background-image:url('/reading/valyren/assets/worksheet-crew-colour-v1.png');background-size:150px 150px;background-repeat:no-repeat}.factory-paper-thumb.story{background-position:left top}.factory-paper-thumb.cards{background-position:right bottom}.factory-paper-thumb.comic{background-position:right top}.factory-paper-thumb.workshop{background-position:left bottom}#factory-paper-templates[hidden]{display:none}#factory-paper-preview{max-height:650px;overflow:auto;background:#e9eeee;border-radius:14px;padding:15px;margin-top:18px}#factory-paper-preview img{display:block;width:min(100%,700px);height:auto;margin:0 auto 16px;box-shadow:0 2px 12px #0002}@media(max-width:650px){.factory-paper-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Shared account rhythm also covers dynamically mounted class controls. */
:is(#account-dialog,#recover-dialog,#auth-dialog){background:var(--teacher-cream,#fff8ee);border-color:var(--teacher-line,#d5e5df);border-radius:26px;padding:28px;box-shadow:0 24px 80px #103f472b;line-height:1.55;scrollbar-width:thin}
:is(#account-dialog,#recover-dialog,#auth-dialog)::backdrop{background:#123c4773;backdrop-filter:blur(5px)}
:is(#account-dialog,#recover-dialog,#auth-dialog) h2{font-family:Nunito,sans-serif;font-size:26px;line-height:1.2;margin:8px 44px 20px 0;color:#17565a}
:is(#account-dialog,#recover-dialog,#auth-dialog) h3{font-family:Nunito,sans-serif;font-size:19px;line-height:1.3;margin:0 0 12px;color:#17565a}
:is(#account-dialog,#recover-dialog,#auth-dialog) label{font-size:13px;font-weight:800;line-height:1.5;gap:7px}
:is(#account-dialog,#recover-dialog,#auth-dialog) :is(input:not([type=checkbox]),textarea,select){background:#fff;border:1px solid #c2dcd4;border-radius:12px;min-height:46px;padding:11px 13px;color:#234d50;font:inherit;font-size:14px;width:100%;max-width:100%;box-sizing:border-box;transition:border-color .15s,box-shadow .15s}
:is(#account-dialog,#recover-dialog,#auth-dialog) :is(input,textarea,select):focus{border-color:#07898e;box-shadow:0 0 0 3px #0c9a9b15;outline:none}
:is(#account-dialog,#recover-dialog,#auth-dialog) button:not([hidden]){font:inherit;font-size:13px;font-weight:800;min-height:44px;border:1px solid #bedcd4;border-radius:12px;padding:11px 15px;background:#edf8f3;color:#155c60;cursor:pointer;line-height:1.4;transition:background .15s,transform .15s,box-shadow .15s}
:is(#account-dialog,#recover-dialog,#auth-dialog) button:not(:disabled):hover{background:#dff2e9;box-shadow:0 3px 10px #174e4610}
:is(#account-dialog,#recover-dialog,#auth-dialog) button:not(:disabled):active{transform:translateY(1px)}
:is(#account-dialog,#recover-dialog,#auth-dialog) button.strong{border-color:#05898e;background:linear-gradient(135deg,#05898e,#0c9a9b);color:white;box-shadow:0 5px 13px #05898e1a}
:is(#account-dialog,#recover-dialog,#auth-dialog) button.danger{border-color:#e9c7b8;background:#fff0e7;color:#8c4c37}
:is(#account-dialog,#recover-dialog,#auth-dialog) button:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}
:is(#account-dialog,#recover-dialog,#auth-dialog) :focus-visible{outline:3px solid #f9bb4d;outline-offset:3px}
:is(#account-close,#recover-close,#auth-close){position:sticky;top:0;float:right;display:grid;place-items:center;width:42px;min-width:42px;padding:0!important;font-size:26px!important;border-radius:50%!important;z-index:2}
:is(#auth-form,#recover-form,#account-form){display:grid;gap:12px;min-width:0}
:is(#auth-form,#recover-form,#account-form) label{margin:0}
#account-form{border-top:1px solid #d8e7df;margin-top:24px;padding-top:24px}
#account-dialog .inline-actions,#account-email-security .inline-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
#account-dialog .inline-actions>button{flex:1 1 135px}
#account-dialog .tiny,#recover-dialog .tiny,#auth-dialog .tiny{font-size:12px;line-height:1.65;color:#607c76}
#private-profile-details{padding:14px 16px;margin-bottom:18px;border:1px solid #d4e6dc;border-radius:16px;background:#f2faf4;overflow-wrap:anywhere}
#private-profile-details:empty{display:none}#private-profile-details p{margin:0 0 5px}
#account-email-security{margin-top:20px;padding:18px;background:#fff;border:1px solid #d7e8df;border-radius:18px}
#account-email-security p{font-size:13px;line-height:1.6;margin:8px 0 14px;overflow-wrap:anywhere}
#account-email-status{display:flex;align-items:center;gap:8px;color:#6c735b}
#account-email-status[data-verified=true]{color:#24745e}
#account-email-status[data-verified=true]::before{content:'✓';display:grid;place-items:center;flex-shrink:0;width:24px;height:24px;border-radius:50%;background:#e6f5ec;font-weight:900}
#profile-class-manager{padding:0;background:transparent;border:0;box-shadow:none;margin-top:24px}
.profile-class-card{min-width:0;padding:18px;margin-top:16px;border:1px solid #d3e5dd;border-radius:20px;background:#fff;box-shadow:0 5px 16px #174e4605}
.profile-class-card[data-selected=true]{border-color:#6cbab0;box-shadow:inset 4px 0 #0c9a9b,0 5px 16px #174e4605}
.profile-class-title{display:block;font-family:Nunito,sans-serif;font-size:19px;line-height:1.4;color:#17565a}
.profile-class-card>.tiny{margin:8px 0 15px}
#profile-class-toggle{width:100%;margin-top:16px;border-style:dashed!important}
#profile-class-host{padding:18px;margin-top:14px;border:1px solid #d4e5db;border-radius:18px;background:#f2faf4}
#profile-class-form.scope-bar{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:0;margin:0;background:transparent;border:0;box-shadow:none}
#profile-class-form label{margin:0}
#profile-class-form button{margin-top:4px;width:100%}
#profile-class-status{margin-bottom:0;font-size:13px;color:#186c62;line-height:1.6}
.class-invitations{padding:0;border:1px solid #d4e6dd;border-radius:15px;margin-top:14px;background:#fbfdf9;min-width:0}
.class-invitations>summary{cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:50px;padding:12px 14px;font-size:14px;font-weight:800;color:#23665f}
.class-invitations>summary::-webkit-details-marker{display:none}.class-invitations>summary::after{content:'+';font-size:23px;font-weight:400;line-height:1}.class-invitations[open]>summary::after{content:'−'}
.class-invitations> :not(summary){margin-left:14px;margin-right:14px}.class-invitations>[data-invite-controls]{margin-bottom:14px}.class-invitations [data-invite-result]{overflow-wrap:anywhere}.class-invitations [data-invite-result] a{font-weight:800;color:#087b80;text-underline-offset:3px}
.class-invitations [data-invites-list]>p{display:grid;gap:10px;padding:12px;border-top:1px solid #deebe3;font-size:12px;line-height:1.6;margin:0}
.class-invitations [data-invites-list] button{justify-self:start}.class-invitations [data-invites-message]{font-size:13px;line-height:1.6;color:#1a6b63}
.class-archive-confirmation{padding:14px;background:#fff5e8;border:1px solid #e9d5b3;border-radius:14px;margin-top:14px;display:flex;gap:8px;flex-wrap:wrap}
.class-archive-confirmation[hidden]{display:none}.class-archive-confirmation p{flex-basis:100%;margin:0 0 5px;font-size:13px;line-height:1.65;color:#805538}.class-archive-confirmation button{flex:1 1 130px}
:is(#account-message,#recover-message,#auth-error,#account-email-message){font-size:13px;line-height:1.65;overflow-wrap:anywhere}
#account-codes{font-family:ui-monospace,monospace;font-size:13px;min-height:170px;background:#fffdf7;line-height:1.8}
:is(#email-verify-panel,#email-login-form){padding:18px;border:1px solid #d0e5dc;border-radius:18px;background:#fff;margin-top:16px}
#email-login-code{text-align:center;letter-spacing:.28em;font-size:22px!important;font-variant-numeric:tabular-nums}
:is(#auth-create,#auth-signin)[aria-pressed=true]{background:#ddf2e9;border-color:#6ab6a8;color:#145b5c}
:is(#account-dialog,#recover-dialog,#auth-dialog) button[aria-busy=true]::before{content:'';display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;vertical-align:-2px;margin-right:8px;animation:vee-control-spin .7s linear infinite}
@keyframes vee-control-spin{to{transform:rotate(360deg)}}
@media(max-width:540px){:is(#account-dialog,#recover-dialog,#auth-dialog){width:calc(100% - 20px);padding:20px;max-height:calc(100dvh - 20px)}.profile-class-card{padding:15px}.profile-class-card>.inline-actions>button{flex-basis:100%}#account-email-security{padding:15px}.class-invitations>summary{padding:12px}.class-invitations> :not(summary){margin-left:12px;margin-right:12px}}
@media(prefers-reduced-motion:reduce){:is(#account-dialog,#recover-dialog,#auth-dialog) button{transition:none}:is(#account-dialog,#recover-dialog,#auth-dialog) button[aria-busy=true]::before{animation:none}}

#auth-submit{border-color:#05898e!important;background:linear-gradient(135deg,#05898e,#0c9a9b)!important;color:#fff!important;box-shadow:0 5px 13px #05898e1a}
#auth-form fieldset{min-width:0;border:1px solid #d3e5dc;border-radius:17px;padding:16px;background:#fff;display:grid;gap:13px}#auth-form fieldset[hidden]{display:none}#auth-form legend{padding:0 7px;color:#406f65;font-size:12px;font-weight:800}.auth-tabs{display:flex;gap:8px;margin-bottom:20px}.auth-tabs>button{flex:1}
#recover-submit,#account-generate{width:100%}#account-download-codes{width:100%;margin-top:10px}#account-change-password{width:100%;border-color:#e9c7b8!important;background:#fff0e7!important;color:#8c4c37!important}
