/* «Посещаемость» в стиле «Конструктив»: токены, шрифты и компоненты (.ms-btn, .ms-tab, .ms-plate) из moskovka.css. */
.teaching{min-width:0;max-width:100%;padding:24px 0 32px;color:var(--text);font:400 16px/24px var(--font-ui)}
.teaching *{box-sizing:border-box;min-width:0}
.teaching h1{font:400 36px/42px var(--font-head);letter-spacing:.01em;text-transform:uppercase;overflow-wrap:anywhere}
.teaching h2:not(.ms-plate){font:700 22px/28px var(--font-ui);letter-spacing:-.012em}
.teaching h3{font:600 18px/24px var(--font-ui);letter-spacing:-.01em}
.teaching p,.teaching h2,.teaching h3,.teaching a{overflow-wrap:anywhere}
.teaching p{max-width:72ch}
.teaching a:not(.ms-btn,.ms-tab,.ms-iconbtn){color:var(--accent-ink)}
.teaching a:not(.ms-btn,.ms-tab,.ms-iconbtn):hover{color:var(--text)}
.teaching :is(input,textarea,select,summary:not(.ms-btn,.ms-iconbtn),a:not(.ms-btn,.ms-tab,.ms-iconbtn)):focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.teaching [hidden]{display:none}
.teach-lesson-materials-head{align-items:center;gap:16px}
.teach-lesson-materials-head h2{margin:0;font:600 22px/28px var(--font-ui);text-transform:none;letter-spacing:-.01em}
.teach-material-links{list-style:none;padding:0;margin:16px 0 0}
.teach-material-item{display:flex;align-items:flex-start;gap:16px;padding:16px 0;border-top:1px solid var(--line)}
.teach-material-copy{flex:1;min-width:0}
.teach-material-copy h3{margin:0 0 8px;font:600 17px/24px var(--font-ui)}
.teach-material-actions,.teach-material-manage{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px}
.teach-material-manage{justify-content:flex-end}
.lesson-content-editor{display:grid;gap:16px;margin:20px 0 8px;padding:24px;border:1px solid var(--line);background:var(--surface)}
.lesson-content-editor header h3{margin:0;font:600 20px/28px var(--font-ui)}
.lesson-content-editor header p{margin:4px 0 0;color:var(--text-muted)}
.lesson-content-editor>label,.lesson-content-editor [data-content-material]>label,.lesson-content-editor [data-content-pane]>label{display:grid;gap:6px}
.lesson-content-editor [data-content-material]{display:grid;gap:16px}
.lesson-content-kind{display:flex;flex-wrap:wrap;gap:12px 24px;margin:0;padding:0;border:0}
.lesson-content-kind legend{margin-bottom:8px;font-weight:600}
.lesson-content-kind label{display:flex;align-items:center;gap:8px;cursor:pointer}
.lesson-content-kind input,.lesson-content-pair input{accent-color:var(--accent);width:18px;height:18px;flex:0 0 18px}
.lesson-content-pair{display:flex!important;align-items:flex-start;gap:10px!important;padding:12px 0;border-block:1px solid var(--line)}
.lesson-content-pair small{display:block;margin-top:4px;color:var(--text-muted);font-size:14px;line-height:20px}
.lesson-content-editor [data-content-status]{margin:0;color:var(--text-muted)}
.lesson-content-editor .is-error{color:var(--danger)}
.lesson-content-editor [hidden]{display:none}
@media(max-width:640px){.teach-material-item{flex-direction:column;gap:8px}.teach-material-manage{justify-content:flex-start}.lesson-content-editor{padding:16px}.teach-lesson-materials-head{align-items:flex-start}.teach-material-actions{gap:8px 12px}}
.teaching .ms-num,.teach-count,.teach-time,.teach-meta{font-variant-numeric:tabular-nums lining-nums}
.teaching summary{list-style:none}
.teaching summary::-webkit-details-marker{display:none}

/* подвкладки — общий компонент .ms-tabs */
.teaching .teach-nav{margin-bottom:28px}
.teaching .teach-nav .ms-tab{text-decoration:none}

