:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#202534;background:#f5f6fa;font-synthesis:none;--muted:#8990a0;--line:#e9ebf1;--blue:#5368e8}*{box-sizing:border-box}body{margin:0;background:#f5f6fa}.shell{max-width:680px;margin:0 auto;padding:calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom))}header,.section-head{display:flex;align-items:center;justify-content:space-between}header{margin:7px 2px 20px}h1{font-size:29px;letter-spacing:-.7px;margin:4px 0 0}h2{font-size:18px;letter-spacing:-.25px;margin:5px 0 0}.eyebrow{font-size:10px;font-weight:750;letter-spacing:1.2px;color:#8990a0}.icon{border:0;border-radius:14px;background:white;font-size:26px;color:#5864d9;width:46px;height:46px;box-shadow:0 3px 14px #1d2b4d0b}.card{background:#fff;border:1px solid #eceef3;border-radius:20px;padding:18px;margin-bottom:13px;box-shadow:0 5px 22px #20294607}.lesson-card{background:linear-gradient(135deg,#fff,#f9f9ff)}label{display:block;margin:17px 0 7px;font-size:12px;font-weight:650;color:#747c8d}input,select{width:100%;height:46px;padding:0 13px;border:1px solid var(--line);border-radius:12px;background:#fbfcfe;color:#222938;font:inherit;outline:none}input:focus,select:focus{border-color:#8794ff;box-shadow:0 0 0 3px #6c7cff20}#lesson-date{height:40px;margin-top:16px}.muted{font-size:12px;color:var(--muted)}.notice{display:none;padding:12px 14px;border-radius:12px;margin-bottom:12px;background:#fff0ef;color:#b34237;font-size:13px}.notice.show{display:block}.notice.good{background:#eaf8f0;color:#268152}.count{background:#f0f2ff;color:#5865d9;font-weight:700;border-radius:20px;padding:6px 10px;font-size:12px}.legend{display:flex;gap:16px;margin:14px 2px;color:#808797;font-size:11px}.legend span{display:flex;align-items:center;gap:6px}.dot{width:8px;height:8px;border-radius:100%}.red{background:#e66b66}.amber{background:#e8a833}.students{margin-top:5px}.student{display:flex;align-items:center;gap:11px;padding:12px 0;border-top:1px solid #f0f1f4}.avatar{width:39px;height:39px;display:grid;place-items:center;border-radius:13px;background:#eff1ff;color:#5967dc;font-weight:750;font-size:14px;flex:none}.identity{min-width:0;flex:1}.identity strong{display:block;font-size:14px}.identity small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.actions{display:flex;gap:5px}.mark{border:1px solid var(--line);background:white;border-radius:10px;width:35px;height:35px;font-size:13px;color:#a0a5b0}.mark.active.unexcused{background:#fff0ef;border-color:#f6c6c2;color:#d65750}.mark.active.excused{background:#fff7e9;border-color:#f2daa5;color:#bd831e}.empty{text-align:center;padding:26px 8px;color:#9aa0ad;font-size:13px}.management summary{cursor:pointer;list-style:none;display:grid;gap:6px}.management summary::-webkit-details-marker{display:none}.management summary:after{content:"＋";position:absolute;right:22px;color:#6871d8}.management[open] summary:after{content:"−"}.management{position:relative}.form{display:grid;gap:9px;padding-top:15px}.form h3{font-size:14px;margin:8px 0 0}.form button{height:44px;border:0;border-radius:12px;background:#5868e8;color:white;font-weight:700;font-size:13px}.inline{display:grid;grid-template-columns:1fr 1fr;gap:8px}.small{font-size:11px;line-height:1.5}footer{text-align:center;color:#a0a5b0;font-size:11px;padding:6px 0 12px}
.slot-list{display:grid;gap:7px;margin-top:5px}.slot{display:flex;align-items:center;justify-content:space-between;padding:10px 11px;border:1px solid #eef0f5;border-radius:12px;background:#fbfcfe}.slot span{display:grid;gap:4px}.slot b{font-size:11px;color:#5964c9}.slot small{font-size:12px;color:#596171}.remove-slot{border:0;border-radius:9px;background:#fff0ef;color:#c55049;font-size:19px;width:30px;height:30px}.empty.compact{padding:12px 5px;font-size:12px}.mark:disabled{opacity:.4;cursor:not-allowed}.mark.active.unexcused{background:#df4f49;border-color:#cf3e38;color:#fff;box-shadow:0 2px 8px #df4f4945}.mark.active.excused{background:#e6a01d;border-color:#ce8910;color:#fff;box-shadow:0 2px 8px #e6a01d50}
.week-calendar{padding:16px;margin-bottom:13px}.calendar-top{display:flex;align-items:center;gap:12px}.calendar-heading{flex:1;min-width:0}.calendar-heading .eyebrow{display:block;text-transform:capitalize}.calendar-heading h2{font-size:17px}.calendar-controls{display:flex;align-items:center;gap:7px;position:relative}.calendar-arrow{width:38px;height:38px;border:1px solid #eceef5;border-radius:13px;background:#fff;color:#5868d9;font-size:26px;line-height:1;display:grid;place-items:center;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}.calendar-arrow:hover{background:#f3f4ff;border-color:#dfe2ff}.calendar-arrow:active{transform:scale(.95)}.calendar-icon{font-size:19px}.date-picker-hidden{position:absolute;right:43px;width:1px;height:1px;padding:0;opacity:0;pointer-events:none}.week-days{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:16px}.weekday-button{min-height:70px;border:1px solid #edf0f6;border-radius:15px;background:#fafbfe;color:#687083;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:8px 3px;font:inherit;cursor:pointer;transition:background .15s,border-color .15s,color .15s,transform .15s}.weekday-button span{font-size:10px;font-weight:750;letter-spacing:.5px}.weekday-button b{font-size:19px;line-height:1.1;color:#252c3c}.weekday-button small{font-size:9px;line-height:1;min-height:9px;color:#8490dd}.weekday-button:hover{border-color:#cdd3ff;background:#f5f6ff}.weekday-button.selected{background:#5868e8;border-color:#5868e8;color:white;box-shadow:0 5px 12px #5868e833}.weekday-button.selected b,.weekday-button.selected small{color:white}.weekday-button.today:not(.selected){border-color:#929cf4;background:#f4f5ff;color:#5868e8}.weekday-button.today:not(.selected) b{color:#5868e8}
@media(max-width:380px){.week-calendar{padding:13px}.calendar-top{gap:8px}.calendar-arrow{width:34px;height:34px;border-radius:11px}.calendar-controls{gap:5px}.week-days{gap:5px}.weekday-button{min-height:64px;border-radius:12px}}
.calendar-picker{position:relative;display:grid;place-items:center;width:38px;height:38px;margin:0;border:1px solid #eceef5;border-radius:13px;background:#fff;color:#5868d9;font-size:19px;cursor:pointer;transition:background .15s,border-color .15s}.calendar-picker:hover{background:#f3f4ff;border-color:#dfe2ff}.calendar-picker span{pointer-events:none}.calendar-picker input{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:inherit;opacity:.01;cursor:pointer;pointer-events:auto}
@media(max-width:380px){.calendar-picker{width:34px;height:34px;border-radius:11px}}
.week-calendar{position:relative;z-index:4}.date-popover{position:absolute;top:76px;right:16px;width:min(330px,calc(100vw - 48px));padding:16px;background:#fff;border:1px solid #eaecf3;border-radius:19px;box-shadow:0 18px 48px #20294624;z-index:20}.date-popover[hidden]{display:none}.month-nav{display:flex;align-items:center;justify-content:space-between;gap:14px}.month-nav strong{font-size:14px;text-transform:capitalize;color:#292f40}.month-weekdays,.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.month-weekdays{margin:16px 0 6px}.month-weekdays span{text-align:center;color:#969cad;font-size:9px;font-weight:750;letter-spacing:.3px}.month-day{height:34px;border:0;border-radius:10px;background:transparent;color:#303749;font:inherit;font-size:12px;cursor:pointer;transition:background .15s,color .15s}.month-day:hover{background:#eff1ff;color:#4f5fda}.month-day.outside-month{color:#b9bdc8}.month-day.selected{background:#5868e8;color:#fff;font-weight:750;box-shadow:0 3px 9px #5868e844}.month-day.today:not(.selected){box-shadow:inset 0 0 0 1px #8d98f2;color:#5263d4;font-weight:700}
@media(max-width:380px){.date-popover{right:8px;width:min(320px,calc(100vw - 40px));padding:13px}.month-grid,.month-weekdays{gap:3px}.month-day{height:32px}}

/* Telegram's mobile viewport can resize as its chrome and keyboard appear. */
html{min-height:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%;overscroll-behavior-y:contain}
.week-days-viewport{overflow:hidden;margin-top:16px;border-radius:0;touch-action:pan-y;}
.week-days{overflow:visible;margin-top:0;touch-action:pan-y;will-change:transform;}
body{min-height:100vh;min-height:100dvh;-webkit-tap-highlight-color:transparent}
button,select,input{touch-action:manipulation}
button{font:inherit}
button:focus-visible,summary:focus-visible{outline:3px solid #7b88f5;outline-offset:2px}
input,select{font-size:16px} /* Prevent iOS from zooming the page when a field receives focus. */

@media(max-width:520px){
  .shell{width:100%;max-width: none;padding:calc(12px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom))}
  header{margin:3px 2px 14px}
  h1{font-size:26px}
  .card{padding:15px;border-radius:17px;margin-bottom:10px}
  .week-calendar{padding:13px;margin-bottom:10px}
  .calendar-top{gap:8px}
  .calendar-heading h2{font-size:16px}
  .calendar-arrow{width:42px;height:42px;border-radius:13px}
  .calendar-controls{gap:5px}
  .week-days-viewport{margin-top:12px}
  .week-days{gap:6px;margin-top:0}
  .weekday-button{min-height:64px;border-radius:13px;padding:7px 2px}
  .weekday-button span{font-size:9px}
  .weekday-button b{font-size:18px}
  .lesson-card label{margin-top:13px}
  .section-head{gap:8px;align-items:flex-start}
  .section-head h2{font-size:17px}
  #search{margin-top:13px}
  .legend{gap:12px;flex-wrap:wrap;margin:12px 2px}
  .student{gap:9px;padding:10px 0;min-height:62px}
  .avatar{width:38px;height:38px;border-radius:12px}
  .identity strong{font-size:13px;line-height:1.25}
  .actions{gap:6px}
  .mark{width:42px;height:42px;border-radius:12px;font-size:14px;flex:none}
  .inline{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .management summary{padding-right:27px;min-height:40px;align-content:center}
  .management summary:after{right:16px}
  .form{gap:10px}
  .form button{min-height:48px}
  .date-popover{top:70px;right:8px;width:min(330px,calc(100vw - 36px));padding:14px}
}

@media(max-width:360px){
  .shell{padding-right:9px;padding-left:9px}
  .card{padding:13px}
  .week-calendar{padding:11px}
  .calendar-top{gap:6px}
  .calendar-arrow{width:38px;height:38px}
  .calendar-controls{gap:4px}
  .calendar-heading h2{font-size:15px}
  .week-days{gap:4px;margin-top:0}
  .weekday-button{min-height:60px}
  .student{gap:7px}
  .avatar{width:35px;height:35px}
  .mark{width:39px;height:42px}
}

@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}

.sticky-lesson{display:none}
@media(max-width:520px){
  .sticky-lesson{position:fixed;z-index:30;top:calc(env(safe-area-inset-top) + 7px);left:50%;width:min(648px,calc(100vw - 24px));min-height:52px;padding:9px 14px;display:flex;flex-direction:column;justify-content:center;gap:3px;border:1px solid #e5e8f5;border-radius:15px;background:#ffffffed;box-shadow:0 5px 20px #20294618;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);opacity:0;visibility:hidden;pointer-events:none;transform:translate(-50%,-140%);transition:transform .22s cubic-bezier(.2,.75,.25,1),opacity .18s ease,visibility .18s}
  .sticky-lesson.visible{opacity:1;visibility:visible;transform:translate(-50%,0)}
  .sticky-lesson strong{overflow:hidden;color:#252c3c;font-size:14px;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}
  .sticky-lesson span{overflow:hidden;color:#7b8292;font-size:11px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}
}

.mark{transition:background-color .22s cubic-bezier(.22,.61,.36,1),border-color .22s cubic-bezier(.22,.61,.36,1),color .22s cubic-bezier(.22,.61,.36,1),box-shadow .22s cubic-bezier(.22,.61,.36,1),transform .12s ease}
.mark:active:not(:disabled){transform:scale(.92)}
@media(prefers-reduced-motion:reduce){.mark{transition:none}.mark:active:not(:disabled){transform:none}}

:root[data-theme="dark"]{color-scheme:dark;color:#edf0f7;background:#11141b;--muted:#9ba4b4;--line:#343b4b;--blue:#8997ff}
:root[data-theme="dark"] body{background:#11141b;color:#edf0f7}
:root[data-theme="dark"] .eyebrow,:root[data-theme="dark"] label{color:#a0a9b9}
:root[data-theme="dark"] .icon,:root[data-theme="dark"] .card{background:#1b202a;border-color:#2b3240;color:#edf0f7;box-shadow:0 5px 22px #00000020}
:root[data-theme="dark"] .lesson-card{background:linear-gradient(135deg,#1d222d,#1b1e2a)}
:root[data-theme="dark"] input,:root[data-theme="dark"] select{background:#151a23;border-color:#343b4b;color:#edf0f7}
:root[data-theme="dark"] input::placeholder{color:#7f899a}
:root[data-theme="dark"] input:focus,:root[data-theme="dark"] select:focus{border-color:#8996ff;box-shadow:0 0 0 3px #8290ff2b}
:root[data-theme="dark"] select option{background:#1b202a;color:#edf0f7}
:root[data-theme="dark"] .muted{color:#a0a9b8}
:root[data-theme="dark"] .notice{background:#3a2325;color:#ffaaa6}
:root[data-theme="dark"] .notice.good{background:#1c352b;color:#8cdbad}
:root[data-theme="dark"] .count{background:#2a3044;color:#aeb8ff}
:root[data-theme="dark"] .legend{color:#a0a9b8}
:root[data-theme="dark"] .student{border-color:#2b303b}
:root[data-theme="dark"] .avatar{background:#292f46;color:#b6bfff}
:root[data-theme="dark"] .identity strong{color:#edf0f7}
:root[data-theme="dark"] .identity small{color:#9ba4b4}
:root[data-theme="dark"] .mark{background:#202530;border-color:#3a4150;color:#bac1ce}
:root[data-theme="dark"] .mark.active.unexcused{background:#a94343;border-color:#d56966;color:#fff;box-shadow:0 2px 9px #b6404045}
:root[data-theme="dark"] .mark.active.excused{background:#8a641e;border-color:#bd913f;color:#fff;box-shadow:0 2px 9px #b5842445}
:root[data-theme="dark"] .empty{color:#a0a9b8}
:root[data-theme="dark"] .calendar-arrow,:root[data-theme="dark"] .calendar-picker{background:#202530;border-color:#343b4b;color:#aeb8ff}
:root[data-theme="dark"] .calendar-arrow:hover,:root[data-theme="dark"] .calendar-picker:hover{background:#2a3040;border-color:#4d5878}
:root[data-theme="dark"] .weekday-button{background:#202530;border-color:#303847;color:#aab3c2}
:root[data-theme="dark"] .weekday-button b{color:#f0f2f7}
:root[data-theme="dark"] .weekday-button small{color:#aeb8ff}
:root[data-theme="dark"] .weekday-button:hover{background:#292f3d;border-color:#535f80}
:root[data-theme="dark"] .weekday-button.selected{background:#6577eb;border-color:#7888f3;color:#fff;box-shadow:0 5px 14px #4053c44d}
:root[data-theme="dark"] .weekday-button.selected b,:root[data-theme="dark"] .weekday-button.selected small{color:#fff}
:root[data-theme="dark"] .weekday-button.today:not(.selected){background:#252b3a;border-color:#7484ed;color:#b5c0ff}
:root[data-theme="dark"] .weekday-button.today:not(.selected) b{color:#c3cbff}
:root[data-theme="dark"] .date-popover{background:#1b202a;border-color:#343b4b;box-shadow:0 18px 48px #00000070}
:root[data-theme="dark"] .month-nav strong,:root[data-theme="dark"] .month-day{color:#edf0f7}
:root[data-theme="dark"] .month-weekdays span{color:#9ba4b4}
:root[data-theme="dark"] .month-day:hover{background:#2b3141;color:#c2cbff}
:root[data-theme="dark"] .month-day.outside-month{color:#697385}
:root[data-theme="dark"] .month-day.selected{background:#6577eb;color:#fff}
:root[data-theme="dark"] .month-day.today:not(.selected){color:#c3cbff;box-shadow:inset 0 0 0 1px #7484ed}
:root[data-theme="dark"] .sticky-lesson{background:#1c222dec;border-color:#333b4b;box-shadow:0 5px 20px #00000050}
:root[data-theme="dark"] .sticky-lesson strong{color:#f0f2f7}
:root[data-theme="dark"] .sticky-lesson span{color:#a0a9b8}
:root[data-theme="dark"] footer{color:#858e9d}
:root[data-theme="dark"] button:focus-visible,:root[data-theme="dark"] summary:focus-visible{outline-color:#a6b0ff}
.theme-control{display:flex;justify-content:center;margin-top:-2px;padding-bottom:4px}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:34px;padding:6px 11px;border:1px solid transparent;border-radius:999px;background:transparent;color:#858d9d;font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .16s ease,color .16s ease,border-color .16s ease}
.theme-toggle:hover{background:#e9ebf2;color:#566078}
:root[data-theme="dark"] .theme-toggle{color:#aab3c2}
:root[data-theme="dark"] .theme-toggle:hover{background:#252b37;border-color:#343c4b;color:#e0e5ee}
.theme-toggle span{font-size:15px;line-height:1}
.icon{border:1px solid transparent;transition:background-color .22s cubic-bezier(.22,.61,.36,1),border-color .22s cubic-bezier(.22,.61,.36,1),color .22s cubic-bezier(.22,.61,.36,1),transform .12s ease}
.icon:active:not(:disabled){transform:scale(.92)}
.icon.refreshing{background:#e9ecff;border-color:#d7dcff;color:#5368e8;animation:refreshTap .22s cubic-bezier(.22,.61,.36,1)}
@keyframes refreshTap{0%,100%{transform:scale(1)}42%{transform:scale(.92)}}
:root[data-theme="dark"] .icon.refreshing{background:#2a3044;border-color:#596795;color:#bac4ff}
@media(prefers-reduced-motion:reduce){.icon.refreshing{animation:none}.icon:active:not(:disabled){transform:none}}

.header-actions{display:flex;align-items:center;gap:8px;flex:none}
.admin-link[hidden]{display:none}
.admin-link{display:grid;place-items:center;text-decoration:none;font-size:20px}
.journal-link{display:grid;place-items:center;text-decoration:none}
.journal-link svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.journal-link:hover{background:#f3f4ff;border-color:#dfe2ff}
:root[data-theme="dark"] .journal-link:hover{background:#2a3040;border-color:#4d5878}
a:focus-visible{outline:3px solid #7b88f5;outline-offset:2px}

.lesson-cards{display:flex;flex-wrap:wrap;gap:9px;margin-top:13px}
.lesson-option{flex:1 1 138px;min-width:0;min-height:190px;padding:12px 10px;border:1px solid #edf0f6;border-radius:15px;background:#fafbfe;color:#252c3c;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:8px;text-align:center;cursor:pointer;transition:background-color .22s cubic-bezier(.22,.61,.36,1),border-color .22s cubic-bezier(.22,.61,.36,1),color .22s cubic-bezier(.22,.61,.36,1),box-shadow .22s cubic-bezier(.22,.61,.36,1),transform .12s ease}
.lesson-option:hover{background:#f3f5ff;border-color:#cdd3ff}
.lesson-option:active{transform:scale(.97)}
.lesson-option-number{display:flex;align-items:baseline;justify-content:center;gap:5px;min-height:22px;color:#69748a}
.lesson-option-number b{font-size:19px;line-height:1}
.lesson-option-number small{font-size:9px;font-weight:750;letter-spacing:.7px}
.lesson-option-parts{display:grid;grid-template-rows:1fr 1fr;flex:1;min-width:0}
.lesson-option-parts.single{grid-template-rows:1fr}
.lesson-option.single-part{min-height:148px}
.lesson-part{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:6px 0}
.lesson-part+.lesson-part{border-top:1px solid #e6e9f1}
.lesson-part-label{font-size:8px;font-weight:750;letter-spacing:.25px;color:#8990a0}
.lesson-part-title{font-size:11px;line-height:1.25;overflow-wrap:anywhere}
.lesson-part-title i{font-style:normal;margin-right:3px}
.lesson-part-meta{font-size:9px;line-height:1.2;color:#8990a0;overflow-wrap:anywhere}
.lesson-option.selected{background:#5868e8;border-color:#5868e8;color:#fff;box-shadow:0 5px 12px #5868e833}
.lesson-option.selected:hover{background:#4f60dd;border-color:#4f60dd}
.lesson-option.selected .lesson-option-number,.lesson-option.selected .lesson-part-label,.lesson-option.selected .lesson-part-meta{color:#e1e5ff}
.lesson-option.selected .lesson-part+.lesson-part{border-color:#ffffff45}
:root[data-theme="dark"] .lesson-option{background:#202530;border-color:#303847;color:#edf0f7}
:root[data-theme="dark"] .lesson-option:hover{background:#292f3d;border-color:#535f80}
:root[data-theme="dark"] .lesson-option-number{color:#aeb8c8}
:root[data-theme="dark"] .lesson-part-label,:root[data-theme="dark"] .lesson-part-meta{color:#a0a9b8}
:root[data-theme="dark"] .lesson-part+.lesson-part{border-color:#343b4b}
:root[data-theme="dark"] .lesson-option.selected{background:#6577eb;border-color:#7888f3;color:#fff;box-shadow:0 5px 14px #4053c44d}
:root[data-theme="dark"] .lesson-option.selected:hover{background:#7181f0;border-color:#8795ff}
:root[data-theme="dark"] .lesson-option.selected .lesson-option-number,:root[data-theme="dark"] .lesson-option.selected .lesson-part-label,:root[data-theme="dark"] .lesson-option.selected .lesson-part-meta{color:#edf0ff}
@media(max-width:380px){.lesson-cards{gap:7px}.lesson-option{flex-basis:124px;min-height:190px;padding:10px 7px}.lesson-option.single-part{min-height:148px}.lesson-part-title{font-size:10px}.lesson-part-meta{font-size:8px}}
