.grades-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin:8px 0 18px}.grades-heading h3{font-size:25px;line-height:1.7;margin:7px 0 9px;color:#7d5b90}.grades-heading p{font-size:12px;color:#af98bd;line-height:1.9;margin:0}.grades-heading .button{font-size:12px;flex:none}.grade-message{font-size:12px;color:#9f7cb3;background:#f0e7f8;border:1px solid #e6d7ef;border-radius:8px;padding:12px 15px;margin:13px 0 22px;line-height:1.8}.grade-message:empty{display:none}.grade-message.error{background:#fbf1e9;border-color:#efdfd3;color:#b68d70}.grades-grid{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);gap:22px;align-items:start}.grades-grid>section{min-width:0;background:#fff;border:1px solid #e4d9ec;border-radius:13px;padding:24px}.grade-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.grade-card-heading h4{font-size:16px;color:#9271a5;margin:0}.grade-card-heading button{font-size:11px;min-height:40px}.grade-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}.grade-fields label,.grade-observation-label{display:block;font-size:12px;color:#9f80b1;min-width:0}.grades-grid input:not([type=checkbox]),.grades-grid textarea,.grades-grid select{display:block;min-width:0;width:100%;min-height:45px;border:1px solid #dfceeb;border-radius:7px;padding:9px 10px;margin:6px 0 12px;color:#89639f;background:#fdfbff;font:14px/1.9 inherit}.grades-grid input[type=date]{appearance:none;max-width:100%}.grades-grid textarea{font-family:inherit;font-size:14px;line-height:1.9;resize:vertical}.grade-score-input{display:flex;align-items:center;gap:6px}.grade-score-input>input{flex:1}.grade-score-input>span{color:#bea9cb}.grade-form-card form>small{display:block;font-size:10px;color:#bba6c6;line-height:1.9;margin-top:16px}.grade-scope{border:1px solid #e4d6ee;border-radius:9px;padding:13px 15px;margin:10px 0 24px;color:#a07cb4;font-size:12px}.grade-scope summary{cursor:pointer;line-height:1.9}.grade-scope summary span{font-size:10px;color:#bba1cd;margin-left:5px}#grade-sections{margin-top:15px}#grade-sections>details{padding:10px 0;border-top:1px solid #ede4f3}#grade-sections label{display:flex;align-items:baseline;gap:8px;line-height:1.8;font-size:11px;min-height:36px;padding:7px 0;color:#b19ac0}.grades-grid input[type=checkbox]{accent-color:#9e78b4;margin:0 3px 0 0;flex:none}.grade-breakdown-heading h4{font-size:13px;margin:0 0 7px;color:#9d7ab2}.grade-breakdown-heading p{font-size:10px;line-height:1.9;margin:0 0 15px;color:#b7a1c4}.grade-empty{padding:22px 15px;border:1px dashed #e2d2ed;border-radius:8px;color:#b09bc0;font-size:12px;line-height:2;margin-bottom:20px}.grade-empty h4{font-size:17px;color:#9e7fb1;margin:8px 0}.grade-empty p{font-size:12px;margin:0}.grade-part{border:1px solid #e4d6ee;border-radius:9px;margin:12px 0;padding:13px 15px;background:#fcf9ff}.grade-part summary{font-size:12px;line-height:1.9;color:#9c78b1;cursor:pointer}.grade-part-scores{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:15px}.grade-part label,.grade-part legend{font-size:11px;color:#ae94bf}.grade-part fieldset{border:0;padding:0;margin:8px 0 14px}.grade-part legend{margin-bottom:9px}.grade-cause-options{display:flex;gap:7px 13px;flex-wrap:wrap}.grade-cause-options label{display:flex;align-items:center;gap:4px;font-size:10px;min-height:29px}.grade-observation-label{margin-top:22px}.grade-form-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:18px}.grade-form-actions .button{font-size:12px}.grade-view-controls{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:12px;margin-bottom:15px}.grade-view-controls label{font-size:11px;color:#b093c1;min-width:0}.grade-view-controls select{font-size:12px}.grade-score-summary{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:15px;background:linear-gradient(120deg,#eee3f8,#fbf7fd);border:1px solid #e3d2ef;border-radius:11px;padding:19px}.grade-score-summary>div{min-width:0}.grade-score-summary>div>span{display:block;font-size:11px;color:#aa88bf;overflow-wrap:anywhere}.grade-score-summary strong{font:38px/1.7 ui-monospace,Consolas,monospace;color:#8a62a3;display:block;white-space:nowrap}.grade-score-summary strong small{font-size:14px;font-weight:400;color:#b399c3;margin-left:6px}.grade-score-summary b{display:block;font-size:19px;line-height:1.8;color:#aa84bc;margin-top:13px}.grade-score-summary p{font-size:10px;line-height:1.9;color:#b398c4;margin:5px 0 0}.grade-trend{margin:24px 0 8px}.grade-trend figcaption{font-size:11px;color:#a98eb9}.grade-trend svg{width:100%;height:auto;display:block;overflow:visible}.grade-trend line{stroke:#e3d4ed;stroke-width:1}.grade-trend rect{fill:#c8b0db}.grade-trend text{font:10px ui-monospace,Consolas,monospace;fill:#b59ac8;text-anchor:middle}.grade-analysis-limit,.grade-rule-note{font-size:10px;line-height:1.9;color:#bba5c8;margin:8px 0 20px}.grade-data-coverage{font-size:11px;color:#a98cba;background:#f6f0fa;border-radius:7px;padding:11px 13px}.grade-insights{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:13px;margin:18px 0}.grade-insights>section{border:1px solid #e7dced;border-radius:9px;padding:16px 13px}.grade-insights h4,.grade-cause-summary h4,.grade-next-steps h4,.grade-cross-check h4{font-size:13px;color:#a181b4;margin:0 0 12px}.grade-insights ul,.grade-middle ul{list-style:none;padding:0;margin:0}.grade-insights li,.grade-middle li{font-size:11px;line-height:1.9;color:#ad92bf;margin-bottom:12px}.grade-insights li b{font-weight:500}.grade-insights li span,.grade-middle li span{display:block;font:12px/1.8 ui-monospace,Consolas,monospace;color:#bfa3d1;margin-top:4px}.grade-insights li p,.grade-middle li p{font-size:10px;margin:6px 0;color:#baa3c8;overflow-wrap:anywhere}.grade-neutral{font-size:10px;line-height:1.9;color:#bea8ca;margin:0}.grade-priorities{background:#fcf7f5}.grade-priorities h4{color:#bb938a}.grade-middle,.grade-lesson-links,.grade-observation{border:1px solid #e9deef;border-radius:9px;padding:14px;font-size:11px;color:#ac8fbc;line-height:1.9;margin:15px 0}.grade-middle summary,.grade-lesson-links summary,.grade-observation summary{cursor:pointer}.grade-middle ul{margin-top:15px}.grade-cause-summary{padding:17px 0;border-top:1px solid #eee5f3}.grade-cause-summary>div{display:flex;flex-wrap:wrap;gap:7px}.grade-cause-summary>div>span{font-size:10px;line-height:1.7;background:#f1e9f8;border-radius:5px;padding:5px 7px;color:#b092c3}.grade-cause-summary>p,.grade-cross-check>p{font-size:11px;line-height:1.95;color:#b49ac5;margin:8px 0}.grade-cross-check{border:1px solid #eadbd6;background:#fcf7f4;border-radius:9px;padding:15px;margin-bottom:18px}.grade-cross-check h4{color:#bc978b}.grade-lesson-links article{padding:13px 0;border-top:1px solid #eee4f3;margin-top:10px}.grade-lesson-links article p,.grade-observation p{font-size:11px;white-space:pre-wrap;overflow-wrap:anywhere;color:#b09ac0}.grade-lesson-links small{font-size:10px;color:#c0a9ce}.grade-next-steps{border-top:1px solid #eadff0;padding-top:20px;margin-top:20px}.grade-next-steps ol{padding-left:20px;font-size:11px;line-height:2;color:#ad91bf}.grade-next-steps li{padding:4px 0 9px;overflow-wrap:anywhere}.grade-next-steps button{font-size:11px;width:100%;margin-top:12px}.grade-draft{font-size:11px;color:#b7997c;background:#fbf4e9;border-radius:7px;padding:10px 13px}.grade-history-heading{display:flex;justify-content:space-between;gap:14px;align-items:baseline;border-top:1px solid #e8ddef;margin-top:28px;padding-top:18px}.grade-history-heading h4{font-size:13px;color:#a185b2;margin:0}.grade-history-heading small{font-size:9px;color:#bfa9cb}#grade-history article{border-bottom:1px solid #eee5f3;padding:15px 0}#grade-history article>button{display:flex;align-items:center;justify-content:space-between;gap:12px;background:transparent;text-align:left;width:100%;font-size:11px;line-height:1.9;color:#aa8fbc;min-height:37px}#grade-history article>button b{font:17px ui-monospace,Consolas,monospace;color:#b198c2;white-space:nowrap}#grade-history article>div{display:flex;gap:20px;justify-content:flex-end}#grade-history .text-button{font-size:10px;color:#bca4c9;min-height:32px}.grade-fields label:has(input:focus){color:#86629a}
@media(max-width:1150px){.grades-grid{grid-template-columns:minmax(0,1fr)}.grades-grid>section{padding:22px}.grade-view-controls{max-width:550px}.grade-trend{max-width:550px}.grade-cause-options label{font-size:11px}.grade-insights{gap:18px}}
@media(max-width:760px){.grades-heading h3{font-size:21px}.grades-heading{gap:12px}.grades-heading .button{font-size:10px;padding:8px 11px}.grades-heading p{font-size:11px}.grades-grid{gap:18px}.grades-grid>section{padding:20px 17px}.grade-fields{gap:11px}.grades-grid input:not([type=checkbox]),.grades-grid select,.grades-grid textarea{font-size:16px}.grade-part-scores{gap:10px}.grade-cause-options label{min-height:35px}.grade-form-actions .button{flex:1;min-width:130px;font-size:11px}.grade-score-summary{padding:17px 13px;gap:11px}.grade-score-summary strong{font-size:35px}.grade-score-summary b{font-size:16px}.grade-insights{grid-template-columns:minmax(0,1fr)}.grade-view-controls{grid-template-columns:minmax(0,1fr)}.grade-history-heading{flex-wrap:wrap;gap:5px}.grade-analysis-limit,.grade-rule-note{font-size:10px}.grade-part-note-label{font-size:12px!important}#grade-history article>button{font-size:12px}.grade-next-steps ol{font-size:12px}.grade-next-steps button{font-size:11px}}
@media(max-width:380px){.grade-fields{grid-template-columns:minmax(0,1fr)}.grade-score-summary{grid-template-columns:minmax(0,1fr)}.grades-heading{flex-wrap:wrap}}

@media(max-width:600px){.journal-tab-options{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}.journal-tab-options button{line-height:1.6;white-space:normal}.journal-tabs #journal-lock-now{font-size:10px;padding:9px 7px}}
@media(max-height:500px){.journal-tabs{position:static}}

.grade-autosave{font-size:11px;line-height:1.9;color:#ae93bf;background:#f6f0fa;padding:10px 13px;border:1px solid #e7dbef;border-radius:8px;margin:0 0 18px}.grade-autosave.saved{color:#8d729f;background:#f0e9f6}.grade-autosave.pending{color:#b29678;background:#faf5ed}.grade-autosave.error{color:#b28577;background:#fcf0eb;border-color:#eed9d0}.grade-autosave.saving{color:#a187b1}.readonly-grades{margin-top:20px;border:1px solid #e2d1ec;background:#fbf8fe;border-radius:12px;padding:21px 24px}.readonly-grade-heading{display:flex;align-items:center;justify-content:space-between;gap:15px}.readonly-grade-heading h4{font-size:16px;color:#9c79af;margin:3px 0 12px}.readonly-grade-heading>span{font-size:10px;color:#baa0c9}.readonly-grade-body{display:flex;align-items:center;justify-content:space-between;gap:25px}.readonly-grade-body label{font-size:11px;color:#aa8abb;min-width:0}.readonly-grade-body select{display:block;max-width:290px;width:100%;min-height:44px;margin-top:6px;padding:9px 12px;font-size:13px;color:#9773ac;background:white;border:1px solid #e1ceec;border-radius:8px}.readonly-grade-score{flex:none;text-align:right}.readonly-grade-score strong{display:block;font:34px/1.5 ui-monospace,Consolas,monospace;color:#a27eb8}.readonly-grade-score strong small{font-size:14px;color:#bea6ce;margin-left:6px}.readonly-grade-score>span{font-size:10px;color:#bba3c9}.readonly-grade-empty{font-size:12px;color:#b39ac1;line-height:1.9;margin:7px 0}.readonly-grade-heading .eyebrow{font-size:9px;color:#b99dca}
@media(max-width:600px){.readonly-grades{padding:18px}.readonly-grade-body{gap:15px;flex-wrap:wrap}.readonly-grade-body label{flex:1 1 175px}.readonly-grade-body select{font-size:16px}.readonly-grade-score{margin-left:auto}.readonly-grade-score strong{font-size:30px}}
/* Stage charts and compact journal pickers */
.grade-view-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.grade-view-controls>label:last-child{grid-column:1/-1}.grade-stage-settings{border:1px solid #ded1e9;border-radius:10px;background:#f8f3fc;padding:14px 16px;margin-bottom:20px;color:#705580}.grade-stage-settings summary{font-size:12px;cursor:pointer;line-height:1.9;min-height:30px}.grade-stage-settings summary span{display:block;font-size:11px;color:#80628f;margin-left:16px}.grade-stage-settings>p{font-size:11px;line-height:1.9}.grade-stage-settings>label,.grade-stage-dates label{display:block;font-size:12px}.grade-stage-dates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.grade-stage-settings .grade-stage-current{display:flex;gap:8px;align-items:center;margin:10px 0 18px;min-height:44px}.grade-stage-settings .button{font-size:12px;min-height:44px}.grade-stage-settings #grade-stage-message{font-size:12px;color:#6f4b87;overflow-wrap:anywhere}.readonly-stage-label{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:9px 0 4px;color:#6d4b84}.readonly-stage-label b{font-size:14px}.readonly-stage-label>span,.grade-stage-range{font:11px/1.9 ui-monospace,Consolas,monospace;color:#80638f}.grade-curve{margin:20px 0 8px;min-width:0}.grade-curve figcaption{font-size:13px;color:#67457e;line-height:1.9}.grade-curve figcaption span{font-size:11px;color:#886b99}.grade-curve-hint{font-size:10px;color:#81678f;margin:3px 0 10px}.grade-curve-scroll{overflow-x:auto;overscroll-behavior-x:contain;border-radius:8px;background:#fff;padding:8px 0 0;max-width:100%;scrollbar-width:thin;scrollbar-color:#cab4db #f4edf8}.grade-curve svg{display:block;width:100%;height:auto;overflow:visible}.grade-curve .curve-grid{stroke:#e8dff0;stroke-width:1}.grade-curve .curve-axis{font:10px ui-monospace,Consolas,monospace;text-anchor:end;fill:#81658f}.grade-curve .curve-line{fill:none;stroke:#9361b4;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.grade-curve .curve-point{fill:#795094;stroke:#fff;stroke-width:2}.grade-curve .curve-score{font:600 11px ui-monospace,Consolas,monospace;text-anchor:middle;fill:#67457e}.grade-curve .curve-date{font:10px ui-monospace,Consolas,monospace;text-anchor:middle;fill:#81658f}.grade-preview-note{font-size:11px;line-height:1.9;color:#80648f;margin:16px 0 0}.readonly-exam-filter{display:block;font-size:12px;color:#715282;margin-top:16px;max-width:330px}.readonly-exam-filter select{display:block;width:100%;min-height:44px;margin:7px 0 12px;padding:8px 10px;border:1px solid #deceeb;border-radius:7px;background:#fff;color:#715282;font:13px/1.8 inherit}.grade-compact-list{margin-top:12px}.grade-compact-list>div{display:flex;justify-content:space-between;align-items:baseline;gap:15px;border-top:1px solid #e9dff0;padding:11px 0;color:#745685;font-size:12px}.grade-compact-list time{font:11px ui-monospace,Consolas,monospace;margin-right:9px;color:#8c729c}.grade-compact-list strong{font:600 20px ui-monospace,Consolas,monospace;white-space:nowrap;color:#74508d}.grade-compact-list strong small{font-size:12px;color:#967da6}.grade-overview-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#705080}.grade-overview-heading h4{font-size:16px;margin:4px 0 10px}.grade-overview-heading>span{font-size:11px;white-space:nowrap}.grade-stage-overview{margin:18px 0;border:1px solid #e7dbef;padding:16px;border-radius:10px;min-width:0}.grade-stage-overview h5{font-size:14px;color:#715083;margin:0;line-height:1.9}.grade-stage-overview h5 span{display:inline-block;font-size:10px;margin-left:8px;padding:1px 7px;background:#eadef2;border-radius:4px;white-space:nowrap}.grade-stage-range{margin:5px 0}.grade-stage-overview .grade-curve{margin-top:12px}
.journal-card .lesson-picker{border:1px solid #dfd1eb;border-radius:8px;padding:0 12px;background:#faf6fd;min-width:0}.journal-card .lesson-picker>summary{cursor:pointer;min-height:46px;padding:12px 0;font-size:12px;color:#795b8b;line-height:1.8}.lesson-picker summary span{font-size:10px;color:#997bab;margin-left:7px}.journal-card .lesson-chapter-list,.journal-card .lesson-section-list{display:block;padding:0 0 10px;min-width:0}.journal-card .lesson-chapter-group,.journal-card .lesson-section-group{border:0;border-top:1px solid #e6dcec;border-radius:0;background:transparent;padding:7px 0;margin:0;min-width:0}.lesson-chapter-group>summary,.lesson-section-group>summary{cursor:pointer;line-height:1.9;font-size:12px;color:#775989;padding:8px 0;min-height:42px;overflow-wrap:anywhere}.lesson-chapter-group>div,.lesson-section-group>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 12px;padding:4px 0 8px}.journal-card .lesson-chapter-group label,.journal-card .lesson-section-group label{display:flex;gap:8px;align-items:baseline;min-height:42px;margin:0;padding:8px 0;font-size:12px;line-height:1.8}.lesson-picker input[type=checkbox]{accent-color:#9671ad;flex:none}.lesson-chapter-group label span,.lesson-section-group label span{min-width:0;overflow-wrap:anywhere}
@media(max-width:600px){.grade-stage-dates{grid-template-columns:minmax(0,1fr)}.grade-stage-overview{padding:12px}.grade-compact-list>div{font-size:11px}.grade-compact-list time{display:block;margin-bottom:4px}.readonly-exam-filter select{font-size:16px}.grade-view-controls{grid-template-columns:minmax(0,1fr)}.lesson-chapter-group>div,.lesson-section-group>div{grid-template-columns:minmax(0,1fr)}.grade-curve svg{max-width:none}}
#journal-preview .readonly-grades{margin:24px 0 0}

.grade-curve-empty-state{font-size:12px;line-height:1.9;color:#80618f;background:#f5eef9;border:1px dashed #dfcde9;border-radius:8px;padding:13px 15px;margin:12px 0}
/* Collapse charts until a stage or exam is chosen. */
.grade-chart-disclosure>summary{cursor:pointer;line-height:1.9;min-height:44px;padding:2px 0;color:#755386;font-size:13px}.grade-chart-title{font-weight:600}.grade-chart-title>b{font-size:10px;font-weight:400;margin-left:8px;padding:3px 7px;background:#eadef2;border-radius:4px;white-space:nowrap}.grade-chart-meta{display:block;font-size:10px;color:#9274a3;margin:4px 0 0 15px}.grade-chart-action{display:inline-block;margin-left:9px;color:#79528f}.grade-chart-action:after{content:'展開折線圖 ↓'}.grade-chart-disclosure[open]>summary{margin-bottom:12px}.grade-chart-disclosure[open] .grade-chart-action:after{content:'收起折線圖 ↑'}.grade-history-heading{align-items:center;flex-wrap:nowrap}.grade-history-heading>div{min-width:0}.grade-history-heading small{display:block;margin-top:7px;line-height:1.8}.grade-history-heading h4>span{font-size:10px;font-weight:400;margin-left:7px;color:#9d81ae}.grade-history-heading #grade-history-toggle{flex:none;min-height:44px;padding:9px 12px;font-size:11px;color:#79548d;border-color:#ddcce9;background:#faf7fd}
@media(max-width:600px){.grade-chart-title{font-size:13px}.grade-chart-meta{font-size:11px}.grade-history-heading{gap:12px}.grade-history-heading #grade-history-toggle{padding:9px;font-size:11px}}