/* заголовок страницы: название слева, управление датой справа */
.teach-heading{position:relative;display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px 16px;margin:0 0 24px}
.teach-heading p{margin-top:8px;color:var(--text-muted);font-size:16px}
.teach-heading>.teach-help{align-self:center;position:static}
.teach-journal-date{width:fit-content;max-width:100%;margin:0 0 12px}
.teach-journal-date>summary{min-height:36px;padding:6px 0;color:var(--accent-ink);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.teach-date{display:flex;align-items:center;gap:4px}
.teach-date .teach-input{width:168px;margin:0;font-variant-numeric:tabular-nums lining-nums}
.teach-date .ms-iconbtn{width:40px;height:40px}

/* .teach-button — только крючок раскладки; вид даёт .ms-btn */
.teach-button .ms-icon{margin-inline:-2px}
.teach-input{display:block;width:100%;min-height:var(--control-h);margin-top:8px;padding:8px 12px;border:1px solid var(--line-strong);border-radius:var(--radius-s);background:var(--bg);color:var(--text);font:400 16px/24px var(--font-ui);color-scheme:inherit}
.teach-input:hover{border-color:var(--text-subtle)}
.teach-input::placeholder{color:var(--text-subtle);opacity:1}
.teach-input:disabled{border-color:var(--line);background:var(--surface-2);color:var(--text-subtle)}
.teaching textarea{resize:vertical}
.teaching label{display:block;color:var(--text-muted);font:500 14px/20px var(--font-ui)}

/* карточки занятий и групп */
.teach-lessons,.teach-groups,.teach-members,.teach-material-links{padding:0;margin:0;list-style:none}
.teach-lessons,.teach-groups{display:flex;flex-direction:column;gap:8px}
.teach-lesson{display:grid;grid-template-columns:120px minmax(0,1fr) auto;align-items:start;gap:16px 24px;padding:16px 20px;border:1px solid var(--line);background:var(--surface)}
.teach-lesson.ms-strip{border-top:8px solid var(--accent)}
.teach-lesson h2:not(.ms-plate){font:600 18px/24px var(--font-ui);letter-spacing:-.01em}
.teach-time{font:500 14px/24px var(--font-ui)}
.teach-time time{display:block}
.teach-time span{display:block;margin-top:4px;color:var(--text-muted);font:400 12px/16px var(--font-ui)}
.teach-time .teach-schedule-date{margin:0;color:var(--text);font:600 14px/20px var(--font-ui)}
.teach-lesson-text>p{margin:6px 0 0;color:var(--text-muted);font-size:14px;line-height:20px}
.teach-lesson>.teach-open{align-self:center}
.teach-meta{margin:10px 0;color:var(--text-muted);font-size:14px;line-height:20px}
.teach-groups>li{display:flex;align-items:center;justify-content:space-between;gap:16px 24px;padding:16px 20px;border:1px solid var(--line);background:var(--surface)}
.teach-groups p{margin:6px 0 0;color:var(--text-muted);font-size:14px;line-height:20px}
.teach-groups h2:not(.ms-plate){font:600 18px/24px var(--font-ui);letter-spacing:-.01em}
.teaching .teach-groups h2 a{color:var(--text);text-decoration:none}
.teaching .teach-groups h2 a:hover{color:var(--accent-ink);text-decoration:underline;text-underline-offset:4px}
.teach-open{color:var(--text-muted)}

/* пустые состояния — пунктир «строчкой» */
.teach-empty{max-width:560px;padding:24px;border:1px dashed var(--line-strong);color:var(--text-muted);font-size:14px;line-height:20px}
.teach-empty h2:not(.ms-plate){color:var(--text);font:600 18px/24px var(--font-ui);letter-spacing:-.01em}
.teach-empty>p{margin:0}
.teach-actions{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;margin-top:16px}
.teach-empty .teach-actions{margin-top:16px}

/* разделы */
.teach-section{padding:24px 0;border-bottom:1px solid var(--line)}
.teach-section>.ms-plate{margin:4px 0 20px}
.teach-count{color:var(--text-muted);font:500 14px/20px var(--font-ui)}
.teach-fold>summary{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 0;cursor:pointer}
.teach-fold>summary>.ms-icon{color:var(--text-muted);transform:rotate(-90deg);transition:transform var(--duration-fast) var(--ease-out)}
.teach-fold[open]>summary>.ms-icon{transform:none}
.teach-fold>summary:hover>.ms-icon{color:var(--text)}
.teach-create{margin-top:16px}
.teach-create>summary{width:fit-content}
.teach-create[open]>summary{background-color:var(--surface-2)}
.teach-section form,.teach-create form{display:grid;gap:16px;padding-top:16px;max-width:760px}
.teach-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.teach-members{columns:3 220px;column-gap:32px}
.teach-members li{padding:12px 0;border-bottom:1px solid var(--line);font-size:14px;line-height:20px;break-inside:avoid}
.teach-member-notes{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:6px;color:var(--text-muted);font-size:12px;font-weight:400;line-height:16px}
.teaching .teach-back{display:inline-flex;align-items:center;gap:8px;min-height:40px;margin-bottom:8px;font:500 14px/20px var(--font-ui);text-decoration:none}
.teaching .teach-back:hover{text-decoration:underline;text-underline-offset:4px}
.teach-lesson-location{display:flex;flex-wrap:wrap;gap:0 20px}

/* страница занятия */
.teach-lesson-materials{max-width:760px;padding:12px 0 16px;border-bottom:1px solid var(--line)}
.teach-lesson-materials-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px}
.teach-lesson-materials-head .ms-plate,.teach-lesson-materials-head .teach-actions{margin:0}
.teach-lesson-materials .teach-meta{margin:4px 0 0}
.teach-material-links{display:flex;gap:4px 20px;flex-wrap:wrap;margin:4px 0 0}
.teach-material-links a{display:inline-flex;align-items:center;min-height:40px;font-weight:600}
.teach-material-status{margin:6px 0 0;color:var(--text-muted);font-size:14px;line-height:20px}
.teach-material-status:empty{display:none}
.teach-material-status.is-error{color:var(--danger)}
.is-lesson .teach-notes{max-width:760px;padding:8px 0;border-bottom:0}
.teach-completed{display:flex;align-items:center;gap:8px;width:fit-content;max-width:100%;padding:8px 12px;margin-bottom:16px;border:1px solid color-mix(in srgb,var(--success) 45%,var(--line));color:var(--success);font-size:14px;line-height:20px;font-weight:500}
.teach-completed.is-cancelled{border-color:var(--line-strong);color:var(--text-muted)}
.teach-roster-block{max-width:760px}
.teach-attendance-head{display:flex;align-items:center;flex-wrap:wrap;gap:12px 20px;margin:32px 0 8px}
.teach-attendance-head .ms-plate{margin:0}
.teach-attendance-head .teach-count{margin:0}
.teach-attendance-head .teach-button{margin-left:auto}

