/* Working pages: clear module spacing, flexible actions and tables contained by their own scroll area. */
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-teacher-review,.page-writing-assessments,.page-admin) :is(.page-head,.section-heading,.learning-dashboard-head,.learning-section-head,.wallet-section-head,.assessment-heading,.writing-plan-heading) {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-bottom:var(--hb-layout-gap,20px);}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-teacher-review,.page-writing-assessments) :is(.page-heading,.account-person,.learning-dashboard-head>div:first-child,.assessment-heading>div:first-child,.writing-plan-heading>div:first-child) {min-width:0;flex:1 1 260px;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-teacher-review,.page-writing-assessments,.page-admin) :is(.page-head,.section-heading,.assessment-heading,.writing-plan-heading) :is(h1,h2,h3,p) {overflow-wrap:anywhere;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-teacher-review,.page-writing-assessments) :is(.account-profile-actions,.account-learning-actions,.learning-dashboard-actions,.learning-pagination,.learning-filters,.teacher-row-actions,.teacher-roster-toolbar-actions,.writing-plan-actions,.writing-plan-toolbar,.assessment-pagination,.form-actions,.modal-actions) {display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-width:0;max-width:100%;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-teacher-review,.page-writing-assessments) :is(.btn,.learning-button) {min-height:40px;max-width:100%;gap:8px;line-height:1.5;white-space:normal;text-align:center;flex-shrink:0;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-writing-assessments) .panel {min-width:0;padding:24px;border-color:var(--hb-layout-line,#e2e8f0);border-radius:8px;background:#fff;box-shadow:none;margin-bottom:var(--hb-layout-gap,20px);}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher,.page-classroom) .settings-grid {display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);align-items:start;gap:var(--hb-layout-gap,20px);}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher,.page-classroom,.page-wallet) .form-stack {gap:20px;min-width:0;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher,.page-classroom,.page-wallet,.page-writing-assessments) :is(.form-stack label:not(.setting-toggle),.writing-plan-form label,.assessment-form label) {display:grid;min-width:0;gap:8px;font-size:13px;line-height:1.65;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher,.page-classroom,.page-wallet,.page-writing-assessments) :is(.form-stack,.writing-plan-form,.assessment-form) :is(input:not([type=checkbox],[type=radio],[type=range]),textarea,select,.hb-select) {min-width:0;width:100%;max-width:100%;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher) :is(#settings-form,#assign-form) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher) :is(#settings-form,#assign-form)>:is(h2,.setting-toggle,.teacher-task-note,.notice,.modal-error,.form-actions,button) {grid-column:1/-1;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-settings #settings-form .setting-toggle {display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:48px;margin:0;padding:12px 0;border-top:1px solid var(--hb-layout-line,#e2e8f0);}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher,.page-classroom,.page-wallet,.page-writing-assessments) fieldset {min-width:0;border:1px solid var(--hb-layout-line,#e2e8f0);border-radius:8px;padding:18px;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher,.page-classroom,.page-wallet,.page-writing-assessments) .form-actions {justify-content:flex-end;padding-top:16px;border-top:1px solid var(--hb-layout-line,#e2e8f0);}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-wallet,.page-settings,.page-teacher,.page-classroom) .list-row {display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:12px 16px;min-width:0;padding:16px 0;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-wallet,.page-settings,.page-teacher,.page-classroom) .list-row>div:first-child {flex:1 1 200px;min-width:0;overflow-wrap:anywhere;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-teacher,.page-classroom,.page-admin,.page-teacher-review,.page-writing-assessments) :is(.table-scroll,.learning-table-wrap,.admin-table-wrap) {width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;border:1px solid var(--hb-layout-line,#e2e8f0);border-radius:6px;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-teacher,.page-classroom,.page-writing-assessments) :is(.table-scroll,.learning-table-wrap)>table:not([hidden]) {display:table;width:100%;min-width:640px;border-collapse:collapse;table-layout:auto;}
/* Restore table structure after earlier responsive card rules; hidden rows and cells stay hidden. */
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-teacher,.page-classroom,.page-writing-assessments) :is(.table-scroll,.learning-table-wrap)>table:not([hidden])>thead:not([hidden]) {display:table-header-group;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-teacher,.page-classroom,.page-writing-assessments) :is(.table-scroll,.learning-table-wrap)>table:not([hidden])>tbody:not([hidden]) {display:table-row-group;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-teacher,.page-classroom,.page-writing-assessments) :is(.table-scroll,.learning-table-wrap)>table:not([hidden])> :is(thead,tbody):not([hidden])>tr:not([hidden]) {display:table-row;width:auto;padding:0;border:0;border-radius:0;background:transparent;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-teacher,.page-classroom,.page-writing-assessments) :is(.table-scroll,.learning-table-wrap)>table:not([hidden])> :is(thead,tbody):not([hidden])>tr:not([hidden])> :is(th,td):not([hidden]) {display:table-cell;width:auto;padding:12px 14px;text-align:left;vertical-align:top;border:0;border-bottom:1px solid var(--hb-layout-line,#e2e8f0);}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-teacher,.page-classroom,.page-writing-assessments) :is(.table-scroll,.learning-table-wrap)>table:not([hidden]) td:not([hidden])::before {content:none;display:none;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-teacher,.page-classroom) :is(th,td) {padding:12px 14px;line-height:1.7;vertical-align:top;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-classroom #join-form {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:12px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-classroom #join-form .form-error {grid-column:1/-1;margin:0;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-class-context {grid-template-columns:auto minmax(200px,320px) minmax(0,1fr);gap:16px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-stats {grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-stats .stat {min-width:0;min-height:96px;padding:18px;border-radius:8px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher :is(.teacher-assignment,.teacher-history-row,.teacher-recommendation) {min-width:0;border-color:var(--hb-layout-line,#e2e8f0);border-radius:6px;background:#fff;box-shadow:none;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-assignment>summary {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:16px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-assignment-body {padding:16px;border-top:1px solid var(--hb-layout-line,#e2e8f0);}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-level-map {grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-learning-table-wrap>table.teacher-learning-table:not([hidden]) {min-width:1000px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-wallet .balance-card {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:20px;padding:24px;border-color:var(--hb-layout-line,#e2e8f0);border-radius:8px;background:#f5f8fc;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-wallet .card-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--hb-layout-gap,20px);}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-wallet .package {display:flex;flex-direction:column;align-items:stretch;min-width:0;margin:0;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-wallet .package .btn {margin-top:auto;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-wallet .wallet-ledger-tools label {flex:1 1 260px;max-width:440px;min-width:0;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-account :is(.account-overview,.learning-dashboard-head,.learning-section-head) {flex-wrap:wrap;gap:16px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-account .learning-charts {grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:var(--hb-layout-gap,20px);}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-account :is(.learning-trend,.learning-chart-panel) {min-width:0;max-width:100%;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin :is(.admin-workspace,.admin-main-panel,.admin-chart-card,.admin-content,.admin-overview-main,.admin-overview-aside) {min-width:0;max-width:100%;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin :is(.admin-module-heading,.admin-section-heading,.admin-operations-heading,.admin-table-tools,.admin-table-tools-left,.admin-table-tools-right) {flex-wrap:wrap;gap:12px 16px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin .admin-toolbar {grid-template-columns:minmax(180px,1fr) minmax(130px,180px) auto;gap:10px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin .admin-toolbar-simple {grid-template-columns:minmax(180px,1fr) auto;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin :is(.admin-editor-fields,.admin-provider-fields) {grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin :is(.admin-editor-fields,.admin-provider-fields) label {min-width:0;gap:8px;line-height:1.65;}
html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin .admin-chart-svg {width:100%;max-width:100%;height:auto;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-teacher,.page-writing-assessments) :is(.writing-plan-form-pair,.assessment-score-inputs) {grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-admin,.page-teacher-review,.page-writing-assessments) .flow-workspace {width:100%;max-width:880px;margin:0 auto 28px;animation:none;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-admin,.page-teacher-review,.page-writing-assessments) .flow-workspace.wide {max-width:1080px;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-admin,.page-teacher-review,.page-writing-assessments) .flow-navigation {display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:20px;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-admin,.page-teacher-review,.page-writing-assessments) .flow-surface .modal {width:100%;max-width:none;min-width:0;padding:24px;border-radius:8px!important;}
html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-admin,.page-teacher-review,.page-writing-assessments) :is(.modal-actions,.writing-plan-actions) {justify-content:flex-end;margin-top:24px;padding-top:18px;border-top:1px solid var(--hb-layout-line,#e2e8f0);}
@media(max-width:960px) {
 html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher,.page-classroom) .settings-grid,html.atelier-theme body #app .shell.workspace-shell .main[class].page-account .learning-charts {grid-template-columns:minmax(0,1fr);}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-class-context {grid-template-columns:auto minmax(0,1fr);}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-class-context p {grid-column:1/-1;}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-level-map {grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:650px) {
 html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-writing-assessments) .panel,html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-admin,.page-teacher-review,.page-writing-assessments) .flow-surface .modal {padding:18px 16px;}
 html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher) :is(#settings-form,#assign-form),html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-teacher,.page-writing-assessments) :is(.writing-plan-form-pair,.assessment-score-inputs,.writing-plan-windows,.writing-plan-tasks),html.atelier-theme body #app .shell.workspace-shell .main[class].page-wallet .card-grid,html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin :is(.admin-editor-fields,.admin-provider-fields) {grid-template-columns:minmax(0,1fr);gap:16px;}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-stats {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-level-map {grid-template-columns:repeat(2,minmax(0,1fr));}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-teacher .teacher-class-context,html.atelier-theme body #app .shell.workspace-shell .main[class].page-classroom #join-form {grid-template-columns:minmax(0,1fr);}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-wallet .wallet-balance-note {text-align:left;}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-wallet .wallet-balance-note a {justify-content:flex-start;}
 html.atelier-theme body #app .shell.workspace-shell .main[class].page-admin :is(.admin-toolbar,.admin-toolbar-simple) {grid-template-columns:minmax(0,1fr);}
 html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-account,.page-wallet,.page-settings,.page-teacher,.page-classroom,.page-teacher-review,.page-writing-assessments) :is(.page-head>.btn,.learning-dashboard-actions,.teacher-row-actions,.form-actions,.modal-actions,.writing-plan-actions) {max-width:100%;justify-content:flex-start;}
 html.atelier-theme body #app .shell.workspace-shell .main[class]:is(.page-settings,.page-teacher,.page-wallet,.page-classroom,.page-writing-assessments) :is(.form-stack,.writing-plan-form,.assessment-form) :is(input:not([type=checkbox],[type=radio],[type=range]),textarea,select) {font-size:16px;}
}
