/* Экраны второй версии: сетка дня, перенос, пропуски, долги, приём оплаты, преподаватели. */

/* --- Общие мелочи --- */
.small { font-size: 13px; }
.ok { color: var(--green); }
h2.h1 { font-size: 22px; margin: 0; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; text-align: center; line-height: 18px; }
.badge.gray { background: var(--muted); }
.topbar nav a.active .badge { background: #fff; color: var(--accent-dark); }
.link-btn { border: 0; background: none; color: var(--violet); cursor: pointer; font: inherit; font-size: 14px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
form.inline { display: inline; }
.row.tight { margin: 0; gap: 6px; flex-wrap: nowrap; }
.row.tight select { max-width: 380px; }
.phone { font-weight: 600; white-space: nowrap; }
.chip-link { display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--ink); font-size: 14px; }
.chip-link:hover { border-color: var(--accent); text-decoration: none; }
.chip-link.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 12px; }
.tabs a { padding: 8px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.big-num { font-size: 20px; font-weight: 600; }
.details-row td { padding-top: 0; border-bottom: 2px solid var(--line); }
.details-row summary { cursor: pointer; color: var(--violet); font-size: 13px; }
td.actions { white-space: nowrap; }
td.actions > * { display: inline-block; margin-right: 6px; }
tfoot th { font-size: 15px; color: var(--ink); }

/* --- Сетка дня --- */
.teachers-strip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.daygrid { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dg-head, .dg-body { display: grid; grid-template-columns: 56px repeat(auto-fit, minmax(0, 1fr)); }
.dg-head { background: var(--navy); color: #fff; font-weight: 600; }
.dg-room { padding: 8px; text-align: center; border-left: 1px solid rgba(255, 255, 255, .15); }
.dg-body { height: var(--h); position: relative; }
.dg-hours { position: relative; }
.dg-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.dg-hour:first-child { transform: none; }
.dg-col { position: relative; border-left: 1px solid var(--line); }
.dg-line { position: absolute; left: 0; right: 0; border-top: 1px dashed #ebeaf3; }
.dg-gap {
  position: absolute; left: 6px; right: 6px; border: 1px dashed #b9e2c3; border-radius: 8px;
  background: repeating-linear-gradient(-45deg, #f3fbf5, #f3fbf5 8px, #eaf7ee 8px, #eaf7ee 16px);
  color: var(--green); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 10px;
  opacity: .8; overflow: hidden; cursor: pointer; font-family: inherit;
}
.dg-gap b { display: none; }
.dg-gap:hover { opacity: 1; border-color: var(--green); text-decoration: none; }
.dg-gap:hover b { display: inline; }
.dg-lesson {
  position: absolute; left: 4px; right: 4px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-left: 5px solid #c9c8d8; border-radius: 8px;
  padding: 4px 8px; color: var(--ink); font-size: 13px; line-height: 1.3; z-index: 1;
  box-shadow: 0 1px 3px rgba(30, 25, 70, .06);
}
.dg-lesson:hover { text-decoration: none; border-color: var(--accent); z-index: 2; box-shadow: 0 6px 18px rgba(30, 25, 70, .15); }
.dg-lesson.todo { border-left-color: var(--accent); }
.dg-lesson.done { border-left-color: var(--green); }
.dg-lesson.cancelled { opacity: .5; background: var(--gray-bg); }
.dg-lesson.cancelled .dl-top { text-decoration: line-through; }
.dg-lesson.highlight { background: #fff4ea; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.dl-top { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-top b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.dl-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--muted); margin-top: 2px; }
.dl-meta .tag { font-size: 12px; padding: 0 7px; }
.dl-topic { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 3; pointer-events: none; }
.dg-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.legend { display: flex; gap: 14px; align-items: center; margin-top: 10px; font-size: 13px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: -8px; }
.lg.todo { background: var(--accent); }
.lg.done { background: var(--green); }
.lg.gap { background: #e3f4e8; border: 1px dashed var(--green); }

/* --- Перенос --- */
.move .daygrid { font-size: 12px; }
.daychips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.options { display: flex; flex-direction: column; gap: 6px; }
.option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 8px; }
.option.warn { border-left-color: var(--accent); }
.option:hover { border-color: var(--accent); }

/* --- Журнал --- */
.inline-select select { padding: 2px 6px; font-size: 14px; }
.debt-dot { margin-left: 8px; font-size: 12px; color: var(--red); background: var(--red-bg); border-radius: 10px; padding: 0 7px; white-space: nowrap; }
.guests-table { margin-bottom: 12px; }

/* --- Пропуски --- */
.abs-card { padding: 12px 18px; margin-bottom: 10px; }
.abs-head { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; flex-wrap: wrap; }
.abs-name { font-size: 17px; font-weight: 600; }
.abs-head .contact { display: flex; gap: 12px; align-items: center; flex: 1; flex-wrap: wrap; }
.w-date { width: 90px; white-space: nowrap; }
.w-group { width: 150px; }
.w-status { width: 240px; }

/* --- Приём оплаты --- */
.pay-layout { margin-bottom: 10px; }
.pay-entry .search input { width: 100%; font-size: 17px; padding: 10px 14px; }
.pe-name { font-size: 18px; margin-bottom: 10px; }
.pe-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pe-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pe-item:has(input:checked) { border-color: var(--accent); background: #fff8f2; }
.pe-item input { margin-top: 4px; }
.pe-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pe-fields label, .pe-comment { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pe-fields input, .pe-comment input { display: block; width: 100%; margin-top: 3px; }
#pe-amount { font-size: 18px; font-weight: 600; }
tr.fresh td { background: var(--green-bg); }

/* --- Индивидуальные занятия --- */
.tag.violet { background: #efe8ff; color: #5f30d6; }
.dg-lesson.indiv { background: #faf7ff; border-left-color: #a07cf5; }
.dg-lesson.indiv.done { border-left-color: var(--green); }
.dg-lesson.indiv.todo { border-left-color: var(--accent); }
.slot.indiv { background: #f3edff; }
.w-amount { width: 110px; }

.topics input { width: 100%; border-color: transparent; background: transparent; }
.topics input:hover, .topics input:focus { border-color: #cfcee0; background: #fff; }
.lesson-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lesson-nav .back { margin: 0; }
.lesson-nav .spacer { flex: 1; }
.chip-link.next { border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }

/* Телефон: журнал должен открываться и у преподавателя */
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .topbar nav { overflow-x: auto; flex-wrap: nowrap; width: 100%; }
  .page { padding: 12px 12px 40px; }
  .lesson-head { flex-direction: column; }
  .lesson-head .actions { margin-left: 0; }
  .card-head { flex-wrap: wrap; }
  .roster td.num { display: none; }
  .mark { padding: 8px 12px; }
  .lesson-nav { flex-wrap: wrap; }
  .dg-head, .dg-body { grid-template-columns: 40px repeat(3, minmax(110px, 1fr)); }
  .daygrid { overflow-x: auto; }
}

/* --- Итоги месяца и сводная оплат --- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi span { display: block; font-size: 13px; color: var(--muted); }
.kpi b { display: block; font-size: 24px; margin: 2px 0; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.warn b { color: var(--red); }
.grid-wrap { overflow-x: auto; }
.paygrid td, .paygrid th { white-space: nowrap; }
.paygrid .c { text-align: center; font-size: 13px; }
.paygrid small { color: inherit; opacity: .8; }
/* На телефоне таблица листается вбок: фамилия остаётся видна слева, группа под фамилией не нужна целиком */
@media (max-width: 700px) {
  .paygrid td:first-child, .paygrid th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card);
    box-shadow: 2px 0 0 var(--line); max-width: 42vw; white-space: normal; }
  .paygrid td:nth-child(2) { max-width: 38vw; white-space: normal; font-size: 13px; }
}
.cell { padding: 2px 8px; border-radius: 4px; font-size: 13px; }
.cell.paid { background: var(--green-bg); color: var(--green); }
.cell.part { background: var(--orange-bg); color: var(--orange); }
.cell.none { background: var(--red-bg); color: var(--red); }
.cell.future { background: var(--gray-bg); color: var(--muted); }
.matrix { border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 3px 6px; text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; white-space: nowrap; }
.matrix .m-plus { background: var(--green-bg); color: var(--green); font-weight: 600; }
.matrix .m-n { background: var(--red-bg); color: var(--red); font-weight: 600; }
.matrix .m-q { color: var(--accent); }
.matrix .m-c { color: var(--muted); font-size: 11px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --- Выравнивание: единые размеры кнопок и полей, ровные столбцы --- */
.btn, input:not([type=checkbox]):not([type=radio]), select { height: 38px; box-sizing: border-box; }
textarea { height: auto; }
.btn { padding: 0 16px; line-height: 1; }
.btn.small, .row.tight select, .row.tight input, td .btn, .x { height: 32px; }
.btn.small { padding: 0 12px; font-size: 13px; }
.dayhead .btn.ghost.arrow, .pagehead .btn.ghost.arrow { width: 38px; padding: 0; font-size: 20px; }
.table td, .table th { vertical-align: middle; }
.table td, .stats b, .kpi b, .r { font-variant-numeric: tabular-nums; }
.table td.r .tag { min-width: 84px; text-align: right; }
.row.tight select { width: 380px; max-width: 380px; }
.roster td { vertical-align: middle; }
.roster td.marks { width: 1%; text-align: right; }
.mark { min-width: 78px; height: 34px; }
.pagehead { min-height: 40px; }
.pagehead h1, .pagehead h2 { line-height: 38px; }
.inline-tabs { border: 0; margin: 0 0 0 12px; }
.inline-tabs a { padding: 6px 12px; }
td.actions { text-align: right; }
td.actions > * { vertical-align: middle; margin: 0 0 0 6px; }
.w-date { width: 110px; }
.w-group { width: 170px; }
.w-status { width: 230px; }
.abs-card .table td:last-child { white-space: nowrap; }
.option b { display: inline-block; min-width: 190px; }
.chip-link { height: 32px; }

/* --- Формы карточек --- */
.form-card { max-width: 1000px; }
.form-card h1 { margin-bottom: 6px; }
h2.section { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field > input, .field > select, .field > textarea { width: 100%; font-size: 15px; }
.field.wide { grid-column: span 2; }
.field.check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; padding-top: 22px; }
.field.check input { width: auto; height: auto; }
.field .req { color: var(--accent); font-style: normal; }
.field .err { color: var(--red); }
.field.has-error input, .field.has-error select { border-color: var(--red); }
.enr-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 170px; gap: 0 16px; margin-bottom: 10px; }
.enr-row .field select option { font-size: 14px; }
.section-toggle { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.section-toggle summary { cursor: pointer; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--violet); margin-bottom: 10px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.days-field .days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; gap: 3px; padding: 0 8px; height: 38px; border: 1px solid #cfcee0; border-radius: 7px; color: var(--ink); font-size: 14px; cursor: pointer; background: #fff; }
.days label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.days input { display: none; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ind-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); }
.check-columns { columns: 3; column-gap: 24px; margin-top: 10px; }
.check-columns label { display: flex; gap: 8px; align-items: center; break-inside: avoid; padding: 4px 0; font-size: 14px; }
.check-columns input { width: auto; height: auto; }
.msg .check { display: flex; gap: 8px; align-items: center; margin-top: 8px; color: var(--ink); }
@media (max-width: 900px) {
  .fgrid, .ind-grid, .enr-row { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .check-columns { columns: 1; }
}

/* --- Выгрузки --- */
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.export { display: flex; flex-direction: column; margin: 0; }
.export p { color: var(--muted); font-size: 14px; flex: 1; margin: 0 0 14px; }
.export .btn { align-self: flex-start; }
.export .row.tight { flex-wrap: wrap; }
.export .row.tight select { width: 170px; }
.export input[type=date], .export input[type=month] { width: 150px; }
.topbar nav a { padding: 8px 11px; }

.logout { margin-left: auto; display: flex; gap: 8px; align-items: center; color: #d5d3ee; font-size: 14px; }
.logout .link-btn { color: #fff; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.login-card { width: 360px; background: #fff; border-radius: 14px; padding: 28px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.login-card .brand { color: var(--ink); justify-content: center; margin-bottom: 18px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.login-card input { display: block; width: 100%; margin-top: 4px; }
.login-card .btn { width: 100%; margin-top: 6px; }

/* Поля фиксированной высоты: без вертикальных отступов, чтобы текст не обрезался */
input:not([type=checkbox]):not([type=radio]), select { padding-top: 0; padding-bottom: 0; line-height: normal; }
td.actions > a.btn, td.actions > form { display: inline-flex; }
.export form.row.tight { margin-top: auto; }

.dl-quick { position: absolute; right: 10px; z-index: 4; height: 24px; padding: 0 9px; border: 1px solid var(--green); border-radius: 12px; background: #fff; color: var(--green); font: inherit; font-size: 12px; cursor: pointer; }
.dl-quick:hover { background: var(--green); color: #fff; }
.bulk-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin: 8px 0; columns: 2; }
.bulk-list label { display: flex; gap: 8px; align-items: center; padding: 3px 0; break-inside: avoid; font-size: 14px; }
.bulk-list input { width: auto; height: auto; }

.notice-dot { margin-left: 8px; font-size: 12px; color: var(--orange); background: var(--orange-bg); border-radius: 10px; padding: 0 7px; }

/* ================= Телефон и узкие экраны ================= */
.menu-toggle { display: none; }
.day-list { display: none; }
.table-wrap { width: 100%; }
.me-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.me-list { display: flex; flex-direction: column; gap: 8px; }
.me-item { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--violet); border-radius: 10px; color: var(--ink); background: #fff; }
.me-item.cancelled { opacity: .55; border-left-color: var(--muted); }
.me-item.off { border-left-color: var(--red); }
.link-item:hover { text-decoration: none; border-color: var(--accent); }
.me-when { display: flex; flex-direction: column; min-width: 78px; }
.me-when span { color: var(--muted); font-size: 13px; }
.me-what { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.me-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.me-absent { width: 100%; }
.me-absent summary { list-style: none; display: inline-flex; }
.me-absent summary::-webkit-details-marker { display: none; }
.me-absent[open] summary { display: none; }
.me-absent-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.cancel-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fff6e0; border: 1px solid #e0a800; line-height: 1.4; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.reasons label { display: inline-flex; gap: 5px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 18px; font-size: 14px; }
.reasons input { width: auto; height: auto; }
.me-absence { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.row.tight.wrap { flex-wrap: wrap; }
.attention { border-color: var(--accent); }
.bot-card .btn { margin-top: 4px; }

@media (max-width: 900px) {
  body { font-size: 15px; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; position: sticky; }
  .brand span { font-size: 16px; }
  .menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; margin-left: auto; width: 40px; height: 36px; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; background: transparent; padding: 0 9px; }
  .menu-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; }
  .topbar nav { display: none; width: 100%; flex-direction: column; gap: 2px; padding-bottom: 6px; }
  body.menu-open .topbar nav { display: flex; }
  .topbar nav a { padding: 10px 12px; font-size: 16px; }
  .logout { margin-left: 0; width: 100%; justify-content: flex-end; }
  .page { padding: 12px 12px 48px; }
  h1 { font-size: 21px; }
  .card { padding: 14px; border-radius: 12px; }
  .grid2, .me-grid { grid-template-columns: minmax(0, 1fr); }
  .pagehead { gap: 8px; }
  .pagehead .filter, input[type="search"], .filter { min-width: 0; width: 100%; margin-left: 0; order: 10; }
  .pagehead .btn { flex: 0 0 auto; }
  .dayhead { gap: 8px; }
  .daytitle { min-width: 0; flex: 1; }
  .daytitle h1 { font-size: 18px; }
  .datepick { margin-left: 0; }
  .dayhead .btn:not(.arrow) { flex: 1 1 45%; }
  .daygrid, .legend { display: none; }
  .day-list { display: flex; flex-direction: column; gap: 8px; }
  .dlist-item { position: relative; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-left: 5px solid #c9c8d8; border-radius: 10px; padding: 10px 10px 10px 12px; }
  .dlist-item.todo { border-left-color: var(--accent); }
  .dlist-item.done { border-left-color: var(--green); }
  .dlist-item.cancelled { opacity: .55; }
  .dlist-item.indiv { background: #faf7ff; }
  .dlist-link { display: flex; gap: 12px; flex: 1; color: var(--ink); min-width: 0; }
  .dlist-link:hover { text-decoration: none; }
  .dlist-time { display: flex; flex-direction: column; min-width: 48px; }
  .dlist-time span { color: var(--muted); font-size: 13px; }
  .dlist-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .dlist-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dl-quick.inline { position: static; height: 34px; padding: 0 12px; font-size: 13px; flex: 0 0 auto; }
  .teachers-strip { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .teachers-strip .chip-link { flex: 0 0 auto; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
  .table-wrap > .table { min-width: 640px; }
  .lesson-head { flex-direction: column; gap: 8px; }
  .lesson-head .actions { margin-left: 0; width: 100%; }
  .lesson-head .actions .btn { flex: 1; }
  .card-head { flex-wrap: wrap; }
  .card-head .counter { margin-left: 0; order: 3; width: 100%; }
  .roster td.num { display: none; }
  .roster td { padding: 8px 4px; }
  .roster { table-layout: auto; }
  .roster td.marks { white-space: nowrap; width: 1%; text-align: right; }
  .roster td.marks .mark + .mark { margin-left: 4px; }
  .roster td:nth-child(2) { word-break: break-word; }
  .mark { min-width: 64px; height: 40px; padding: 0 8px; }
  .debt-dot, .notice-dot { display: block; margin: 2px 0 0; width: fit-content; }
  .lesson-nav { flex-wrap: wrap; }
  .lesson-nav .spacer { display: none; }
  .chip-link.next { width: 100%; justify-content: center; height: 40px; }
  .stats { flex-wrap: wrap; }
  .stats > div { flex: 1 1 40%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 20px; }
  .abs-head { gap: 6px; flex-direction: column; align-items: flex-start; }
  .abs-card .table, .abs-card .table tbody, .abs-card .table tr, .abs-card .table td { display: block; width: 100%; }
  .abs-card .table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .abs-card .table td { border: 0; padding: 2px 0; }
  .abs-card .table td:last-child { white-space: normal; }
  .row.tight { flex-wrap: wrap; }
  .row.tight select { width: 100%; max-width: 100%; }
  .row.tight .btn { width: 100%; }
  .pe-fields { grid-template-columns: 1fr 1fr; }
  .pe-fields label:first-child { grid-column: span 2; }
  .export-grid { grid-template-columns: 1fr; }
  .options .option { flex-direction: column; align-items: flex-start; }
  .option b { min-width: 0; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 100%; }
  .info { grid-template-columns: 1fr 1fr; }
  .info .span2 { grid-column: span 2; }
  .daychips { overflow-x: auto; flex-wrap: nowrap; }
  .daychips .chip-link { flex: 0 0 auto; }
  .dg-head, .dg-body { grid-template-columns: 40px repeat(auto-fit, minmax(120px, 1fr)); }
  .move .daygrid { display: block; overflow-x: auto; }
  /* перенос: все кабинеты в одну строку с прокруткой, третий не налезает на часы */
  .move .dg-head, .move .dg-body { grid-template-columns: 40px; grid-auto-flow: column; grid-auto-columns: minmax(120px, 1fr); }
  .tabs { overflow-x: auto; }
  .tabs a { white-space: nowrap; }
  .check-columns { columns: 1; }
  .me-item { padding: 10px; }
  dialog { width: calc(100% - 24px); }
  #toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
}

.claims { border-color: var(--blue); }
.claim-row { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.claim-row > span { flex: 1 1 220px; min-width: 0; }
.claim-row > span.with-avatar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.claim-row > span.with-avatar .avatar { margin-right: 0; }
.claim-comment { flex-basis: 100%; overflow-wrap: anywhere; }
.claim-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: 6px; }
.claim-actions form { margin: 0; }
.claim-actions .btn { white-space: normal; }

/* --- Регистрация --- */
.msg.warning { background: var(--orange-bg); color: var(--ink); }
.msg.info { background: var(--blue-bg); }
.center { text-align: center; }
.public-nav { margin-left: auto; }
.public-nav a { color: #fff; }
.public-page { max-width: 1000px; margin: 0 auto; }
.reg-intro { max-width: 720px; margin: 10px 0 18px; }
.reg-choose { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.reg-option { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; color: var(--ink); }
.reg-option:hover { text-decoration: none; border-color: var(--accent); }
.reg-option b { font-size: 18px; }
.reg-icon { font-size: 34px; }
.reg-steps-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0; margin: 20px 0; list-style: none; counter-reset: s; }
.reg-steps-line li { counter-increment: s; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; }
.reg-steps-line li b::before { content: counter(s) ". "; color: var(--accent); }
.reg-steps-line span { color: var(--muted); font-size: 13px; }
.reg-self, .reg-consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; font-size: 15px; }
.reg-self input, .reg-consent input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.reg-consent.has-error span { color: var(--red); }
.field.is-ok input, .field.is-ok select { border-color: #8fd19e; }
.reg-steps { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 14px; }
.reg-steps li { display: flex; gap: 14px; align-items: flex-start; }
.reg-steps li > div { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.step-mark { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--gray-bg); color: var(--muted); }
.reg-steps li.done .step-mark { background: var(--green-bg); color: var(--green); }
.reg-steps li.todo .step-mark { background: var(--orange-bg); color: var(--orange); }
.reg-people { display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.reg-person { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.reg-person.ok { background: var(--green-bg); border-color: transparent; }
.reg-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.reg-checks { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.form-actions.wrap { flex-wrap: wrap; }
tr.link-row { cursor: pointer; }
tr.link-row:hover td { background: #fafaff; }
@media (max-width: 900px) {
  .reg-choose, .reg-steps-line { grid-template-columns: 1fr; }
  .reg-person { flex-wrap: wrap; }
}
.login-reg { text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.now-card { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border: 2px solid var(--accent); color: var(--ink); }
.now-card:hover { text-decoration: none; }
.now-card b { font-size: 18px; }
.now-card .btn { margin-left: auto; }
.me-item.now { border-color: var(--accent); background: var(--orange-bg); }
.now-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* --- Индивидуальное занятие --- */
.ind-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip-person { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-bg); color: var(--ink); border-radius: 16px; padding: 4px 6px 4px 12px; font-size: 14px; }
.chip-person button { border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
#ind-results { display: flex; flex-direction: column; gap: 2px; max-width: 520px; }
#ind-results .result { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
#ind-results .result:hover { border-color: var(--accent); }
.ind-day { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.ind-times { display: flex; flex-wrap: wrap; gap: 6px; }
.ind-time input { position: absolute; opacity: 0; }
.ind-time span { display: inline-block; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-variant-numeric: tabular-nums; }
.ind-time input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.ind-time input:focus-visible + span { outline: 2px solid var(--violet); }
.ind-actions { align-items: flex-end; flex-wrap: wrap; }
.ind-actions .field { min-width: 200px; }
@media (max-width: 900px) { .ind-day { grid-template-columns: 1fr; } }
.check-columns + small, .field .check-columns { margin-bottom: 10px; }
.msg.demo-mail { background: var(--blue-bg); color: var(--ink); }
@media (max-width: 900px) { body.public .topbar nav.public-nav { display: flex; width: auto; flex-direction: row; padding: 0; } }

#price { width: 90px; height: 30px; }

/* Состояние занятия относительно текущего времени */
.dg-lesson.st-now:not(.cancelled) { box-shadow: 0 0 0 2px var(--accent), 0 4px 12px rgba(247, 103, 7, .2); z-index: 2; }
.dg-lesson.st-future:not(.cancelled) { background: #fff; }
.dlist-item.st-now:not(.cancelled) { box-shadow: 0 0 0 2px var(--accent); border-radius: 10px; }
.now-tag { font-size: 11px; padding: 0 6px; }
.topic-line { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 2px; }

/* --- Панель «Сайт» --- */
.site-tabs a { cursor: pointer; }
.upload-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-item { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.photo-item input[type=number] { width: 70px; }
.edit-table input, .edit-table select { width: 100%; }
.edit-table .w-num input { width: 70px; }
@media (max-width: 900px) { .edit-table thead { display: none; } .edit-table tr { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.narrow-card { max-width: 520px; }
.login-card .error { color: var(--red); font-size: 14px; }
.logout .link-btn, .logout a { color: #d5d3ee; }

/* --- Счёт на оплату --- */
dialog.invoice-dialog { width: 560px; max-height: 90vh; overflow: auto; }
.invoice-modal h2 { margin: 0; }
.invoice-modal h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.inv-rcpt { padding: 6px 10px; border-radius: 8px; background: var(--green-bg); margin-bottom: 4px; font-size: 14px; }
.inv-rcpt.warn { background: var(--orange-bg); }
.inv-text { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 13px; font-family: inherit; margin: 0; }
.total-row td { border-top: 2px solid var(--ink); }
.nowrap { white-space: nowrap; }
.pay-card { max-width: 820px; }
.pay-grid { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.pay-qr { text-align: center; }
.pay-qr svg { width: 100%; height: auto; max-width: 240px; }
.big-btn { width: 100%; height: 48px; font-size: 17px; margin: 14px 0 6px; }
.me-pay { border: 2px solid var(--accent); }
.me-pay-row { display: grid; grid-template-columns: 1fr 150px; gap: 14px; align-items: start; }
.me-pay-row svg { width: 150px; height: auto; }
@media (max-width: 900px) { .pay-grid, .me-pay-row { grid-template-columns: 1fr; } .pay-qr svg, .me-pay-row svg { max-width: 200px; margin: 0 auto; display: block; } }
.mail-card { max-width: 820px; }
.mail-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }

/* Карточка занятия в сетке дня: контейнер задаёт место, кнопка «все пришли» внутри него */
.dg-item { position: absolute; left: 4px; right: 4px; z-index: 1; }
.dg-item:hover { z-index: 3; }
.dg-item .dg-lesson { position: absolute; inset: 0; left: 0; right: 0; }
.dg-item .dg-lesson.has-quick { padding-right: 88px; }
.dg-item.short .dg-lesson.has-quick { padding-right: 52px; }
.dg-item .dl-quick { position: absolute; top: 5px; right: 6px; z-index: 4; }
.dg-item.short .dl-quick { padding: 0 7px; font-size: 11px; height: 22px; }
.dl-top { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dg-item.short .dl-top { -webkit-line-clamp: 1; }
.dg-item.short .dl-meta { margin-top: 0; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
.dg-item.short .dl-meta .tag { flex: none; }
.dg-item:hover .dg-lesson { overflow: visible; height: auto; min-height: 100%; bottom: auto; }
.dg-item:hover .dl-top { -webkit-line-clamp: unset; display: block; }

/* Журнал: заполнен ли, обязательная тема, домашнее задание */
.journal-status { margin: 4px 0 10px; padding: 6px 10px; border-radius: 8px; font-size: 13px; background: var(--bg-soft, #f3f4f6); color: var(--muted, #6b7280); }
.journal-status.ok { background: #e8f6ec; color: #1e7b3a; font-weight: 600; }
.journal-status.todo { background: #fff4e5; color: #a3570b; font-weight: 600; }
.topic-field.need input { border-color: #e08a1e; background: #fffaf2; }
.topic-field small { display: block; margin-top: 3px; }
.prev-hw { margin: 0 0 10px; padding: 6px 10px; border-left: 3px solid #8aa4ff; background: #f5f7ff; border-radius: 4px; }
.prev-hw .muted { display: block; }
.roster .marks { white-space: nowrap; }
.hw-mark { margin-left: 6px; width: 52px; height: 30px; border-radius: 8px; border: 1px dashed #b8bec8; background: transparent; color: #8a919c; font-size: 12px; cursor: pointer; }
.hw-mark[data-hw="yes"] { border-style: solid; border-color: #2f9e57; background: #e8f6ec; color: #1e7b3a; }
.hw-mark[data-hw="yes"]::after { content: " ✓"; }
.hw-mark[data-hw="no"] { border-style: solid; border-color: #d9534f; background: #fdecec; color: #b52b27; }
.hw-mark[data-hw="no"]::after { content: " ✗"; }
#homework textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border, #d6dae1); }
.hw-files { list-style: none; padding: 0; margin: 8px 0; }
.hw-files li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.hw-files form.inline { display: inline; }

.ind-price { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; padding: 10px 12px; background: #f6f5ff; border-radius: 10px; }
.ind-price .field { margin: 0; max-width: 180px; }
.ind-price p { margin: 0; flex: 1 1 240px; }

/* Ставки преподавателя: почасовая оплата выделяется, ставки за занятие приглушаются */
.pay-hourly { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.rates .rate-hourly .field, .rate-cards .per-hour { opacity: .55; }
.rates.hourly .rate-hourly .field, .rate-cards.hourly .per-hour { opacity: 1; background: #f1edff; outline: 2px solid #7c5cff; border-radius: 10px; padding: 6px 8px; }
.rates.hourly .rate-per-lesson .field, .rate-cards.hourly .per-lesson { opacity: .45; }
.rate-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.rate-card { padding: 10px 12px; border: 1px solid #e3e1ef; border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.rate-card span { color: var(--muted); font-size: 13px; }
.rate-card b { font-size: 18px; }

/* Кабинет ученика: домашние задания */
.me-hw { padding: 8px 0; border-bottom: 1px solid #eeedf5; }
.me-hw:last-child { border-bottom: 0; }
.me-hw.latest { background: #f6f5ff; margin: 0 -12px; padding: 10px 12px; border-radius: 10px; border-bottom: 0; }
.me-hw-text { margin-top: 4px; white-space: normal; }
.hw-file { display: inline-block; margin: 6px 8px 0 0; padding: 3px 10px; border-radius: 14px; background: #eef1ff; font-size: 13px; }

/* Группа без учеников (например, при запуске): видна в расписании, отмечать не нужно */
.dg-lesson.empty-group { opacity: .55; background: repeating-linear-gradient(135deg, #f7f7fb, #f7f7fb 6px, #efeff6 6px, #efeff6 12px); }

/* Анкета: «Какая математика» только для 10 и 11 класса */
.math-level[hidden] { display: none !important; }
.math-level { margin-bottom: 12px; }
.reg-steps .tag { align-self: flex-start; }

.msg.rate-note { display: block; margin: 6px 0 12px; line-height: 1.5; }
.sub-title { margin: 14px 0 4px; }
.signup-subjects { margin-top: 14px; }
.sick-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0; }

/* Телефон: дата дня целиком на первой строке между стрелками, остальное ниже */
@media (max-width: 900px) {
  .dayhead .daytitle { flex: 1 1 calc(100% - 100px); }
  .dayhead .datepick { flex: 1 1 auto; }
}

.push-box .push-state { margin: 6px 0 10px; }

/* Оплаты и долги: сверху три колонки одинаковой высоты, ниже вкладки */
.pay-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 14px; }
.pay-top.no-claims { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.pay-top > .card { margin: 0; }
.pay-scroll { max-height: 440px; overflow: auto; overflow-y: scroll; scrollbar-gutter: stable;
  --scrollbar-thumb: #9d96ba; --scrollbar-track: #f2f0f7;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); scrollbar-width: thin; }
@supports not (scrollbar-color: auto) {
  .pay-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
  .pay-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 8px; }
  .pay-scroll::-webkit-scrollbar-track { background: var(--scrollbar-track); }
}
.pay-top .claim-row > span { min-width: 0; }
#recent { table-layout: fixed; width: 100%; min-width: 0; }
#recent td { padding-inline: 4px; vertical-align: middle; }
#recent td.with-avatar { min-width: 0; white-space: normal; }
#recent .recent-date { width: 46px; }
#recent .recent-amount { width: 96px; white-space: normal; overflow-wrap: anywhere; }
#recent .topic-line { overflow-wrap: anywhere; }
#debts-table .reminder-cell { text-align: center; vertical-align: middle; }
#debts-table .reminder-cell .inline { display: block; }
#debts-table .reminder-cell .btn { min-width: 88px; }
.pay-hint { margin-top: 8px; }
.pay-tabs { margin: 6px 0 12px; }
.pay-tabs .badge { margin-left: 4px; }
.pay-pane[hidden] { display: none; }
.pane-tools { gap: 8px; margin-bottom: 8px; }
.pane-tools .filter { max-width: 280px; }
@media (max-width: 1100px) { .pay-top, .pay-top.no-claims { grid-template-columns: 1fr; } .pay-scroll { max-height: 360px; } }

.pay-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pay-summary > div { background: var(--bg-soft, #f6f6fb); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pay-summary b { font-size: 18px; }
.pay-summary span { color: var(--muted); font-size: 12px; }
.pay-summary .warn b { color: #c92a2a; }
.pay-scroll { max-height: 400px; }
.debts-section .stats { display: none; }

/* Фото профиля и кружок с буквой */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; color: #fff;
  font-weight: 700; object-fit: cover; line-height: 1; text-shadow: 0 1px 1px rgba(0, 0, 0, .18); vertical-align: middle; }
img.avatar { background: #eee; }
.me-link { display: inline-flex; align-items: center; gap: 8px; }
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; }
.profile-head h1 { margin: 0 0 6px; }
.photo-form { gap: 10px; align-items: center; }
.file-btn { cursor: pointer; }
h1.with-avatar { display: inline-flex; align-items: center; gap: 12px; }

td.with-avatar { white-space: nowrap; }
td.with-avatar .avatar { margin-right: 6px; }
.section-title { margin: 26px 0 6px; }

/* Цвета занятий: группа фиолетовая, индивидуальное серое, отменено или перенесено отсюда бледно-красное,
   перенесено сюда ярко-синее */
.dg-lesson.k-group { background: #f4efff; border-color: #ddd0ff; }
.dg-lesson.indiv, .dg-lesson.k-indiv { background: #f1f3f5; border-color: #dee2e6; border-left-color: #adb5bd; }
.dg-lesson.k-cancelled, .dg-lesson.k-moved-out { background: #fff0f0; border-color: #ffd6d6; border-left-color: #ff8787; opacity: .8; }
.dg-lesson.k-moved-out .dl-top b, .dg-lesson.k-cancelled .dl-top b { text-decoration: line-through; }
.dg-lesson.k-moved-in { background: #e7f3ff; border: 2px solid #339af0; border-left-width: 4px; }
.dg-lesson.k-moved-in.todo { border-left-color: var(--accent); }
.dg-lesson.k-moved-in.done { border-left-color: var(--green); }
.tag.blue { background: #d0ebff; color: #1864ab; }
.tag.red { background: #ffe3e3; color: #c92a2a; }

/* Неделя */
.week-head { gap: 8px; flex-wrap: wrap; }
.week-head h1 { margin: 0 4px; }
.week-head .spacer { flex: 1; }
.wk-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wk-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.wk-dot.group { background: #e5dbff; } .wk-dot.indiv { background: #dee2e6; }
.wk-dot.moved-in { background: #339af0; } .wk-dot.cancelled { background: #ffc9c9; }
.wk-wrap.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wk-title { font-size: 15px; margin: 0 0 6px; }
.wk-card a { color: inherit; }
.wk-card a:hover { color: var(--accent); }
.wk-time { font-weight: 700; }
.wk-note { font-weight: 600; }
.wk-card.indiv { background: #f1f3f5; border-color: #dee2e6; border-left-color: #adb5bd; }
.wk-card.cancelled, .wk-card.moved-out { background: #fff0f0; border-color: #ffd6d6; border-left-color: #ff8787; opacity: .85; }
.wk-card.cancelled .wk-time, .wk-card.moved-out .wk-time { text-decoration: line-through; }
.wk-card.cancelled .wk-note, .wk-card.moved-out .wk-note { color: #c92a2a; }
.wk-card.moved-in { background: #e7f3ff; border: 2px solid #339af0; border-left-width: 3px; }
.wk-card.moved-in .wk-note { color: #1864ab; }
.wk-menu { position: absolute; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px;
  box-shadow: 0 10px 30px rgba(30, 25, 70, .2); display: flex; flex-direction: column; gap: 4px; min-width: 230px; }
.wk-menu a { padding: 6px 8px; border-radius: 6px; }
.wk-menu a:hover { background: #f4efff; text-decoration: none; }
.slot.grp { background: #f4efff; }
.slot.indiv { background: #f1f3f5; }
.slot small a { color: inherit; text-decoration: underline dotted; }
tr.chg-moved td:first-child { color: var(--muted); }
@media (max-width: 1100px) { .wk-wrap.two { grid-template-columns: 1fr; } }

/* Правка расписания: кнопки-сегменты для дня и кабинета */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 15px; }
.seg input:checked + span { background: var(--navy, #1d1a39); color: #fff; border-color: var(--navy, #1d1a39); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.slot-form .field { margin-bottom: 12px; }
.slots-day h2 { margin-bottom: 6px; }
.slots-filter { max-width: 340px; margin-bottom: 12px; }
.slot-time { width: 110px; }
.indiv-name { color: #5c5a72; }
.inline-details { display: inline-block; position: relative; }
.inline-details summary { list-style: none; display: inline-block; }
.inline-details[open] form { position: absolute; right: 0; top: 34px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 8px 20px rgba(30, 25, 70, .15); white-space: nowrap; }
.btn.danger { background: #e03131; border-color: #e03131; color: #fff; }
.group-preview { font-size: 15px; margin: 0 0 12px; }


/* Цвет по виду занятия важнее белого фона будущих занятий */
.daygrid .dg-lesson.k-group { background: #f4efff; border-color: #ddd0ff; }
.daygrid .dg-lesson.k-indiv { background: #f1f3f5; border-color: #dee2e6; }
.daygrid .dg-lesson.k-cancelled, .daygrid .dg-lesson.k-moved-out { background: #fff0f0; border-color: #ffd6d6; }
.daygrid .dg-lesson.k-moved-in { background: #e7f3ff; border-color: #339af0; }
.dg-lesson.k-indiv .tag.violet { background: #e9ecef; color: #495057; }
.inline-details summary.btn { margin: 0; vertical-align: middle; }
td.r.nowrap > * { vertical-align: middle; }
.group-name-details { margin: 8px 0; }

/* Перетаскивание порядка */
.drag-cell { width: 84px; white-space: nowrap; }
.drag-handle { cursor: grab; touch-action: none; user-select: none; color: #6b6890; font-size: 22px; font-weight: 700; padding: 2px 6px; letter-spacing: -2px; }
.move-up, .move-down { border: 0; background: none; color: #6b6890; cursor: pointer; font-size: 14px; padding: 4px 5px; }
.move-up:hover, .move-down:hover, .drag-handle:hover { color: var(--accent); }
[data-sort-item].dragging { opacity: .6; background: #fff4ea; }
.photo-tools { display: flex; align-items: center; gap: 2px; }
form.changed .btn:not(.ghost) { box-shadow: 0 0 0 3px rgba(247, 103, 7, .25); }

/* Неделя вертикально, как постоянное расписание */
.week-table tr.today th, .week-table tr.today td { background: #fffaf5; }
.week-table tr.today th a { color: var(--accent, #f76707); }
.week-table th a { color: inherit; }
.week-table tr.empty-day td, .week-table tr.empty-day th { padding-top: 4px; padding-bottom: 4px; }
.week-table td, .week-table tbody th { vertical-align: top; }
.wk-card { border-left: 3px solid #9775fa; }
.wk-card.group { background: #f4efff; }
.wk-card b a { color: inherit; }
.wk-card a:hover { color: var(--accent); }
.wk-card .wk-note { color: inherit; font-weight: 600; }
.wk-add { display: block; width: 100%; border: 1px dashed #d8d5e8; background: none; color: var(--muted); border-radius: 6px;
  cursor: pointer; font-size: 15px; line-height: 1; padding: 3px 0; opacity: .55; }
.week-table td:hover .wk-add, .wk-add:focus { opacity: 1; }
.wk-add:hover { border-color: var(--accent); color: var(--accent); }
.wk-wrap.two .week-table th:first-child { width: 64px; }

.j-saved { font-weight: 400; }
.j-saved.flash { animation: jsaved 1.2s ease-out; }
@keyframes jsaved { from { background: #fff3bf; } to { background: transparent; } }
.reset-box { max-width: 640px; }
.reset-box ul { margin: 6px 0 12px 18px; padding: 0; }

/* Изменение места в расписании: мини-неделя слева */
.slot-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.slot-layout .form-card { max-width: none; margin: 0; }
.mini-week { position: sticky; top: 8px; padding: 12px; }
.mini-week h2 { font-size: 15px; margin: 0 0 8px; }
table.mini { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
table.mini th { font-weight: 600; color: var(--muted); padding: 3px; text-align: left; }
table.mini thead th { font-size: 11px; }
table.mini tbody th { width: 26px; vertical-align: top; }
table.mini td { vertical-align: top; padding: 2px; border-top: 1px solid #eeedf5; border-left: 1px solid #eeedf5; }
table.mini td.target { background: #fff4e6; outline: 2px solid var(--accent, #f76707); outline-offset: -2px; border-radius: 4px; }
.mini-slot { background: #f4efff; border-left: 2px solid #9775fa; border-radius: 3px; padding: 1px 3px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.mini-slot.indiv { background: #f1f3f5; border-left-color: #adb5bd; }
.mini-slot.current { background: #e7f3ff; border-left-color: #339af0; font-weight: 600; }
.mini-slot.clash { background: #ffe3e3; border-left-color: #fa5252; }
.mini-key { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; margin-left: 6px; }
.mini-key.current { background: #e7f3ff; border: 1px solid #339af0; }
.mini-key.target { background: #fff4e6; border: 1px solid var(--accent, #f76707); }
.slot-warn { background: #fff4e6; border: 1px solid #ffc078; color: #a3570b; border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; font-size: 14px; }
@media (max-width: 900px) { .slot-layout { grid-template-columns: 1fr; } .mini-week { position: static; order: 2; } }
/* Кнопки «Изменить» и «Убрать» на одной линии */
.slots-table td.r { white-space: nowrap; }
.slots-table td.r > .btn, .slots-table .inline-details { vertical-align: middle; }
.inline-details summary.btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.inline-details summary::-webkit-details-marker { display: none; }
/* Легенда «Недели» одной строкой с переносами по словам */
.wk-legend { display: block; line-height: 1.8; }
.wk-legend .wk-dot { vertical-align: -1px; margin: 0 3px 0 8px; }
.wk-legend .wk-dot:first-child { margin-left: 0; }

/* Уведомления и окно «Отправлено» */
.notif-filter { gap: 14px; align-items: center; }
.notif-table details summary { cursor: pointer; }
.notif-text { white-space: normal; font-size: 13px; color: var(--muted); margin-top: 4px; max-width: 520px; }
.pager { justify-content: center; gap: 12px; margin-top: 10px; }
.activity-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.activity-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.activity-bar i { display: block; width: 100%; min-height: 2px; background: var(--violet, #6c5ce7); border-radius: 3px 3px 0 0; }
.activity-bar span { font-size: 10px; color: var(--muted); }
dialog.sent-dialog { width: 520px; max-height: 85vh; overflow: auto; }
.sent-dialog h2 { margin: 0 0 8px; }
.sent-group { border-top: 1px solid var(--line, #e6e6ef); padding: 10px 0; }
.sent-group h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sent-item { margin-bottom: 8px; }
.sent-text { font-size: 13px; color: var(--muted); white-space: pre-line; }
.sent-group .btn.small { margin-top: 4px; }
.contact-icons { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: 6px; }
.contact-icons .ci { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; padding: 4px; cursor: pointer; display: inline-flex; }
.contact-icons .ci svg { width: 100%; height: 100%; fill: currentColor; }
.contact-icons .ci.tg { color: #229ed9; }
.contact-icons .ci.mail { color: var(--violet); }
.contact-icons .ci.off { color: #c9c8d6; cursor: default; }
dialog.msg-dialog textarea { width: 100%; display: block; margin-top: 3px; }

/* Журнал: три отметки («был», «не был, предупредил», «не был, не предупредил») и «ДЗ».
   На телефоне имя в строке сверху, кнопки под ним на всю ширину. */
.mark.excused, .mark.absent { line-height: 1.1; font-size: 12px; }
@media (max-width: 700px) {
  .roster, .roster tbody { display: block; }
  .roster tr { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .roster td { border-bottom: 0; padding: 2px 4px; }
  .roster td.marks { width: auto; text-align: left; white-space: normal; display: flex; gap: 4px; }
  .roster td.marks .mark + .mark { margin-left: 0; }
  .roster td.marks .mark { flex: 1 1 0; min-width: 0; height: auto; min-height: 40px; padding: 4px; }
  .roster td.marks .hw-mark { flex: 0 0 auto; }
}
.section-buttons { gap: 8px; margin: -4px 0 12px; }
.pe-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
/* Входящие письма */
.inbox-msg { padding: 0; margin-bottom: 8px; }
.inbox-msg > summary { list-style: none; cursor: pointer; padding: 12px 16px; display: grid; grid-template-columns: minmax(160px, 1fr) 2fr auto; gap: 10px; align-items: baseline; }
.inbox-msg > summary::-webkit-details-marker { display: none; }
.inbox-msg.unread > summary { font-weight: 600; border-left: 4px solid var(--accent, #f76707); }
.inbox-msg[open] > summary { border-bottom: 1px solid var(--line); }
.inbox-body, .inbox-replies, .inbox-reply { margin: 12px 16px; }
.inbox-msg > form.inline { display: block; margin: 0 16px 14px; }
.inbox-body { white-space: normal; line-height: 1.5; }
.inbox-replies { background: #f6f5fb; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.inbox-reply textarea { width: 100%; display: block; margin: 4px 0 8px; }
@media (max-width: 700px) { .inbox-msg > summary { grid-template-columns: 1fr; gap: 2px; } }
.demo-strip { background: #fff3bf; color: #5c4400; text-align: center; font-size: 13px; padding: 4px 12px; }
/* Телефон: широкие таблицы прокручиваются сами, страница вбок не уезжает */
@media (max-width: 700px) {
  .card table.table, .card .slots-table, table.notif-table, .page > table.table { display: block; overflow-x: auto; max-width: 100%; }
  .wk-wrap.two { display: block; }
  .wk-wrap.two > * + * { margin-top: 14px; }
}
.promo-banner { border: 2px solid var(--accent); background: #fff8f1; margin-bottom: 16px; }
.promo-banner h2 { margin-top: 0; }
.promo-banner p { margin: 6px 0; }

/* Расписание студии для учеников и преподавателей: свои занятия выделены */
.studio-week .wk-card.mine { outline: 2px solid var(--accent, #f76707); outline-offset: -2px; }
.studio-week .wk-mine { color: var(--accent, #f76707); font-weight: 600; }

/* Переписка об отработке */
.mr-box { margin: 6px 0 4px; padding: 10px 12px; background: #f6f5ff; border-radius: 10px; }
.mr-box p { margin: 6px 0; }
.mr-log { margin: 4px 0 8px; padding-left: 18px; }
.mr-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mr-actions .row { width: 100%; }
.mr-actions input[type=text] { flex: 1 1 200px; min-width: 0; }
.me-discounts { margin: 8px 0; padding: 8px 12px; background: #f1fbf4; border-radius: 10px; }
.me-discounts p { margin: 2px 0; }

.discount-help { background: #f6f5ff; }
.discount-help p { margin: 4px 0 8px; font-size: 14px; line-height: 1.5; }

/* Сводный журнал: последние даты видны сразу, имена не уезжают при прокрутке */
.grid2 > div { min-width: 0; }
.matrix-wrap { width: 100%; max-width: 100%; }
.matrix { width: max-content; min-width: 100%; }
.matrix th, .matrix td { background: var(--card); white-space: nowrap; }
.matrix td:first-child, .matrix th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 2px 0 0 var(--line); }
.matrix thead th { background: var(--bg); }
.matrix thead th:first-child { z-index: 2; }
.matrix .m-e { background: var(--orange-bg); color: var(--orange); font-weight: 600; }
.enroll-help { margin: 6px 0 12px; }
.enroll-form { display: grid; grid-template-columns: minmax(0, 1fr) 145px auto; align-items: center; }
.row.tight.enroll-form select, .enroll-form input { width: 100%; max-width: none; min-width: 0; }
.enroll-form .btn { white-space: nowrap; }
@media (max-width: 900px) {
  .enroll-form { grid-template-columns: minmax(0, 1fr); }
}

/* Отметки и назначение отработки: одинаковая базовая линия и доступная ширина */
.roster td.marks .mark { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; height: auto; min-height: 34px; text-align: center; }
.roster td.marks .hw-mark { height: 34px; align-self: center; }
.absence-plan-form { display: grid; grid-template-columns: minmax(280px, 1fr) auto; align-items: center; width: 100%; }
.row.tight .absence-plan-select { width: 100%; max-width: none; min-width: 0; }
.absence-plan-form .btn { white-space: nowrap; }
@media (min-width: 901px) {
  .abs-card .table td:last-child { width: 45%; }
}
@media (max-width: 900px) {
  .absence-plan-form { grid-template-columns: minmax(0, 1fr); }
  .abs-card .table td:last-child { min-width: 0; }
}
@media (max-width: 700px) {
  .roster td.marks .hw-mark { height: auto; min-height: 40px; }
}
.sticky-actions { position: sticky; bottom: 0; z-index: 4; padding: 10px 0 2px; background: var(--card); }
.msg.error a { color: inherit; text-decoration: underline; }
#slots, #form-errors { scroll-margin-top: 80px; }

/* Полочки с материалами в домашнем задании */
.hw-shelf { margin-top: 12px; }
.hw-shelf-title { font-weight: 600; margin-bottom: 4px; }
.hw-material { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hw-material::before { content: ""; display: inline-block; width: 10px; height: 12px; margin-right: 6px; border-radius: 2px;
  background: var(--violet); vertical-align: -1px; }
.me-hw .hw-material { display: block; margin-top: 6px; }
.form.inline.hw-shelf-form label.hw-shelf-file { flex: 1 1 100%; }
.hw-shelf-form select { width: 100%; }
.shelf-files a { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* --- Телефон: переключатель дней, карточки вместо таблиц (05.11.2026) --- */
.daytabs.wk-mobile, .daytabs.perm-mobile { display: none; }
.daytabs-chips { display: flex; gap: 4px; margin: 0 0 10px; }
.daytabs-chips button { flex: 1 1 0; min-width: 0; border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 5px 0; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); cursor: pointer; }
.daytabs-chips button b { font-size: 16px; color: var(--ink); line-height: 1.2; }
.daytabs-chips button.today { border-color: var(--accent); }
.daytabs-chips button.empty { opacity: .55; }
.daytabs-chips button.active { background: var(--violet); border-color: var(--violet); color: #fff; opacity: 1; }
.daytabs-chips button.active b { color: #fff; }
.daytabs-title { font-size: 16px; margin: 4px 0 8px; }
.daytabs-title a { color: inherit; }
.daytabs-panel .slot { margin-bottom: 8px; }
.wk-line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wk-room { font-size: 12px; color: var(--muted); white-space: nowrap; }
.wk-add-day { opacity: 1; padding: 8px; margin-top: 4px; }
.wk-help summary { cursor: pointer; color: var(--violet); margin-bottom: 6px; }
@media (max-width: 700px) {
  .daytabs.wk-mobile, .daytabs.perm-mobile { display: block; }
  .wk-desktop, .perm-desktop, .wide-only { display: none !important; }
  .week-head h1 { font-size: 20px; flex: 1; text-align: center; }
  .week-head .spacer { display: none; }
  .week-head > .btn:not(.arrow) { flex: 1 1 auto; text-align: center; }
  .week-head .link { order: 5; width: 100%; text-align: center; }
}
.day-jump { display: none; gap: 4px; margin: 0 0 10px; }
.day-jump a { flex: 1; text-align: center; padding: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.slots-day { scroll-margin-top: 100px; }
@media (max-width: 700px) {
  .day-jump { display: flex; }
  .card .slots-table { display: block; overflow: visible; }
  .slots-table tbody { display: block; }
  .slots-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "time act" "name name" "room teacher";
    gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
  .slots-table td { padding: 0; border: 0; white-space: normal; min-width: 0; }
  .slots-table .slot-teacher { text-align: right; }
  .slots-table .slot-time { grid-area: time; } .slots-table .slot-room { grid-area: room; color: var(--muted); font-size: 13px; }
  .slots-table .slot-name { grid-area: name; } .slots-table .slot-teacher { grid-area: teacher; font-size: 13px; }
  .slots-table .slot-actions { grid-area: act; white-space: nowrap; }
  .slots-table .inline-details[open] form { position: static; margin-top: 6px; }
  .slots-table .slot-actions:has(details[open]) { grid-column: 1 / -1; grid-row: auto; }
}

/* Таблицы-карточки на телефоне и точечные правки вида (05.11.2026) */
.table-wrap { overflow-x: auto; }
#debts-table td.actions { white-space: normal; }
#debts-table td.actions .btn { display: block; width: 100%; margin: 0 0 6px; text-align: center; }
.brand { white-space: nowrap; flex: none; }
@media (max-width: 1440px) and (min-width: 901px) { .topbar { gap: 14px; } .topbar nav a { padding: 8px 9px; font-size: 14px; } }
@media (max-width: 700px) {
  .table-wrap:has(> table.mcards) { overflow: visible; }
  table.mcards { min-width: 0 !important; display: block; background: none; border-radius: 0; }
  table.mcards thead { display: none; }
  table.mcards tbody { display: block; }
  table.mcards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; background: var(--card);
    border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
  table.mcards td { display: block; grid-column: 1 / -1; padding: 0; border: 0; text-align: left; white-space: normal; min-width: 0; font-size: 14px; }
  table.mcards td[data-label]:not(.c-main):not(.c-money):not(.c-actions):not(:empty)::before {
    content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  table.mcards td.c-main { grid-column: 1; font-weight: 600; font-size: 15px; }
  table.mcards td.c-money { grid-column: 2; grid-row: 1; text-align: right; align-self: start; }
  table.mcards td.c-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
  table.mcards td.c-actions > .btn, table.mcards td.c-actions > form { flex: 1 1 auto; }
  table.mcards td.c-actions .btn { width: 100%; text-align: center; margin: 0; }
  table.mcards td:empty, table.mcards td.c-hide { display: none; }
  table.mcards td.empty { grid-column: 1 / -1; text-align: center; }
  table.mcards tr.link-row { cursor: pointer; }
  .tabs { flex-wrap: wrap; overflow: visible; }
  .pagehead .btn, .pagehead .tag { white-space: normal; }
  .pagehead h1 .tag { white-space: nowrap; }
  .dlist-body b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; }
}
@media (max-width: 900px) {
  /* кабинет ученика на телефоне: ближайшие занятия, ДЗ и оплата сверху, длинная история внизу */
  .me-student-grid { display: flex; flex-direction: column; }
  .me-student-grid > div { display: contents; }
  .me-student-grid > div > * { order: 7; }
  .me-student-grid .me-o1 { order: 1; } .me-student-grid .me-o2 { order: 2; } .me-student-grid .me-o3 { order: 3; }
  .me-student-grid .me-o4 { order: 4; } .me-student-grid .me-o5 { order: 5; } .me-student-grid .me-o6 { order: 9; }
  .me-student-grid .tag { white-space: normal; }
  .chip-link { border-radius: 10px; }
}
@media (max-width: 700px) { table.mcards td .tag { display: inline-block; width: auto; } }
.more-actions { position: relative; display: inline-block; }
.more-actions > summary { list-style: none; }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions .more-list { position: absolute; z-index: 20; top: 42px; left: 0; display: flex; flex-direction: column; gap: 6px; min-width: 240px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 8px 20px rgba(30, 25, 70, .15); }
.more-actions .more-list form, .more-actions .more-list .btn { width: 100%; text-align: left; }
.pagehead h1.with-avatar { flex-wrap: wrap; }
@media (max-width: 700px) {
  .more-actions .more-list { position: static; box-shadow: none; margin-top: 6px; min-width: 0; }
  .more-actions[open] { display: block; width: 100%; }
  table.mcards tr.details-row { margin-top: -12px; border-top: 0; border-radius: 0 0 12px 12px; }
  .card .table .tag { white-space: normal; }
}
@media (max-width: 700px) {
  table.mcards td.r:not(.c-money), table.mcards td.r.c-actions { text-align: left; }
  table.mcards td.c-actions > .btn, table.mcards td.c-actions > a.btn { width: auto; flex: 1 1 auto; }
}
#debts-table td:nth-child(3) { min-width: 220px; }
/* долги на ноутбуке: кнопки столбцом, текст переносится внутри кнопки, а не уезжает */
#debts-table td.actions { width: 190px; min-width: 170px; }
#debts-table td.actions .btn { height: auto; min-height: 32px; white-space: normal; line-height: 1.25; padding: 6px 10px; }
#debts-table td.reminder-cell { width: 130px; }
#debts-table td:nth-child(5) { width: 120px; }
.email-hint { display: block; margin-top: 4px; color: var(--orange); }
.email-hint .link-btn { color: var(--violet); text-decoration: underline; }
.login-hint { display: block; margin: -6px 0 10px; font-size: 12px; }
.dup-box { border: 2px solid var(--orange); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: var(--orange-bg); }
.dup-table tr.dup-diff td { background: #fff3bf; font-weight: 600; }
/* Отработки: карточка ученика, кабинет, страница «Отработки» */
.makeups-card { border-left: 4px solid var(--blue); }
.makeup-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.makeup-item:last-child { border-bottom: 0; }
.makeup-when b { display: block; }
.makeup-change { grid-column: 3; }
.makeup-change[open] { grid-column: 1 / -1; }
.makeup-change form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.makeup-change select { max-width: 100%; }
@media (max-width: 700px) {
  .makeup-item { grid-template-columns: minmax(0, 1fr) auto; }
  .makeup-when { grid-column: 1 / -1; }
  .makeup-change { grid-column: 2; grid-row: 2; }
  .makeup-change form, .makeup-change select, .makeup-change .btn { width: 100%; }
}
@media (max-width: 700px) { .makeup-change[open] { grid-column: 1 / -1; grid-row: 3; } .makeup-item .makeup-change[open] > summary { width: 100%; } }

/* Переключатель детей у входа родителя */
.kid-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.kid-switch .kid { border: 1px solid var(--line, #dfe3ea); background: var(--card, #fff); color: inherit; border-radius: 999px;
  padding: 7px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.kid-switch .kid.on { background: var(--accent, #f26a10); border-color: var(--accent, #f26a10); color: #fff; }

/* Анкета: ещё дети */
.extra-child { border-top: 2px dashed var(--line); margin-top: 18px; padding-top: 6px; }
.extra-child-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.add-child-row { margin: 14px 0 6px; }
.msg.info { background: #eaf1ff; color: var(--ink); }

/* Прошедшее занятие в группу */
.past-lesson h2 { font-size: 1.05rem; margin: 14px 0 6px; }
.past-lesson label.choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.past-lesson label.choice { color: var(--ink); font-size: 15px; }
.past-lesson label.choice input, .past-lesson .bulk-list input { width: auto; display: inline; margin: 4px 0 0; flex: none; }
.past-lesson .bulk-list label { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 15px; margin: 4px 0; }
.past-lesson .past-new { margin: 0 0 6px 26px; }
.past-lesson .past-new .row { flex-wrap: wrap; }
.past-lesson:has(input[name="source"][value="new"]:not(:checked)) .past-new { display: none; }

/* Несколько мест в расписании с ручным временем */
.lesson-schedule { border: 0; border-top: 1px solid var(--line); margin: 24px 0 0; padding: 20px 0 0; min-width: 0; }
.lesson-schedule > legend { padding: 0 10px 0 0; color: var(--ink); font-size: 20px; font-weight: 700; }
.lesson-schedule-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) repeat(2, minmax(105px, .65fr)) minmax(140px, 1fr) 44px;
  gap: 12px; align-items: end; border: 1px solid var(--line); border-radius: 12px; background: #fbfaff;
  margin: 0 0 12px; padding: 12px; min-width: 0; }
.lesson-schedule-row[hidden] { display: none; }
.lesson-schedule-row > legend { padding: 0 7px; margin-left: 2px; color: var(--violet); font-size: 13px; font-weight: 700; }
.lesson-schedule-row .field { min-width: 0; color: var(--ink); }
.lesson-schedule-row .field input, .lesson-schedule-row .field select { min-height: 44px; font-size: 16px; background: #fff; }
.lesson-schedule-row .field input[inputmode="numeric"] { font-variant-numeric: tabular-nums; text-align: center; }
.schedule-remove { width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.schedule-remove:hover:not(:disabled) { color: var(--red); border-color: var(--red); }
.schedule-remove:disabled { opacity: .35; cursor: default; }
.schedule-add { margin: 2px 0 0; }
.schedule-row-errors { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 8px; background: #fdecec;
  border: 1px solid var(--red); color: var(--red); font-size: 15px; line-height: 1.4; }
.schedule-row-errors p { margin: 0; overflow-wrap: anywhere; }
.schedule-row-errors p + p { margin-top: 4px; }
.lesson-schedule .errorlist.nonform { margin: 0 0 12px; padding: 10px 12px 10px 28px; border-radius: 8px; background: #fdecec;
  border: 1px solid var(--red); color: var(--red); }
.count-confirm { margin: 16px 0 0; padding: 12px 14px; border-radius: 8px; background: #fff6e0; border: 1px solid #e0a800;
  line-height: 1.45; }
.count-confirm p { margin: 0 0 8px; }
.count-confirm label { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.count-confirm input[type="checkbox"] { width: 24px; height: 24px; flex: 0 0 24px; margin: 0; }
.schedule-check-note { margin: 10px 0 0; }
.slot-form .lesson-schedule-row, .narrow .lesson-schedule-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 44px; }
.slot-form .lesson-schedule-row .field:first-of-type, .narrow .lesson-schedule-row .field:first-of-type { grid-column: 1 / -1; }
.slot-form .lesson-schedule-row .field:nth-of-type(4), .narrow .lesson-schedule-row .field:nth-of-type(4) { grid-column: 1 / 3; }
.slot-form .lesson-schedule-row .schedule-remove, .narrow .lesson-schedule-row .schedule-remove { grid-column: 3; grid-row: 3; }
@media (max-width: 900px) {
  .lesson-schedule-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 44px; gap: 10px; }
  .lesson-schedule-row .field:first-of-type { grid-column: 1 / -1; }
  .lesson-schedule-row .field:nth-of-type(4) { grid-column: 1 / 3; }
  .lesson-schedule-row .schedule-remove { grid-column: 3; grid-row: 3; }
  .schedule-add { width: 100%; min-height: 48px; }
}
@media (pointer: coarse) {
  .lesson-schedule-row .field input, .lesson-schedule-row .field select, .schedule-remove { min-height: 48px; }
}
