:root{--navy:#1d3557;--line:#d9e1ea;--bg:#f4f7fa}*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,"Noto Sans JP",sans-serif;color:#243447;background:var(--bg)}button,input,select{font:inherit}button{cursor:pointer;border:0;border-radius:6px;padding:9px 14px}.app-header{background:var(--navy);color:white;padding:18px 28px;display:flex;justify-content:space-between;align-items:center}.app-header h1{margin:0;font-size:21px}.app-header p{margin:4px 0 0;color:#cfe0f4;font-size:13px}.shell{padding:18px 24px}.toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;background:#fff;padding:12px;border:1px solid var(--line);border-radius:8px}.toolbar label,.form-grid label,.search-fields label{font-size:12px;color:#506176;display:flex;flex-direction:column;gap:4px}.toolbar input{height:36px}.primary{background:#2463a6;color:#fff}.secondary{background:#edf2f7;color:#27496d}.danger{background:#c0392b;color:#fff}.tabs{display:flex;margin-left:12px}.tab{border-radius:0;background:#edf2f7;color:#48617b}.tab:first-child{border-radius:6px 0 0 6px}.tab:last-child{border-radius:0 6px 6px 0}.tab.active{background:#2463a6;color:#fff}.import-label{cursor:pointer;padding:9px 14px;border-radius:6px}.import-label input{display:none}.legend{display:flex;gap:18px;flex-wrap:wrap;padding:12px 2px;font-size:12px}.legend i{display:inline-block;width:14px;height:14px;vertical-align:-3px;border-radius:3px;margin-right:5px}.blue,.schedule.blue{background:#78aee3}.green,.schedule.green{background:#83c99a}.yellow,.schedule.yellow{background:#f1cd66}.red,.schedule.red{background:#e98989}.pending{background:#fff;border:2px solid #667c96}.board{overflow:auto;border:1px solid var(--line);background:white;border-radius:8px;box-shadow:0 1px 3px #dbe2e9}.timeline{display:grid;min-width:1850px}.corner,.row-label{background:#f0f4f8;position:sticky;left:0;z-index:3;border-right:1px solid var(--line);font-weight:600}.corner{top:0;z-index:5;padding:12px}.times{display:flex;height:42px;border-bottom:1px solid var(--line);background:#f8fafc;position:sticky;top:0;z-index:4}.time{width:60px;flex:0 0 60px;border-left:1px solid #e6ebf0;padding:6px 2px 0;font-size:11px;color:#65768a}.row{display:grid;grid-template-columns:210px 1fr;min-height:72px}.row-label{padding:14px 12px}.room-sub{font-size:11px;color:#6b7c8e;font-weight:400}.track{position:relative;height:72px;background:repeating-linear-gradient(90deg,transparent 0,transparent 59px,#e6ebf0 60px),repeating-linear-gradient(90deg,transparent 0,transparent 299px,#bac9d8 300px);border-bottom:1px solid var(--line)}.schedule{position:absolute;top:7px;height:58px;border-radius:5px;padding:5px 8px;color:#15334e;overflow:hidden;border:1px solid #fff;box-shadow:0 1px 2px #8394a5;cursor:pointer;line-height:1.25;font-size:12px}.schedule.pending{background:#fff;border:2px dashed #526b86}.schedule strong{display:block}.schedule small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.info{font-size:12px;color:#627387;padding:12px 2px}dialog{border:0;border-radius:10px;padding:0;width:min(650px,calc(100% - 28px));box-shadow:0 10px 40px #20354b66}dialog::backdrop{background:#14283c88}.dialog-head{padding:16px 20px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between}.dialog-head h2{margin:0;font-size:18px}.icon{background:transparent;font-size:24px;padding:0 5px}.form-grid,.search-fields{padding:18px 20px;display:grid;grid-template-columns:1fr 1fr;gap:14px}.form-grid input,.form-grid select,.search-fields input{padding:9px;border:1px solid #c9d3de;border-radius:5px;background:#fff}.wide{grid-column:1/-1}.error{color:#c0392b;font-size:13px;padding:0 20px;min-height:18px}.dialog-actions{display:flex;justify-content:space-between;gap:8px;padding:14px 20px;background:#f7f9fb}.hidden{display:none}.search-results{margin:0 20px 16px;padding:12px;background:#f5f8fb;border-radius:6px;min-height:50px}.search-results button{margin:5px 5px 0 0}.free{color:#247a4a;font-weight:600}@media(max-width:700px){.shell{padding:10px}.app-header{padding:14px}.toolbar{align-items:stretch}.tabs{margin-left:0}.form-grid,.search-fields{grid-template-columns:1fr}.wide{grid-column:auto}.row{grid-template-columns:150px 1fr}.corner{min-width:150px}.track{height:82px}.row{min-height:82px}.schedule{height:68px}}
:where(.row){grid-column:1/-1}
.teacher-calendar-day details{font-size:12px}.teacher-calendar-day summary{cursor:pointer;font-weight:600;color:#27496d}.teacher-student-check{display:flex!important;flex-direction:row!important;gap:4px!important;align-items:center;margin-top:6px}.teacher-student-check small{margin:0 0 0 20px}
.timeline{width:3450px;min-width:3450px;grid-template-columns:210px 3240px}.row{grid-column:1/-1;grid-template-columns:210px 3240px}.times{width:3240px}.track{width:3240px;background:repeating-linear-gradient(90deg,transparent 0,transparent 19px,#e6ebf0 19px,#e6ebf0 20px),repeating-linear-gradient(90deg,transparent 0,transparent 239px,#bac9d8 239px,#bac9d8 240px);background-position:0 0,120px 0}
.calendar-help{margin:0 0 8px;color:#506176;font-size:13px}.teacher-calendar-day{min-height:72px}.teacher-calendar-day.unavailable{background:#f1f3f5;color:#9caab7}.teacher-calendar-day.selected{background:#eaf4ff;border-color:#4781bb}.calendar-day-toggle{display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;font-weight:700;color:#254a72!important;cursor:pointer}.calendar-day-toggle input{width:18px;height:18px}.teacher-calendar-day details{margin-top:5px}.teacher-calendar-day summary{font-size:11px}.calendar-lesson-list{position:relative;background:#fff;border:1px solid #ccd9e6;padding:5px;border-radius:5px}.calendar-lesson{display:flex!important;flex-direction:row!important;align-items:flex-start!important;gap:4px!important;margin:3px 0;font-size:11px!important}.calendar-lesson input{width:15px;height:15px;flex:none}.calendar-lesson small{display:block;font-size:10px;color:#64748b}
dialog{max-height:90vh;overflow:auto}
.teacher-calendar-day{position:relative}.teacher-calendar-day details[open]{position:relative;z-index:12}.teacher-calendar-day details[open] .calendar-lesson-list{position:absolute;top:100%;left:0;width:190px;max-height:230px;overflow-y:auto;box-shadow:0 8px 20px #1d355733}.teacher-calendar-day:nth-child(7n+6) .calendar-lesson-list,.teacher-calendar-day:nth-child(7n) .calendar-lesson-list{left:auto;right:0}.calendar-lesson{white-space:nowrap;align-items:center!important;padding:3px 2px}.calendar-lesson span{display:flex;align-items:baseline;gap:6px}.calendar-lesson small{display:inline;font-size:10px;margin:0;color:#64748b}
.rule-preview{padding:10px;background:#eef5fb;border:1px solid #c7d8e8;border-radius:5px;color:#27496d;font-size:13px;line-height:1.6}
.teacher-schedule-list{display:grid;gap:6px}.teacher-day{display:flex;align-items:center;gap:10px;padding:8px 10px;background:#f5f8fb;border:1px solid #d7e1ea;border-radius:5px}.teacher-day input{width:18px;height:18px}.teacher-day em{color:#687b8f;font-style:normal;font-size:12px}
.teacher-calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;background:#f5f8fb;padding:8px;border:1px solid #d7e1ea;border-radius:6px}.teacher-calendar-head{font-size:11px;text-align:center;color:#63758a;font-weight:600;padding:4px}.teacher-calendar-day{min-height:62px;padding:6px;background:#fff;border:1px solid #d7e1ea;border-radius:5px;font-size:12px}.teacher-calendar-day.empty{background:transparent;border:0}.teacher-calendar-day label{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:5px;color:#243447!important;font-size:12px!important}.teacher-calendar-day input{width:16px;height:16px}.teacher-calendar-day small{display:block;color:#63758a;font-size:10px;margin-top:5px;line-height:1.2}
.weekday-checks{display:flex;gap:8px;flex-wrap:wrap}.weekday-check{display:flex;align-items:center;gap:4px;padding:7px 10px;background:#f5f8fb;border:1px solid #d7e1ea;border-radius:5px}.hint{margin:0;padding:0 20px;color:#627387;font-size:12px}
.form-grid textarea{padding:9px;border:1px solid #c9d3de;border-radius:5px;resize:vertical}.list-tools{display:flex;gap:16px;padding:14px 20px}.list-tools label{font-size:12px;color:#506176;display:flex;gap:6px;align-items:center}.student-table{margin:0 20px 16px;max-height:420px;overflow:auto;border:1px solid var(--line)}.student-table table{width:100%;border-collapse:collapse;font-size:12px}.student-table th{background:#1f4e78;color:#fff;position:sticky;top:0}.student-table th,.student-table td{padding:8px;border-bottom:1px solid #d9e1ea;text-align:left;white-space:nowrap}.rank-A{background:#ffe0df}.rank-B{background:#fff0d0}.rank-C{background:#fffbe8}
.form-grid label.hidden{display:none}
.list-tools{flex-wrap:wrap;align-items:center}
#studentListDialog{width:min(1400px,calc(100vw - 32px));max-width:none}
#studentListDialog .student-table{max-height:65vh}
.schedule.group-lesson{padding-top:3px;line-height:1.12}
.schedule.group-lesson strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.schedule.group-lesson .members{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:2px 0}
.schedule.group-lesson .schedule-meta{font-size:10px}
#adminDialog{width:min(1040px,calc(100vw - 32px));max-width:none}
.admin-hint{padding:12px 20px 0}
.admin-sections{padding:16px 20px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.admin-section{border:1px solid var(--line);border-radius:8px;padding:14px;background:#fff;min-width:0}
.admin-section h3{margin:0 0 10px;font-size:16px}.admin-section h3 small{font-weight:400;color:#65768a}
.admin-add{display:flex;gap:6px;flex-wrap:wrap}.admin-add input,.admin-add select{min-width:0;flex:1 1 150px;padding:8px;border:1px solid #c9d3de;border-radius:5px}.admin-add button{flex:none}
.admin-section ul{list-style:none;margin:10px 0 0;padding:0;max-height:230px;overflow:auto}.admin-section li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:5px 0;border-bottom:1px solid #edf1f5;font-size:13px}.admin-section li button{padding:5px 9px;font-size:12px;flex:none}
@media(max-width:700px){.admin-sections{grid-template-columns:1fr}}
.list-tools input[type=search]{min-width:170px;padding:7px 9px;border:1px solid #c9d3de;border-radius:5px}
.student-name-link{background:none;border:0;padding:0;color:#1f5e9c;text-decoration:underline;text-underline-offset:2px;font-size:inherit;text-align:left}
.student-name-link:hover,.student-name-link:focus-visible{color:#113f70}
.teacher-notice{margin:0;padding:0 20px;color:#205a35;background:#eef8f0;font-size:13px;line-height:1.5}
.teacher-notice:not(:empty){padding:10px 20px;border-bottom:1px solid #cde7d2}
#groupChangeDialog{width:min(980px,calc(100vw - 32px));max-width:none}
.group-change-members{display:grid;gap:10px;margin-top:10px;max-height:48vh;overflow:auto}
.group-change-member{border:1px solid var(--line);border-radius:7px;padding:10px;background:#f8fafc}
.group-change-member{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:14px}
.group-change-member input{width:18px;height:18px;flex:none}
.group-change-times{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.group-change-times label{display:flex;flex-direction:column;gap:4px}
.member-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.member-heading strong{font-size:14px}
.member-heading select,.member-individual select,.member-individual input{padding:7px;border:1px solid #c9d3de;border-radius:5px;background:white;min-width:0;width:100%}
.member-heading select{width:min(260px,60%)}
.member-individual{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:10px}
.member-individual label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:#506176}
@media(max-width:700px){.member-individual{grid-template-columns:repeat(2,minmax(0,1fr))}}
.closure-banner{position:sticky;left:0;z-index:6;background:#fbe2e2;border-bottom:2px solid #bd4242;padding:14px 20px;color:#8e2525;font-size:16px}
.closure-banner strong{font-size:20px}.closure-banner small{display:block;margin-top:4px;font-size:12px;color:#6d4040}
.board.is-closed .timeline{opacity:.5}.board.is-closed .track{cursor:not-allowed}
.closure-list{margin:0 20px 18px;max-height:240px;overflow:auto;border:1px solid var(--line);border-radius:6px;padding:10px 14px}
.closure-list h3{margin:0 0 8px;font-size:14px}.closure-list p{margin:0;color:#64748b;font-size:13px}
.closure-entry{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:5px 0;border-top:1px solid #edf1f5;font-size:13px}
.other,.schedule.other{background:#c5cfda}
.status-preview{padding:9px;border:1px solid #c9d3de;border-radius:5px;background:#f3f6f9;color:#27496d;font-size:14px;min-height:42px}
.student-action,.schedule-action,.admin-action{color:#fff;font-weight:700}
.student-action{background:#087f71}.student-action:hover{background:#06695e}
.schedule-action{background:#7250ae}.schedule-action:hover{background:#5e3f96}
.admin-action{background:#a95416;margin-left:auto}.admin-action:hover{background:#8b430f}
.student-action:disabled,.schedule-action:disabled,.admin-action:disabled{opacity:.55;cursor:not-allowed}