/* липкая панель журнала: поиск, отмена, статус сохранения и подсказка по клавишам */
.teach-bar{position:sticky;top:var(--header-h);z-index:6;display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:8px 0;background:var(--bg)}
.teach-search{position:relative;flex:0 1 320px}
.teach-search>.ms-icon{position:absolute;left:12px;top:50%;color:var(--text-muted);transform:translateY(-50%);pointer-events:none}
.teaching .teach-search .teach-input{height:40px;min-height:0;margin:0;padding:8px 12px 8px 36px;font-size:15px;line-height:22px}
.teach-bar .ms-iconbtn{width:40px;height:40px}
.teach-search-state{margin:0;color:var(--text-muted);font-size:14px;line-height:20px;font-variant-numeric:tabular-nums lining-nums}
.teach-search-state:empty{display:none}
.teach-save{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px 12px;margin-left:auto}
.teach-save p{margin:0;color:var(--text-muted);font-size:14px;line-height:20px}
.teach-save p:empty,.teach-save [data-recovery]:empty{display:none}
.teach-saved{display:inline-flex;align-items:center;color:var(--success)}
.teach-save-echo{margin:0;color:var(--text-muted);font-size:14px;line-height:20px}
.teach-save-echo.is-error{color:var(--danger)}
.teaching [data-save-state].is-error{color:var(--danger)}
.teach-bar>.teach-help{position:static}

/* подсказка за иконкой */
.teach-help>summary.ms-iconbtn{list-style:none}
.teach-help[open]>summary{background-color:var(--surface-2);color:var(--text)}
.teach-help-body{position:absolute;top:calc(100% + 4px);right:0;z-index:20;width:max-content;max-width:min(380px,calc(100vw - 32px));padding:12px 16px;border:1px solid var(--line-strong);background:var(--surface);box-shadow:var(--shadow-pop);color:var(--text);font-size:14px;line-height:20px}
.teach-heading .teach-help-body{left:0;right:auto}
.teach-help-body p{margin:0}
.teach-keys{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:8px 16px;margin:0;padding:0;list-style:none}
.teach-keys li{display:contents}
.teach-keys span{display:inline-flex;flex-wrap:wrap;gap:4px}
.teach-keys .ms-kbd+.ms-kbd{margin-left:0}

