
.with-sidebar .topbar{display:none}.with-sidebar main{min-height:100vh;padding-top:26px}.school-badge{text-decoration:none;color:var(--ink);overflow:hidden}.school-badge .avatar{margin:0 4px}.school-badge .nav-label{max-width:155px;overflow:hidden;text-overflow:ellipsis}.filter{align-items:flex-end}.filter button{height:42px;align-self:flex-end}.filter label{display:flex;flex-direction:column;gap:6px}.filter input,.filter select{margin:0}.profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;max-width:1100px}.mission-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:20px}.mission-card{overflow:hidden;padding:20px}.mission-cover{width:calc(100% + 40px);height:170px;object-fit:cover;margin:-20px -20px 10px}.mission-placeholder{display:grid;place-items:center;background:#dcf7ec;color:#00856b;font-size:50px}.mission-actions{padding:16px;border-top:1px solid var(--border)}.mission-award{margin-bottom:8px}.attitude-panel{max-height:calc(100vh - 35px);overflow:auto}.profile-grid .helptext{font-size:12px;color:var(--muted)}
html[data-theme="dark"]{color-scheme:dark;--ink:#e2f4ed;--muted:#a3b8ae;--paper:#171b19;--border:#39433e;--surface:#202723}
html[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] :is(.sidebar,.topbar,.card,.table-wrap,.attitude-panel,.editor-card,dialog,.row-menu,.secondary,.entry,.reward-card,.order-card){background:var(--surface);color:var(--ink);border-color:var(--border)}
html[data-theme="dark"] :is(input:not([type=checkbox]),select,textarea){background:#1b211e;color:var(--ink);border-color:var(--border)}
html[data-theme="dark"] :is(th,.roster-table th,.school-badge,.panel-tab,.panel-bottom,.roster-table tr:has(input:checked)){background:#28332d;color:var(--ink)}
html[data-theme="dark"] td{border-color:var(--border)}html[data-theme="dark"] :is(.sidebar nav a,.sidebar-bottom button){color:#b6d5c7}html[data-theme="dark"] a{color:#69ddba}html[data-theme="dark"] .primary{color:white}html[data-theme="dark"] .notice{background:#224f3f;color:#e2f4ed}
@media(prefers-color-scheme:dark){html[data-theme="auto"]{color-scheme:dark;--ink:#e2f4ed;--muted:#a3b8ae;--paper:#171b19;--border:#39433e;--surface:#202723}}
@media(max-width:700px){.profile-grid{grid-template-columns:1fr}.with-sidebar .topbar{display:flex;height:50px;padding:8px 18px}.with-sidebar main{padding-top:16px}.filter{flex-wrap:wrap}.filter .search-field{flex-basis:100%}}

@media(prefers-color-scheme:dark){html[data-theme="auto"] body{background:var(--paper);color:var(--ink)}
html[data-theme="auto"] :is(.sidebar,.topbar,.card,.table-wrap,.attitude-panel,.editor-card,dialog,.row-menu,.secondary,.entry,.reward-card,.order-card){background:var(--surface);color:var(--ink);border-color:var(--border)}
html[data-theme="auto"] :is(input:not([type=checkbox]),select,textarea){background:#1b211e;color:var(--ink);border-color:var(--border)}
html[data-theme="auto"] :is(th,.roster-table th,.school-badge,.panel-tab,.panel-bottom,.roster-table tr:has(input:checked)){background:#28332d;color:var(--ink)}
html[data-theme="auto"] td{border-color:var(--border)}html[data-theme="auto"] :is(.sidebar nav a,.sidebar-bottom button){color:#b6d5c7}html[data-theme="auto"] a{color:#69ddba}html[data-theme="auto"] .primary{color:white}html[data-theme="auto"] .notice{background:#224f3f;color:#e2f4ed}
}
#editor-dialog{overflow:hidden;padding:8px;max-height:88dvh;background:var(--surface,#fff);border-radius:24px}
#editor-dialog .editor-card{max-height:calc(88dvh - 16px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:#91aaa0 transparent;scrollbar-gutter:stable;border-radius:18px;padding:18px 20px}
.editor-card .dialog-heading{margin-bottom:20px}.editor-card .photo-picker{margin-bottom:4px}
.sidebar .school-badge{position:relative;height:59px;min-height:59px}
.sidebar:not(:hover):not(:focus-within) .school-badge:has(.avatar img){padding:0}
.sidebar:not(:hover):not(:focus-within) .school-badge:has(.avatar img) .avatar{position:absolute;inset:0;width:100%;height:100%;margin:0;border-radius:15px}
.sidebar:is(:hover,:focus-within) .school-badge .avatar,.menu-open .sidebar .school-badge .avatar{position:static;width:34px;height:34px;margin:0 4px;border-radius:50%}
.sidebar .brand-text{color:#00a982}.sidebar .brand-accent{color:#163d35}.sidebar .brand-text small{color:var(--muted)}
.searchable-select{position:relative;min-width:230px}.search-options{position:absolute;top:calc(100% + 6px);left:0;right:0;max-height:260px;overflow:auto;border:1px solid var(--border);border-radius:15px;background:var(--surface,#fff);box-shadow:0 8px 25px #0002;z-index:12;padding:6px}.search-options button{display:block;width:100%;height:auto;text-align:left;border:0;background:transparent;color:var(--ink);padding:10px;border-radius:9px}.search-options button:hover,.search-options button:focus{background:#00856b22}.search-options p{padding:8px;font-size:12px}
@media(max-width:800px){.with-sidebar .topbar{display:flex;height:50px;padding:8px 18px}.sidebar .school-badge .avatar{position:static!important;width:34px!important;height:34px!important;margin:0 4px!important;border-radius:50%!important}.sidebar .school-badge{padding:10px 4px!important}}

html[data-theme="dark"] :is(.catalog-card,.list-footer,.photo-upload,.photo-square,.new-reward-card,.add-manual,.search-options){background:#202723;color:var(--ink);border-color:var(--border)}html[data-theme="dark"] :is(.class-name,.xp-mark,.summary-line strong,.shop-tabs a.selected){color:#70c9a7}html[data-theme="dark"] .sidebar nav a.active{background:#2b3e34;color:#99dfc0}html[data-theme="dark"] .brand-accent{color:#82b5a2}html[data-theme="dark"] .attitude-row:hover{background:#2b3e34}
@media(prefers-color-scheme:dark){html[data-theme="auto"] :is(.catalog-card,.list-footer,.photo-upload,.photo-square,.new-reward-card,.add-manual,.search-options){background:#202723;color:var(--ink);border-color:var(--border)}html[data-theme="auto"] :is(.class-name,.xp-mark,.summary-line strong,.shop-tabs a.selected){color:#70c9a7}html[data-theme="auto"] .sidebar nav a.active{background:#2b3e34;color:#99dfc0}html[data-theme="auto"] .brand-accent{color:#82b5a2}html[data-theme="auto"] .attitude-row:hover{background:#2b3e34}}
html[data-theme="dark"] .photo-plus{color:#94d6b8}
@media(prefers-color-scheme:dark){html[data-theme="auto"] .photo-plus{color:#94d6b8}}

.quiz-editor-grid{display:grid;grid-template-columns:minmax(260px,1fr) minmax(350px,2fr);gap:24px}.quiz-question{margin:0 0 24px;padding:20px;border:1px solid var(--border);border-radius:18px}.quiz-option{display:flex;align-items:center;gap:10px;padding:8px;border:1px solid var(--border);border-radius:12px;margin-bottom:8px}.quiz-option input[type=radio]{width:18px!important;height:18px!important;flex:0 0 18px;margin:0!important;accent-color:var(--green)}.quiz-option input:not([type=radio]){margin:0}.quiz-option .secondary{padding:6px 10px}.quiz-question>button{margin:8px 8px 0 0}.sidebar nav{overflow-y:auto;overflow-x:hidden;min-height:0}.sidebar-bottom{flex-shrink:0}@media(max-width:850px){.quiz-editor-grid{grid-template-columns:1fr}}

.sidebar nav{scrollbar-width:none;-ms-overflow-style:none;overscroll-behavior:contain}.sidebar nav::-webkit-scrollbar{display:none}.quiz-delete{display:inline-block;margin:8px 0 0 8px}.danger{color:#cc6359}.quiz-card{overflow:hidden}.quiz-cover{display:block;width:calc(100% + 56px);max-width:none;height:170px;object-fit:cover;margin:-28px -28px 20px}.quiz-answer-cover{width:100%;max-height:280px;object-fit:cover;border-radius:20px}.quiz-editor-grid>*{min-width:0}.quiz-option input:not([type=radio]){min-width:0}.card,fieldset{min-width:0}h1,h2,h3,p,.nav-label{overflow-wrap:anywhere}img{max-width:100%}
@media(max-height:700px) and (min-width:801px){.sidebar{padding-top:12px;padding-bottom:10px}.sidebar .brand{margin-bottom:16px}.school-badge{margin-bottom:12px}.sidebar nav{gap:3px}.sidebar nav a{padding-top:5px;padding-bottom:5px}}
@media(max-width:1024px) and (orientation:portrait),(hover:none) and (pointer:coarse){
.with-sidebar .app-shell{margin-left:0}.with-sidebar .topbar{display:flex;height:56px;padding:8px 18px;position:sticky;top:0;z-index:25;background:var(--surface,#fff)}.menu-toggle{display:block;min-height:40px;min-width:44px}.sidebar{transform:translateX(-100%);width:232px;max-width:85vw;transition:transform .2s}.menu-open .sidebar{transform:translateX(0)}.sidebar .nav-label,.sidebar .brand-text{opacity:1!important;pointer-events:auto!important}.sidebar .school-badge{padding:10px 4px!important}.sidebar .school-badge .avatar{position:static!important;width:34px!important;height:34px!important;margin:0 4px!important;border-radius:50%!important}.sidebar nav a,.sidebar-bottom button{min-height:44px}.sidebar{height:100dvh}.sidebar nav{flex:1}.sidebar-bottom{margin-top:12px}.with-sidebar main{padding:20px;min-height:calc(100dvh - 56px)}.roster-layout.has-selection{grid-template-columns:minmax(0,1fr)}.attitude-panel{position:fixed;top:auto;right:12px;bottom:12px;width:min(340px,calc(100vw - 24px));max-height:70dvh;z-index:26;overflow:auto}.panel-scroll{max-height:30dvh}.profile-grid,.quiz-editor-grid{grid-template-columns:1fr}.table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.roster-table table{min-width:660px}.page-heading{flex-wrap:wrap;gap:14px}.filter{flex-wrap:wrap}.filter .search-field{flex-basis:100%}.filter label{flex:1;min-width:180px}.filter input,.filter select{font-size:16px;height:44px}.primary,.secondary,.row-actions-button{min-height:44px}.quiz-option{min-height:48px}.quiz-option input:not([type=radio]),textarea{font-size:16px}.searchable-select{min-width:0}.search-options button{min-height:44px}#editor-dialog{max-width:560px;width:calc(100% - 24px);max-height:88dvh}.mission-grid{grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr))}.catalog-grid{grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr))}
}
.student-toolbar,.csv-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.csv-actions{gap:0}.csv-actions a:first-child{border-radius:24px 0 0 24px}.csv-actions a:last-child{border-radius:0 24px 24px 0;border-left:0}.csv-upload{max-width:700px}.csv-upload label{display:block;margin:20px 0}.csv-upload input{margin-top:10px}.csv-preview{margin-top:24px;max-height:60vh;overflow:auto}.csv-preview th{position:sticky;top:0}.student-toolbar a{white-space:nowrap}@media(max-width:800px){.student-toolbar{width:100%}}
.page-heading .student-toolbar{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;gap:10px;width:auto}.student-toolbar .csv-actions{display:flex;flex-direction:row;flex-wrap:nowrap;gap:4px}.student-toolbar .csv-action{display:inline-flex;align-items:center;justify-content:center;padding:8px 11px;min-width:34px;min-height:34px;height:34px;border:1px solid var(--border);border-radius:20px!important;font-size:15px}.csv-action-label{max-width:0;opacity:0;overflow:hidden;white-space:nowrap;font-size:11px;transition:max-width .2s,opacity .2s,margin .2s}.csv-action:hover .csv-action-label,.csv-action:focus-visible .csv-action-label{max-width:70px;opacity:1;margin-left:6px}@media(pointer:coarse){.student-toolbar .csv-action{min-width:44px;min-height:44px}}@media(prefers-reduced-motion:reduce){.csv-action-label{transition:none}}
.roster-table input[hidden]{display:none!important}.roster-table tbody tr{cursor:pointer}.roster-table tbody tr.student-picked,.roster-table tbody tr:has(input[name=student_ids]:checked){outline:1px solid var(--selection-border);outline-offset:-1px;background:var(--selection-bg)!important;color:var(--selection-text);box-shadow:none}.roster-table tbody tr:not(:has(input[name=student_ids]:checked)){box-shadow:none}.student-card-editor{max-width:390px;margin:auto}.card-modal-title,.card-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}.card-modal-title h2{margin:0}.maker-id-card{margin:18px auto;max-width:300px}.maker-id-card svg{width:100%;height:auto;display:block}.card-download{display:block;text-align:center;margin:12px 0}.card-actions>*{flex:1}.card-actions form{margin:0}.card-actions button{width:100%}.card-link-form{margin-top:16px}.card-link-form input{width:100%}

.roster-table.view-cards input[type=checkbox]{display:none!important}.roster-table.view-list input[type=checkbox]{display:inline-block!important}.roster-table tr:not(:has(input[name=student_ids]:checked)){outline:none;background:inherit!important}
.pending-balance{display:inline-block;margin:4px;padding:4px 8px;border:1px solid #d3b665;border-radius:20px;background:#66502033;color:#dba92a;font-size:11px;font-weight:700;white-space:normal}[data-theme=dark] .pending-balance{color:#ffe091}

/* Student QR card: preview and actions stay side by side. */
#editor-dialog:has(.student-card-editor){width:min(760px,calc(100vw - 24px));max-width:760px;max-height:90dvh;padding:18px;overflow:hidden}
.student-card-editor{width:100%;max-width:720px;margin:auto}
.student-card-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:center;margin-top:12px}
.student-card-layout .maker-id-card{margin:0;max-width:100%;display:flex;justify-content:center;min-width:0}
.student-card-layout .maker-id-card>svg{width:auto;max-width:100%;height:auto;max-height:calc(90dvh - 110px)}
.student-card-controls{min-width:0;max-height:calc(90dvh - 110px);overflow-y:auto;scrollbar-width:thin;padding:2px}
.student-card-controls .card-download{margin:0 0 12px}
.student-card-controls .card-actions{flex-direction:column;gap:8px;align-items:stretch}
.student-card-controls .card-actions>*{flex:auto}
.student-card-controls .card-link-form{margin-top:12px}
.student-card-controls .card-link-form input{margin-bottom:10px;padding:8px}
.student-card-controls .helper{font-size:11px;line-height:1.4}
.student-card-controls>a:last-child{display:block;font-size:12px;margin-top:12px}
@media(max-width:480px){#editor-dialog:has(.student-card-editor){padding:12px}.student-card-layout{gap:12px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.student-card-controls .primary,.student-card-controls .secondary{padding:9px 8px;font-size:12px}.student-card-controls .helper{font-size:10px}.card-modal-title h2{font-size:20px}}

.student-card-layout .maker-id-card{display:grid;grid-template-columns:1fr 1fr;gap:8px}.card-side-preview{min-width:0}.card-side-preview>svg{width:100%;height:auto;max-height:calc(90dvh - 135px)}.card-side-preview>small{text-align:center;margin-bottom:5px}.student-card-controls .card-print{display:block;margin:0 0 12px;text-align:center}#print-cards-form{margin:0 0 14px}#print-cards-form button{background:#126b59;color:white}
