:root{--font-size:18px;--tap:48px;--ink:#111827;--muted:#4b5563;--bg:#fff;--surface:#f3f4f6;--accent:#1c2940;--ok:#166534;--warn:#92400e;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;font-size:var(--font-size);color:var(--ink);background:var(--bg);line-height:1.45}:root.big-font{--font-size:22px;--tap:56px}*{box-sizing:border-box}body{margin:0}button{font:inherit;min-height:var(--tap);min-width:var(--tap);cursor:pointer;border:0;border-radius:12px}.app{flex-direction:column;min-height:100dvh;display:flex}.topbar{background:var(--accent);color:#fff;justify-content:space-between;align-items:center;padding:12px 16px;display:flex}.topbar h1{margin:0;font-size:1.3rem}.lang button{color:#fff;opacity:.7;background:0 0;padding:0 10px}.lang button.active{opacity:1;text-decoration:underline}.content{padding:16px;padding-bottom:calc(var(--tap) + 32px);flex:1}.status{background:var(--surface);border-radius:12px;padding:12px 14px}.status-online{color:var(--ok)}.status-offline{color:var(--warn)}.empty{color:var(--muted);font-size:1.1rem}.toggle{min-height:var(--tap);align-items:center;gap:12px;display:flex}.toggle input{width:28px;height:28px}.bottom-nav{padding-bottom:env(safe-area-inset-bottom);background:#fff;border-top:1px solid #d1d5db;grid-template-columns:repeat(4,1fr);display:grid;position:fixed;bottom:0;left:0;right:0}.bottom-nav button{color:var(--muted);background:0 0;border-radius:0}.bottom-nav button.active{color:var(--accent);font-weight:700}.login,.today,.students,.more{flex-direction:column;gap:12px;width:100%;max-width:560px;margin:0 auto;display:flex}.login form{flex-direction:column;gap:12px;display:flex}.login h1{margin:8px 0 0;font-size:1.5rem}label{font-weight:600}input[type=tel],input[type=text],input[type=search]{font:inherit;min-height:var(--tap);border:2px solid #9ca3af;border-radius:12px;width:100%;padding:8px 14px;font-size:1.25rem}input:focus{border-color:var(--accent);outline:3px solid #93c5fd}#code{letter-spacing:.4em;text-align:center;font-size:1.6rem}button.primary{background:var(--accent);color:#fff;padding:0 20px;font-weight:600}button.secondary{background:var(--surface);color:var(--ink);padding:8px 20px}button.link{color:var(--accent);background:0 0;text-decoration:underline}button:disabled{opacity:.5;cursor:default}.error{color:#991b1b;background:#fef2f2;border-radius:12px;margin:0;padding:10px 14px}.hint{color:var(--muted);margin:0}.demo-code{background:#fef9c3;border-radius:12px;margin:0;padding:10px 14px;font-weight:600}.demo{border-top:2px solid var(--surface);flex-direction:column;gap:8px;margin-top:16px;padding-top:12px;display:flex}.demo h2{margin:0;font-size:1.15rem}.persona{text-align:left;flex-direction:column;align-items:flex-start;display:flex}.persona span{color:var(--muted)}.greeting{margin:8px 0 0;font-size:1.35rem;font-weight:600}.roles,.count,.who{margin:0}.segmented{gap:8px;display:flex}.segmented button{background:var(--surface);flex:1}.segmented button.active{background:var(--accent);color:#fff}.cards{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.card{background:var(--surface);border-radius:12px;padding:12px 14px}.card .name{font-weight:600}.card .meta,.card .mine{color:var(--muted)}.calendar{flex-direction:column;gap:12px;width:100%;max-width:980px;margin:0 auto;display:flex}.calendar h2{margin:4px 0 0;font-size:1.35rem}.calendar h3{margin:0 0 6px;font-size:1.1rem}.box{background:var(--surface);border-radius:12px;flex-direction:column;gap:8px;padding:12px 14px;display:flex}.plain{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.break-row{justify-content:space-between;align-items:center;gap:8px;display:flex}.break-form{flex-direction:column;gap:8px;display:flex}input[type=date],select{font:inherit;min-height:var(--tap);background:#fff;border:2px solid #9ca3af;border-radius:12px;padding:6px 10px}label.inline{margin-left:6px;font-weight:400}.waiting{border-top:1px solid #d1d5db;flex-direction:column;gap:6px;padding-top:8px;display:flex}.preview{z-index:5;background:#fffbeb;border:2px solid #f59e0b;border-radius:12px;flex-direction:column;gap:6px;padding:12px 14px;display:flex;position:sticky;top:8px}.preview p{margin:0}.legend{color:var(--muted);flex-wrap:wrap;gap:10px 16px;margin:0;display:flex}.dot{vertical-align:-2px;border:1px solid #9ca3af;border-radius:4px;width:14px;height:14px;display:inline-block}.months{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;display:grid}.month h4{text-transform:capitalize;margin:0 0 6px}.month .grid{grid-template-columns:repeat(7,1fr);gap:3px;display:grid}.month .wd{text-align:center;color:var(--muted);font-size:.8rem}.cell{background:#fff;border:1px solid #d1d5db;border-radius:8px;flex-direction:column;justify-content:center;align-items:center;min-width:0;min-height:38px;padding:2px;font-size:.95rem;line-height:1.1;display:flex}.cell small{color:#1d4ed8;font-size:.65rem}.cell.outside{visibility:hidden}.dot.regular,.cell.regular{background:#fff}.dot.off,.cell.off{background:#fecaca;border-color:#dc2626}.cell.off{color:#991b1b}.dot.vacation,.cell.vacation{background:#fef3c7;border-color:#d97706}.dot.transfer,.cell.transfer{background:#dbeafe;border-color:#2563eb}.box-head{justify-content:space-between;align-items:center;gap:8px;display:flex}.box-head h3{margin:0}.edit-list{flex-direction:column;gap:10px;margin-top:10px;display:flex}.edit-list label{flex-direction:column;gap:4px;display:flex}.edit-list label.toggle{flex-direction:row;align-items:center}.edit-row{background:#fff;border:1px solid #d1d5db;border-radius:10px;flex-direction:column;gap:6px;padding:10px;display:flex}.cell.sel{outline:3px solid var(--accent)}.day-editor{bottom:calc(var(--tap) + 24px);border:2px solid var(--accent);position:sticky}.lesson .lesson-time{flex-wrap:wrap;align-items:baseline;gap:8px;display:flex}.lesson .room{color:var(--muted);margin-left:auto}.lesson.inactive{opacity:.6}.lesson.has-conflict{border:2px solid #dc2626}.lesson .row{margin-top:8px}.inline-form{flex-direction:column;gap:8px;margin-top:8px;display:flex}.week{flex-direction:column;gap:12px;width:100%;max-width:640px;margin:0 auto;display:flex}.week-nav{justify-content:space-between}.week-day h3{flex-wrap:wrap;align-items:center;gap:8px;margin:4px 0 6px;font-size:1.05rem;display:flex}.tag{text-transform:none;background:#dbeafe;border-radius:8px;padding:2px 8px;font-size:.85rem;font-weight:400}.tag.off{background:#fef3c7}.placement{flex-direction:column;gap:12px;width:100%;max-width:640px;margin:0 auto;display:flex}.target-head{text-align:left;background:0 0;grid-template-columns:1fr auto;gap:2px 8px;width:100%;padding:0;display:grid}.target-head .meta{color:var(--muted);grid-column:1}.target-head .fill{background:#fee2e2;border-radius:10px;grid-area:1/2/span 2;align-self:center;padding:6px 10px;font-weight:600}.target-head .fill.ok{background:#dcfce7}.slots{margin-top:6px}.slot-form{border-top:1px solid #d1d5db;flex-direction:column;gap:8px;margin-top:10px;padding-top:10px;display:flex}.chips{flex-wrap:wrap;gap:6px;display:flex}.chips button{background:#fff;border:2px solid #9ca3af;padding:0 12px}.chips button.active{background:var(--accent);color:#fff;border-color:var(--accent)}.journal-panel{flex-direction:column;gap:8px;margin-top:8px;display:flex}button.big{min-height:56px;font-size:1.15rem}.journal-students{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.student-row{text-align:left;width:100%;min-height:var(--tap);background:#fff;border-radius:10px;justify-content:space-between;align-items:center;padding:8px 12px;display:flex}.student-row .state{text-align:center;min-width:44px;color:var(--muted);border-radius:8px;padding:4px 8px;font-weight:700}.student-row .state.mark{color:#166534;background:#dcfce7}.student-row .state.present{color:#075985;background:#e0f2fe}.student-row .state.absent{color:#991b1b;background:#fee2e2}.student-actions{flex-direction:column;gap:8px;padding:8px 4px;display:flex}.marks{grid-template-columns:repeat(5,1fr);gap:6px;display:grid}.marks button{background:#fff;border:2px solid #9ca3af;min-height:52px;font-size:1.2rem;font-weight:700}.marks button.active,.student-actions .secondary.active,.reason .chips button.active{background:var(--accent);color:#fff;border-color:var(--accent)}.undo{bottom:calc(var(--tap) + 20px);color:#fff;background:#1f2937;border-radius:12px;justify-content:space-between;align-items:center;gap:8px;padding:10px 14px;display:flex;position:sticky}.undo .link{color:#93c5fd;font-weight:700}.attention{background:#fef3c7;border-radius:12px;padding:8px 12px}.attention-head{width:100%;min-height:var(--tap);background:0 0;justify-content:space-between;padding:0;display:flex}.books{flex-direction:column;gap:12px;width:100%;max-width:640px;margin:0 auto;display:flex}.books h3{margin:4px 0}.book{flex-direction:column;gap:8px;width:100%;max-width:980px;margin:0 auto;display:flex}.book h2{margin:0;font-size:1.2rem}.grid-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}.journal-grid{border-collapse:collapse;font-size:.95rem}.journal-grid th,.journal-grid td{text-align:center;border:1px solid #d1d5db;min-width:34px;height:38px;padding:0 2px}.journal-grid{border-collapse:separate;border-spacing:0}.journal-grid th,.journal-grid td{border-width:0 1px 1px 0}.journal-grid tr>:first-child{border-left-width:1px}.journal-grid thead th{background:#f9fafb;border-top-width:1px}.journal-grid tbody th,.journal-grid thead th:first-child{z-index:2;text-align:left;white-space:nowrap;background:#fff;padding:0 8px;font-weight:400;position:sticky;left:0;box-shadow:2px 0 #d1d5db}.journal-grid thead th:first-child{z-index:3}.journal-grid .grade{color:var(--muted);font-size:.85em}.journal-grid thead th .day{color:var(--muted);padding:4px;display:block}.journal-grid td{cursor:pointer}.journal-grid td.sel{outline:3px solid var(--accent);outline-offset:-3px}.journal-grid td.makeup{background:#eef2ff}.journal-grid thead th button{background:0 0;flex-direction:column;align-items:center;width:100%;min-height:0;padding:4px;display:flex}.journal-grid thead th small{color:var(--muted);font-size:.6rem}.journal-grid th.sel{outline:3px solid var(--accent)}.journal-grid th.planned button{color:var(--muted)}.journal-grid td.off,.journal-grid th.cancelled_break,.journal-grid th.cancelled{background:#fef3c7}.journal-grid td.absent{color:#991b1b;font-weight:700}.journal-grid td.was{color:#854d0e;background:#fef9c3;font-weight:700}:root{--student:#0f766e;--teacher:#6d28d9}.who-student{color:var(--student)}.who-teacher{color:var(--teacher);font-weight:600}.who-student:before,.who-teacher:before{content:"";vertical-align:.1em;background:currentColor;border-radius:50%;width:.55em;height:.55em;margin-right:.35em;display:inline-block}.who-teacher:before{border-radius:2px}.student-row .name{flex-direction:column;display:flex}.comment-note{color:var(--muted);font-size:.85rem;font-weight:400}input.comment{font-size:1rem}.result{flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px;display:flex}.badge{color:#075985;background:#e0f2fe;border-radius:8px;padding:3px 10px;font-weight:600}.badge.muted{color:#374151;background:#e5e7eb;font-weight:400}.badge.absent{color:#991b1b;background:#fee2e2}.badge.mark{text-align:center;min-width:40px;font-size:1.1rem}.mark-good{color:#166534!important;background:#dcfce7!important}.mark-fair{color:#854d0e!important;background:#fef9c3!important}.mark-poor{color:#991b1b!important;background:#fee2e2!important}.journal-grid td.mark-good,.journal-grid td.mark-fair,.journal-grid td.mark-poor{font-weight:700}.student-row .state.present{color:#374151;background:#e5e7eb;font-size:.85rem;font-weight:400}button.danger{color:#fff;background:#dc2626;font-weight:700}button.danger.active{outline:3px solid #7f1d1d}.card button.secondary{background:#fff;border:2px solid #9ca3af}.card button.secondary.active{background:var(--accent);color:#fff;border-color:var(--accent)}.name-row{justify-content:space-between;align-items:center;gap:8px;display:flex}.big-result{text-align:center;border-radius:10px;min-width:52px;padding:2px 10px;font-size:1.5rem;font-weight:800}.big-result.absent{color:#b91c1c;background:#fee2e2}.individual{flex-direction:column;gap:8px;margin-top:8px;display:flex}.undo.inline{position:static}.card.tappable{cursor:pointer}.subject-row{justify-content:space-between;align-items:center;display:flex}.chevron{color:var(--muted);padding-left:8px;font-size:1.1rem}.big-result.present{color:#854d0e;background:#fef9c3}.dialog{background:#fff;border:2px solid #dc2626;border-radius:12px;flex-direction:column;gap:10px;margin-top:8px;padding:12px;display:flex}.dialog .marks button{min-height:48px}.edit-list h4{margin:8px 0 0}.edit-list .inline-fields{flex-wrap:wrap;align-items:flex-end}.edit-list .inline-fields label{flex:none}.hint.warn{color:#92400e;background:#fef3c7;border-radius:8px;padding:8px}.big-add{width:100%;min-height:56px;margin-bottom:12px;font-size:1.1rem}.notice{color:#166534;background:#dcfce7;border-radius:10px;padding:10px 12px}.grade{color:var(--muted);font-size:.85em;font-weight:400}.row.wrap{flex-wrap:wrap;margin-top:10px}button.danger-outline{color:#b91c1c;border-color:#dc2626!important}.add-panel .search{margin:8px 0}.candidates li{margin:6px 0}.candidate{text-align:left;background:#fff;border:2px solid #d1d5db;border-radius:10px;flex-direction:column;gap:2px;width:100%;min-height:52px;padding:10px 12px;display:flex}.candidate small{color:var(--muted)}.candidate.taken{opacity:.6;border-style:dashed}.roster-changes .card.undone{opacity:.55}.roster-changes .added{color:#166534}.roster-changes .removed{color:#b91c1c}.dialog-backdrop{z-index:50;background:#00000059;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.dialog-backdrop .dialog{flex-direction:column;gap:10px;width:100%;max-width:520px;display:flex}.student-editor{cursor:default;margin-top:10px}.student-editor label.inline{align-items:center;gap:8px;display:flex}.danger-text{color:#b91c1c}.policy{padding-bottom:120px}.role-pick{z-index:5;background:#fff;flex-direction:column;gap:4px;padding:6px 0;font-weight:600;display:flex;position:sticky;top:0}.policy-row{border-bottom:1px solid #e5e7eb;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;display:flex}.policy-row span{flex:1}.policy-row select{flex:none;min-width:120px}.policy-row.on select{border-color:#16a34a}.policy-row.deny select{color:#b91c1c;border-color:#dc2626}.policy-row.changed{background:#fef9c3}.policy-bar{z-index:20;background:#fff;border-top:1px solid #d1d5db;justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;display:flex;position:fixed;bottom:64px;left:0;right:0}.policy-preview ul{max-height:40vh;overflow:auto}.import-panel input[type=file]{margin:8px 0}.import-table{border-collapse:collapse;font-size:.85rem}.import-table th,.import-table td{text-align:left;vertical-align:top;border:1px solid #e5e7eb;padding:4px 6px}.import-table tr.new td:last-child{color:#166534}.import-table tr.error{background:#fee2e2}.import-table tr.exists{color:var(--muted)}.import-panel .ok{color:#166534}.import-panel .bad{color:#b91c1c}.import-table td:last-child{min-width:220px}.import-table td:nth-child(2){min-width:140px}