/* журнал встроен в страницу: без внутренней прокрутки, шапка таблицы прилипает под панелью */
.teach-attendance{margin-top:4px}
.teach-roster-wrap{border:1px solid var(--line);background:var(--surface)}
.teach-roster{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;text-align:left;font-size:14px;line-height:20px}
.teach-roster thead th{position:sticky;top:calc(var(--header-h) + var(--teach-bar-h, 56px));z-index:2;height:44px;padding:10px 16px;background:var(--surface-2);border-bottom:1px solid var(--line);color:var(--text-muted);font-weight:500}
.teach-roster th:last-child,.teach-roster td{width:132px;text-align:center}
.teach-roster tbody th{padding:0;font-weight:500;overflow-wrap:anywhere}
.teaching .teach-pupil-name{display:flex;align-items:center;min-height:47px;padding:4px 16px;color:var(--text);font:500 14px/20px var(--font-ui);cursor:pointer}
.teach-pupil:hover>*{background:var(--surface-2)}
.teach-pupil:has(input:checked)>*{background:color-mix(in srgb,var(--accent) 9%,var(--surface))}
.teach-pupil:has(input:checked):hover>*{background:color-mix(in srgb,var(--accent) 14%,var(--surface))}
.teach-pupil:has(input:disabled) .teach-pupil-name{cursor:default}
.teach-roster tbody th,.teach-roster td{height:48px;border-bottom:1px solid var(--line)}
.teach-roster tbody tr:last-child>*{border-bottom:0}
.teach-roster td{padding:2px 0}
.teach-pupil{scroll-margin-top:calc(var(--teach-bar-h, 56px) + 44px);scroll-margin-bottom:8px}
.teach-pupil input{scroll-margin-top:calc(var(--teach-bar-h, 56px) + 60px);scroll-margin-bottom:24px}
.teach-pupil:focus{outline:2px solid var(--accent-ink);outline-offset:-2px}
.teaching .teach-attendance-toggle{display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin:auto;cursor:pointer;touch-action:manipulation}
.teach-attendance-toggle:has(input:disabled){cursor:not-allowed}
.teach-attendance-toggle input{width:20px;height:20px;margin:0;accent-color:var(--accent-ink);cursor:inherit}

/* тема и итог */
.teach-notes fieldset{border:0;padding:0;margin:0;min-inline-size:0}
.teach-notes legend{padding:0;margin-bottom:8px;color:var(--text-muted);font:500 14px/20px var(--font-ui)}
.teach-material-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) auto;align-items:end;gap:12px;padding:0 0 12px}
.teach-notes .ms-iconbtn{width:40px;height:40px}
.teach-notes .teach-actions{margin-top:0}
.teach-finish{padding-top:24px}
.teach-confirm{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px}
.teach-confirm p{margin:0;font-weight:500;font-variant-numeric:tabular-nums lining-nums}
.teach-confirm .teach-actions{margin:0}
.teach-skeleton{height:76px;max-width:100%;margin-top:20px;background:var(--surface-2);animation:ms-pulse 1.4s var(--ease-out) infinite alternate}
.teach-loading{padding-top:14px;color:var(--text-muted)}

/* выгрузка */
.teach-export-mode{display:flex;flex-wrap:wrap;gap:4px 24px;margin:0 0 12px;padding:0;border:0}
.teaching .teach-export-mode label{display:flex;align-items:center;gap:8px;min-height:44px;color:var(--text);cursor:pointer}
.teach-export-mode input,.teach-export-lessons input{width:20px;height:20px;margin:0;accent-color:var(--accent-ink);flex:none}
.teach-export-fields{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 16px;max-width:760px}
.teach-export-fields>label{flex:0 1 220px}
.teaching .teach-export-fields .teach-input,.teach-export-fields>.teach-button{height:44px;min-height:0}
.teach-export-selection{margin:32px 0 24px;max-width:860px}
.teach-export-selection:empty{display:none}
.teach-export-list-head{display:flex;align-items:center;gap:12px 16px;flex-wrap:wrap}
.teach-export-list-head .ms-plate{margin:0}
.teach-export-list-head .teach-actions{margin:0 0 0 auto;gap:4px}
.teach-export-lessons{margin:16px 0 0;padding:0;list-style:none}
.teach-export-lessons li{padding:12px 0;border-bottom:1px solid var(--line);font-size:14px;line-height:20px}
.teaching .teach-export-lessons label{display:flex;align-items:flex-start;gap:12px;min-height:44px;padding:4px 0;color:var(--text);font-weight:400;cursor:pointer}
.teach-export-lessons input{margin-top:2px}
.teach-export-lessons small{display:block;margin-top:4px;color:var(--text-muted);font-size:12px;line-height:16px}
.teach-export-selection>.teach-empty,.teach-export-selection>.teach-meta{margin:0}
.teach-export-status{margin:0;color:var(--text-muted);font-size:14px;line-height:20px;font-variant-numeric:tabular-nums lining-nums}
.teach-export-status:empty{display:none}
.teach-export-status.is-error{color:var(--danger)}

@media(max-width:900px){
  .teach-lesson{grid-template-columns:100px minmax(0,1fr) auto;gap:12px 20px}
  .teach-lesson.is-next>.teach-button{grid-column:2;justify-self:start}
  .teach-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px),(pointer:coarse){
  .teach-date .ms-iconbtn,.teach-bar .ms-iconbtn,.teach-notes .ms-iconbtn{width:44px;height:44px}
  .teaching .teach-search .teach-input{height:44px}
}
@media(max-width:560px){
  .teaching{padding-top:16px}
  .teaching h1{font-size:28px;line-height:32px}
  .teaching .teach-nav{margin-bottom:20px}
  .teach-date{width:100%;margin-left:0}
  .teach-date .teach-input{flex:1 1 auto;width:auto}
  .teach-lesson,.teach-lesson.is-next{grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;padding:16px}
  .teach-lesson>.teach-time{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline}
  .teach-time time{display:flex;gap:8px}
  .teach-time span{margin:0}
  .teach-lesson>.teach-time,.teach-lesson>.teach-lesson-text{grid-column:1}
  .teach-lesson>.teach-open{grid-column:2;grid-row:1/span 2}
  .teach-lesson.is-next>.teach-button{grid-column:1/-1;justify-self:stretch}
  .teach-groups>li{padding:16px}
  .teach-members{columns:1}
  .teach-fields{grid-template-columns:1fr 1fr}
  .teach-fields label:nth-child(n+4){grid-column:1/-1}
  .teach-material-row{grid-template-columns:minmax(0,1fr) auto}
  .teach-material-row>label{grid-column:1}
  .teach-material-row>.ms-iconbtn{grid-column:2;grid-row:1/span 2;align-self:end}
  .teach-attendance-head{margin-top:24px}
  .teach-attendance-head .teach-button{width:100%;margin-left:0}
  .teach-search{flex:1 1 0}
  .teach-search-state,.teach-save{order:5;flex-basis:100%;justify-content:flex-start;margin-left:0}
  .teach-save:not(:has(p:not(:empty),[data-recovery]:not(:empty))){display:none}
  .teach-finish>.teach-button{width:100%}
  .teach-actions>.teach-button{flex:1 1 auto}
  .teach-confirm .teach-actions{width:100%}
  .teach-export-fields>label{flex:1 1 100%}
  .teach-export-fields>.teach-button{flex:1 1 auto}
  .teach-export-list-head .teach-actions{margin-left:0;width:100%}
  .teach-export-mode{display:block}
  .is-lesson .teach-back{margin-bottom:0}
  .is-lesson .teach-heading{margin-bottom:10px}
  .is-lesson .teach-heading h1{font-size:24px;line-height:30px}
  .is-lesson .teach-heading p{margin-top:6px;font-size:14px;line-height:20px}
}
@media(prefers-reduced-motion:reduce){.teaching *{transition:none!important;scroll-behavior:auto!important}.teach-skeleton{animation:none}}

.teach-publication-form { display:grid; gap:20px; max-width:900px; }
.teach-publication-form > label { display:grid; gap:6px; }
.teach-publication-audience,.teach-publication-lessons { display:grid; gap:12px; border:0; padding:0; margin:0; min-width:0; }
.teach-publication-audience legend,.teach-publication-lessons legend { padding:0 0 10px; font-weight:600; }
.teach-publication-groups,[data-publication-lessons] { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 20px; }
.teach-publication-pairs { display:flex; flex-wrap:wrap; gap:8px; }
.teach-publication-groups label,[data-publication-lessons] label { display:flex; align-items:start; gap:8px; min-height:32px; }
.teach-publication-groups input,[data-publication-lessons] input { margin-top:5px; accent-color:var(--accent); }
.teach-publication-hint { color:var(--text-muted); font-size:14px; line-height:20px; }
.teach-publication-list > li { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-bottom:1px solid var(--line); }
@media(max-width:640px) {
  .teach-publication-groups,[data-publication-lessons] { grid-template-columns:minmax(0,1fr); }
  .teach-publication-list > li { align-items:start; flex-direction:column; }
}
