/* iCube CRM: единый проверенный каскад desktop + mobile. */

/* ===== Итоговый каскад из styles.css ===== */
:root{
  --bg:#f5f7fb;--panel:#fff;--text:#172033;--muted:#6b7280;--line:#e6e9ef;
  --accent:#2563eb;--accent2:#eff6ff;--green:#15803d;--greenbg:#ecfdf3;
  --red:#b42318;--redbg:#fef3f2;--amber:#b54708;--amberbg:#fffaeb;
  --purple:#6941c6;--purplebg:#f4f3ff;--shadow:0 8px 28px rgba(17,24,39,.06);
}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}
.app-shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh}.sidebar{background:#101828;color:#fff;padding:20px 16px;position:sticky;top:0;height:100vh;overflow:auto}.brand{display:flex;align-items:center;gap:10px;padding:3px 8px 22px;font-weight:800;font-size:19px}.brand-mark{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:linear-gradient(135deg,#60a5fa,#8b5cf6);font-weight:900}.nav{display:grid;gap:4px}.nav button{border:0;background:transparent;color:#cbd5e1;text-align:left;padding:10px 12px;border-radius:9px}.nav button:hover,.nav button.active{background:#1d2939;color:#fff}.nav small{display:block;color:#667085;margin:18px 12px 7px;text-transform:uppercase;font-size:10px;letter-spacing:.08em}.main{min-width:0}.topbar{height:66px;background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:10;backdrop-filter:blur(12px)}.crumb{font-weight:700}.top-actions{display:flex;align-items:center;gap:10px}.role-switch{border:1px solid var(--line);background:#fff;padding:8px 10px;border-radius:10px}.avatar{width:34px;height:34px;border-radius:50%;background:#e0e7ff;color:#3730a3;display:grid;place-items:center;font-weight:800}.content{padding:28px;max-width:1500px;margin:auto}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:22px}.page-head h1{margin:0 0 4px;font-size:27px;line-height:1.2}.muted{color:var(--muted)}.btn{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 13px;color:var(--text);display:inline-flex;align-items:center;gap:7px;justify-content:center}.btn:hover{background:#f9fafb}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.danger{color:var(--red);border-color:#fecdca;background:#fff}.btn.soft{background:var(--accent2);color:#1d4ed8;border-color:#dbeafe}.grid{display:grid;gap:16px}.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.card{background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.card.pad{padding:18px}.metric{padding:18px}.metric .label{color:var(--muted);font-size:13px}.metric .value{font-size:28px;font-weight:800;margin-top:8px}.metric .sub{font-size:12px;color:var(--muted);margin-top:4px}.section-title{display:flex;align-items:center;justify-content:space-between;margin:0 0 12px}.section-title h2{font-size:17px;margin:0}.attention{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.attention button{border:1px solid var(--line);background:#fff;border-radius:12px;padding:14px;text-align:left}.attention b{display:block;font-size:22px;margin-top:5px}.attention .warn{background:var(--amberbg)}.attention .zero{background:#f9fafb}.attention .debt{background:var(--redbg)}.list{display:grid}.row{display:grid;grid-template-columns:1.6fr 1fr 1fr .8fr auto;gap:12px;align-items:center;padding:13px 16px;border-top:1px solid var(--line)}.row:first-child{border-top:0}.row.header{font-size:12px;color:var(--muted);background:#fafbfc;border-radius:14px 14px 0 0}.row.clickable{cursor:pointer}.row.clickable:hover{background:#fafcff}.badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:12px;font-weight:700;width:max-content}.badge.green{background:var(--greenbg);color:var(--green)}.badge.blue{background:var(--accent2);color:#1d4ed8}.badge.amber{background:var(--amberbg);color:var(--amber)}.badge.red{background:var(--redbg);color:var(--red)}.badge.gray{background:#f2f4f7;color:#475467}.badge.purple{background:var(--purplebg);color:var(--purple)}.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}.search{min-width:250px;flex:1}.input,.select,.textarea{width:100%;border:1px solid #d0d5dd;border-radius:10px;background:#fff;padding:9px 11px;color:var(--text);outline:none}.input:focus,.select:focus,.textarea:focus{border-color:#84adff;box-shadow:0 0 0 3px #eff4ff}.textarea{min-height:90px;resize:vertical}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.field label{display:block;font-size:12px;font-weight:700;margin-bottom:6px;color:#475467}.span-2{grid-column:span 2}.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:18px;overflow:auto}.tabs button{border:0;background:transparent;padding:10px 12px;color:var(--muted);border-bottom:2px solid transparent;white-space:nowrap}.tabs button.active{color:#1d4ed8;border-bottom-color:#2563eb;font-weight:700}.split{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}.info-list{display:grid;gap:0}.info-line{display:flex;justify-content:space-between;gap:20px;padding:11px 0;border-top:1px solid var(--line)}.info-line:first-child{border-top:0}.info-line span:first-child{color:var(--muted)}.money{font-variant-numeric:tabular-nums;font-weight:700}.positive{color:var(--green)}.negative{color:var(--red)}.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}.day{min-height:118px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:9px}.day .date{font-size:12px;color:var(--muted);margin-bottom:7px}.event{border-radius:8px;padding:7px;margin-top:6px;background:var(--accent2);border-left:3px solid var(--accent);font-size:12px;cursor:pointer}.event.partner{background:#f4f3ff;border-left-color:#7f56d9}.event.done{background:#ecfdf3;border-left-color:#12b76a}.lesson-status{display:flex;gap:8px;flex-wrap:wrap}.attendance{display:grid;gap:9px}.student-check{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:#fff}.student-check input{width:19px;height:19px}.photo{border:1px dashed #98a2b3;background:#fff;border-radius:8px;padding:6px 9px;color:#475467}.photo.done{border-style:solid;background:var(--greenbg);color:var(--green);border-color:#abefc6}.notice{border-radius:11px;padding:12px 14px;background:#fffaeb;border:1px solid #fedf89;color:#7a2e0e}.modal-backdrop{position:fixed;inset:0;background:rgba(17,24,39,.44);display:grid;place-items:center;padding:18px;z-index:50}.modal{width:min(620px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:16px;padding:20px;box-shadow:0 24px 70px rgba(0,0,0,.2)}.modal h3{margin:0 0 14px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.teacher-shell{min-height:100vh;background:#f7f8fc}.teacher-top{background:#111827;color:#fff;padding:18px 18px 22px}.teacher-top-inner{max-width:680px;margin:auto;display:flex;justify-content:space-between;align-items:center}.teacher-content{max-width:680px;margin:auto;padding:18px}.teacher-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;margin-bottom:12px;box-shadow:var(--shadow)}.teacher-time{font-size:24px;font-weight:800}.teacher-lesson-head{display:flex;justify-content:space-between;gap:12px}.teacher-sticky{position:sticky;bottom:0;background:linear-gradient(transparent,#f7f8fc 20%);padding:26px 0 6px}.teacher-sticky .btn{width:100%;padding:13px}.big-action{font-size:16px;font-weight:800}.empty{text-align:center;padding:38px;color:var(--muted)}.kpi-line{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-top:1px solid var(--line)}.kpi-line:first-child{border-top:0}.progress{height:8px;border-radius:999px;background:#eef2f6;overflow:hidden;margin-top:7px}.progress>span{display:block;height:100%;background:#3b82f6}.partner-calc{display:grid;gap:10px}.calc-line{display:flex;justify-content:space-between;padding:9px 0;border-top:1px solid var(--line)}.calc-line.total{font-size:17px;font-weight:800;border-top:2px solid #d0d5dd}.settings-block{padding:18px;border-top:1px solid var(--line)}.settings-block:first-child{border-top:0}.settings-block h3{margin:0 0 13px}.setting-row{display:grid;grid-template-columns:1fr 180px;gap:15px;align-items:center;margin-top:10px}.mini{font-size:12px}.mobile-nav{display:none}
@media(max-width:1050px){.grid.cols-4{grid-template-columns:repeat(2,1fr)}.grid.cols-3{grid-template-columns:repeat(2,1fr)}.split{grid-template-columns:1fr}.row{grid-template-columns:1.4fr 1fr 1fr auto}.row>*:nth-child(4){display:none}.calendar{grid-template-columns:repeat(4,1fr)}}
@media(max-width:760px){.app-shell{display:block}.sidebar{display:none}.topbar{padding:0 15px;height:58px}.content{padding:16px 14px 82px}.page-head{align-items:center}.page-head h1{font-size:22px}.grid.cols-4,.grid.cols-3,.grid.cols-2,.form-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.attention{grid-template-columns:1fr}.row.header{display:none}.row{grid-template-columns:1fr auto;padding:13px}.row>*:not(:first-child):not(:last-child){display:none}.calendar{grid-template-columns:1fr}.day{min-height:auto}.mobile-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--line);z-index:20}.mobile-nav button{border:0;background:#fff;padding:10px 4px 12px;font-size:11px;color:#667085}.mobile-nav button.active{color:#1d4ed8;font-weight:800}.role-switch{max-width:150px}.setting-row{grid-template-columns:1fr 130px}}

.group-card{position:relative;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;background:#fff}
.group-card:hover{transform:translateY(-3px);box-shadow:0 14px 34px rgba(17,24,39,.12);border-color:#b9cdfd}
.group-card:active{transform:translateY(-1px)}
.group-card-hint{margin-top:12px;padding-top:10px;border-top:1px solid var(--line);font-size:12px;font-weight:700;color:#2563eb;opacity:0;transform:translateX(-4px);transition:opacity .16s ease,transform .16s ease}
.group-card:hover .group-card-hint{opacity:1;transform:translateX(0)}
.event{transition:transform .12s ease,box-shadow .12s ease}
.event:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(37,99,235,.12)}

.event-cancelled{background:var(--redbg)!important;border-left-color:#f04438!important;opacity:.82}
.event-cancelled:hover{box-shadow:0 5px 14px rgba(240,68,56,.12)}

.balance-block{overflow:hidden}
.balance-block-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;padding:20px 22px 16px;border-bottom:1px solid var(--line)}
.balance-block-head h2{margin:0;font-size:18px;line-height:1.25}
.balance-block-count{margin-top:5px}
.balance-block .list{border-top:0}
.balance-block .row.header{border-radius:0;background:#fafbfc}
@media(max-width:760px){
  .balance-block-head{padding:16px;gap:12px}
}

.child-ledger-card{overflow:hidden}
.child-ledger-head{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:20px 22px 16px;border-bottom:1px solid var(--line)}
.child-ledger-head h2{margin:0;font-size:20px;line-height:1.25}
.child-ledger-count{margin-top:5px}
.child-ledger-card .list{border-top:0}
.child-ledger-card .row.header{border-radius:0;background:#fafbfc}
.child-ledger-card .row:not(.header){min-height:58px}
@media(max-width:760px){
  .child-ledger-head{padding:16px;align-items:flex-start}
}

.payment-main-row{grid-template-columns:1.35fr 1fr .8fr .8fr .55fr minmax(max-content,2fr)}
.page-actions,.payment-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}.payment-row-actions{flex-wrap:nowrap;white-space:nowrap}.sort-order-button{width:42px;min-width:42px;height:42px;padding:0;font-size:20px;line-height:1}
@media(max-width:900px){
  .payment-main-row{grid-template-columns:1.2fr 1fr .8fr .8fr}
  .payment-main-row>div:nth-child(5),.payment-main-row>div:nth-child(6){grid-column:auto}
}


/* Group direction accents */
.group-direction-robot{border-top:4px solid #3b82f6;background:linear-gradient(180deg,#f8fbff 0,#fff 34%)}
.group-direction-program{border-top:4px solid #8b5cf6;background:linear-gradient(180deg,#faf8ff 0,#fff 34%)}
.group-direction-robot:hover{border-color:#93c5fd}
.group-direction-program:hover{border-color:#c4b5fd}
.group-empty-create{width:100%;min-height:42px}
.btn:disabled{opacity:.5;cursor:not-allowed}


.group-project-filter{margin:0 0 16px}
.partner-settlement{max-width:760px}
.partner-lines{display:grid;gap:0;margin-top:8px}
.partner-line{display:flex;justify-content:space-between;gap:20px;padding:11px 0;border-top:1px solid var(--line)}
.partner-line:first-child{border-top:0}
.partner-line span{color:var(--muted)}
.partner-line b{font-variant-numeric:tabular-nums}
.partner-divider{border-top:2px solid #d0d5dd;margin-top:4px;padding-top:14px;font-size:17px}
.partner-divider span,.partner-divider b{color:var(--text)}
.partner-cash-box{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.partner-cash-box label{display:block;font-weight:700;margin-bottom:7px}
.partner-final{margin-top:16px;border-radius:14px;padding:18px 20px;display:flex;justify-content:space-between;align-items:center;gap:16px;font-size:18px}
.partner-final b{font-size:26px}
.partner-final-pay{background:var(--greenbg);color:var(--green);border:1px solid #abefc6}
.partner-final-return{background:var(--redbg);color:var(--red);border:1px solid #fecdca}
.partner-final-zero{background:#f8fafc;color:var(--text);border:1px solid var(--line)}
.partner-final-caption{font-size:12px;font-weight:700;opacity:.72;margin-bottom:3px}
.partner-final-direction{font-size:12px;opacity:.72;margin-top:3px}
@media(max-width:760px){
  .partner-final{align-items:flex-start;flex-direction:column}
}


/* Calendar polish v1.1.18 */
.calendar{grid-template-columns:repeat(7,minmax(0,1fr));gap:10px}
.day{min-height:132px;border-radius:14px;padding:10px;background:#fff;box-shadow:0 1px 2px rgba(16,24,40,.03)}
.day .date{font-size:12px;font-weight:700;color:#667085;margin-bottom:8px}
.event{padding:8px 9px;margin-top:7px;border-radius:9px;line-height:1.3;overflow:hidden;word-break:normal;overflow-wrap:normal}
.event>div:nth-child(2){margin-top:3px;font-weight:600}
.teacher-content{max-width:900px}
.teacher-top-inner{max-width:900px}

@media(max-width:1100px){
  .calendar{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
  .day{min-height:122px;padding:8px}
}

@media(max-width:760px){
  .calendar{display:block}
  .calendar>.muted.mini{display:none}
  .day{min-height:auto;margin-bottom:10px;padding:10px 11px;border-radius:13px}
  .day:empty{display:none}
  .day .date{font-size:13px;margin-bottom:6px}
  .event{font-size:13px;padding:9px 10px;margin-top:6px}
  .event .mini{font-size:11px}
  .teacher-content{padding:14px 12px 24px}
  .teacher-top{padding:14px 12px 18px}
  .teacher-top-inner{display:block}
  .teacher-top-inner>div+div{margin-top:10px}
}


/* Calendar redesign v1.1.18 */
.calendar-toolbar{display:flex;justify-content:space-between;gap:16px;align-items:flex-end;flex-wrap:wrap;margin:14px 0 16px}
.calendar-toolbar-nav,.calendar-toolbar-filters,.calendar-mode-switch{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.calendar-toolbar-filters .select{min-width:180px;max-width:220px}
.calendar-period-title{font-size:16px;font-weight:800;color:#101828;margin-left:8px;white-space:nowrap}
.calendar-arrow{width:42px;padding-left:0;padding-right:0;justify-content:center}
.calendar-weekdays{margin-bottom:8px}
.calendar-weekdays>div{font-size:12px;font-weight:700;color:#667085;padding:0 8px}
.calendar-grid .day{min-width:0;min-height:128px}
.calendar-grid .calendar-week-day{min-height:220px}
.calendar-empty{background:transparent;border-style:dashed;opacity:.45;box-shadow:none}
.calendar-today{border-color:#7aa7f8!important;box-shadow:inset 0 0 0 1px #7aa7f8!important;background:#fff!important}
.today-label{display:inline-block;margin-left:6px;font-size:10px;font-weight:700;color:#2563eb;background:#eff6ff;border-radius:999px;padding:2px 6px;vertical-align:1px}
.calendar-event-site{font-weight:700;line-height:1.25;white-space:normal;word-break:normal;overflow-wrap:normal}
.calendar-event-meta{margin-top:3px;font-weight:600;color:#344054;line-height:1.25;white-space:normal;word-break:normal;overflow-wrap:normal}
.calendar-event-status{margin-top:5px}
.calendar-mobile{display:none}
.calendar-page-head h1{margin:2px 0 4px}
.site-project-readonly{min-height:40px;display:flex;align-items:center;padding:9px 11px;border:1px solid #e4e7ec;border-radius:10px;background:#f9fafb;color:#344054;font-weight:600}

@media(min-width:761px){
  .calendar-grid .event,.calendar-week-day .event{min-width:0;min-height:42px;word-break:normal;overflow-wrap:normal}
}
@media(min-width:761px) and (max-width:1300px){
  .calendar{gap:8px}
  .calendar-grid .day,.calendar-week-day{padding:8px}
  .calendar-grid .event,.calendar-week-day .event{font-size:11px;padding:7px 8px;margin-top:5px;line-height:1.25;min-height:44px}
}
@media(min-width:761px) and (max-width:1100px){
  .calendar{gap:6px}
  .calendar-grid .day,.calendar-week-day{padding:7px}
  .calendar-grid .event,.calendar-week-day .event{font-size:10.5px;padding:6px 7px;margin-top:4px;min-height:44px}
}

@media(max-width:760px){
  .calendar-desktop{display:none}
  .calendar-mobile{display:block}
  .calendar-toolbar{display:block;margin:12px 0 14px}
  .calendar-toolbar-nav{display:grid;grid-template-columns:auto auto auto 1fr;gap:7px}
  .calendar-toolbar-nav .btn{min-height:40px}
  .calendar-period-title{grid-column:1/-1;margin:2px 0 0;text-align:left;font-size:17px}
  .calendar-toolbar-filters{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
  .calendar-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:8px;grid-column:1/-1}
  .calendar-mode-switch .btn{width:100%}
  .calendar-toolbar-filters .select{min-width:0;max-width:none;width:100%}
  .calendar-toolbar-filters .select:only-of-type{grid-column:1/-1}
  .calendar-agenda-day{background:#fff;border:1px solid var(--line);border-radius:14px;padding:11px;margin-bottom:10px;box-shadow:0 1px 2px rgba(16,24,40,.03)}
  .calendar-agenda-day.calendar-today{border-color:#7aa7f8!important;box-shadow:inset 0 0 0 1px #7aa7f8!important}
  .calendar-agenda-date{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:7px;color:#344054}
  .calendar-agenda-date span{font-size:11px;font-weight:700;color:#2563eb;background:#eff6ff;border-radius:999px;padding:3px 7px}
  .calendar-agenda-day .event{margin-top:7px;font-size:13px}
  .calendar-no-events{font-size:13px;color:#98a2b3;padding:7px 2px 2px}
  .calendar-mobile-empty{background:#fff;border:1px solid var(--line);border-radius:14px;padding:24px;text-align:center;color:#667085}
  .calendar-page-head h1{font-size:24px}
  .teacher-content{max-width:none;width:100%;box-sizing:border-box}
}


/* Mobile director UX v1.1.19 */
.mobile-top-left{display:flex;align-items:center;gap:10px;min-width:0}
.mobile-menu-button{display:none;border:1px solid var(--line);background:#fff;border-radius:10px;width:40px;height:40px;font-size:20px;line-height:1;align-items:center;justify-content:center;color:#101828}
.mobile-drawer-backdrop{display:none}

@media(max-width:760px){
  .mobile-nav{display:none!important}
  .mobile-menu-button{display:inline-flex}
  .topbar{height:auto;min-height:58px;padding:8px 12px;gap:10px}
  .top-actions{gap:8px}
  .top-actions .avatar{display:none}
  .crumb{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:145px}
  .role-switch{max-width:132px;font-size:13px}
  .top-actions .mini{font-size:10px}
  .content{padding:14px 12px 28px}
  .page-head{align-items:flex-start;gap:10px;flex-wrap:wrap;margin-bottom:14px}
  .page-head>div:first-child{min-width:0;flex:1 1 100%}
  .page-head h1{font-size:24px;line-height:1.15;margin-bottom:4px}
  .page-head .muted{font-size:13px;line-height:1.35}
  .page-head>.btn,.page-head>div:last-child:not(:first-child){max-width:100%}

  .grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .grid.cols-3,.grid.cols-2{grid-template-columns:1fr;gap:10px}
  .card{border-radius:14px}
  .card.pad{padding:14px}
  .metric{padding:14px}
  .metric .label{font-size:12px}
  .metric .value{font-size:28px;line-height:1.05}
  .metric .sub{font-size:12px;line-height:1.3}
  .section-title{align-items:flex-start;gap:8px;flex-wrap:wrap}
  .section-title h2{font-size:18px}
  .attention{grid-template-columns:1fr;gap:8px}
  .attention button{min-height:58px}

  .toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch}
  .toolbar .input,.toolbar .select,.toolbar .btn{min-width:0;max-width:none!important}
  .toolbar .input,.toolbar .select{flex:1 1 150px}
  .toolbar .btn{flex:0 0 auto}

  .row{display:grid!important;grid-template-columns:1fr auto!important;gap:8px;padding:12px 14px}
  .row.header{display:none!important}
  .row>*{display:block!important;min-width:0}
  .row>*:not(:first-child):not(:last-child){font-size:12px;color:#667085}
  .row>*:last-child{text-align:right}
  .row b,.row .money{overflow-wrap:anywhere}

  .child-ledger-card,.balance-block{overflow:visible}
  .child-ledger-head,.balance-block-head{padding:14px;gap:10px;flex-wrap:wrap}
  .child-ledger-head .btn{width:100%}

  .info-line{gap:12px;align-items:flex-start}
  .info-line span:first-child{flex:0 0 42%}
  .info-line>*:last-child{text-align:right;overflow-wrap:anywhere}
  .student-check{grid-template-columns:auto minmax(0,1fr);padding:10px}
  .student-check .photo{grid-column:2;width:max-content;max-width:100%}
  .modal{padding:16px;border-radius:14px}
  .modal-actions{flex-wrap:wrap}
  .modal-actions .btn{flex:1 1 120px}

  .setting-row{grid-template-columns:1fr;gap:8px}
  .setting-row .input,.setting-row .select{width:100%}

  .partner-settlement{padding:14px}
  .partner-line{gap:12px}
  .partner-line span{min-width:0}
  .partner-line b{text-align:right;white-space:nowrap}

  .mobile-drawer-backdrop{display:block;position:fixed;inset:0;background:rgba(15,23,42,.42);z-index:100}
  .mobile-drawer{position:absolute;left:0;top:0;bottom:0;width:min(86vw,320px);background:#0f172a;color:#fff;box-shadow:18px 0 40px rgba(0,0,0,.18);overflow-y:auto}
  .mobile-drawer-head{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid rgba(255,255,255,.08)}
  .mobile-drawer-head .brand{margin:0}
  .mobile-drawer-close{border:0;background:rgba(255,255,255,.08);color:#fff;width:36px;height:36px;border-radius:10px;font-size:24px;line-height:1}
  .mobile-drawer-nav{padding:10px}
  .mobile-drawer-nav button{display:block;width:100%;text-align:left;border:0;background:transparent;color:#cbd5e1;border-radius:10px;padding:11px 12px;font-size:15px;margin:2px 0}
  .mobile-drawer-nav button.active{background:#1e293b;color:#fff;font-weight:700}
  .mobile-drawer-section{padding:14px 12px 6px;font-size:10px;text-transform:uppercase;letter-spacing:.12em;color:#64748b}
}

@media(max-width:390px){
  .grid.cols-4{grid-template-columns:1fr}
  .crumb{max-width:110px}
  .role-switch{max-width:118px}
  .content{padding-left:10px;padding-right:10px}
}

.lesson-student-flags{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px;min-width:0}
.lesson-student-flag{display:inline-flex;align-items:center;max-width:100%;padding:2px 7px;border-radius:999px;font-size:11px;font-weight:700;line-height:1.25;white-space:nowrap}
.lesson-student-flag.absence{background:#fff4e5;color:#9a4d00}
.lesson-student-flag.birthday{background:#f4ebff;color:#6941c6}
@media(max-width:760px){
  .lesson-student-flags{gap:3px;margin-top:2px}
  .lesson-student-flag{padding:2px 5px;font-size:10px}
}

.lesson-photo-control{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;min-width:0}
.lesson-photo-thumbs{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.lesson-photo-thumb{position:relative;width:52px;height:52px;padding:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff;cursor:pointer}
.lesson-photo-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.lesson-photo-thumb span{position:absolute;right:2px;bottom:2px;min-width:17px;height:17px;padding:0 3px;border-radius:9px;background:var(--green);color:#fff;font-size:11px;line-height:17px;text-align:center}
.lesson-photo-thumb.is-waiting span,.lesson-photo-thumb.is-uploading span{background:#d97706}
.lesson-photo-thumb.is-error span{background:var(--red)}
.lesson-photo-preview{display:block;width:100%;max-height:62vh;object-fit:contain;border-radius:12px;background:#f3f4f6}
.lesson-photo-expired{display:grid;place-items:center;min-height:180px;border:1px dashed var(--line);border-radius:12px;background:#f8fafc;color:var(--muted)}
.lesson-photo-thumb.is-expired{background:#f3f4f6;color:var(--muted)}
.lesson-photo-expired-mark{font-size:20px}
.lesson-photo-actions{flex-wrap:wrap}
@media(max-width:390px){
  .student-check{align-items:flex-start}
  .lesson-photo-control{width:100%;justify-content:flex-start;margin-top:8px}
  .lesson-photo-thumbs{justify-content:flex-start}
  .lesson-photo-actions .btn{width:100%}
}

/* ===== Итоговый каскад из mobile-fixes.css ===== */
/* Mobile/UI stabilization layer */
html,body{max-width:100%;overflow-x:hidden}
img,svg,canvas{max-width:100%}

@media(max-width:760px){
  body{font-size:14px}
  .main,.content,.teacher-shell,.teacher-content{min-width:0;max-width:100%;overflow-x:hidden}
  .content{padding-left:12px!important;padding-right:12px!important;padding-bottom:24px!important}

  /* Prevent iOS Safari zooming inputs and jumping the layout when modals open. */
  input,select,textarea{font-size:16px!important}

  /* Dialogs always fit inside the viewport and only scroll vertically. */
  .modal-backdrop{
    padding:12px!important;
    overflow:hidden!important;
    align-items:center!important;
  }
  .modal{
    width:calc(100vw - 24px)!important;
    max-width:620px!important;
    max-height:calc(100dvh - 24px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding:16px!important;
    border-radius:16px!important;
    overscroll-behavior:contain;
  }
  .modal *{max-width:100%}
  .modal .form-grid{grid-template-columns:minmax(0,1fr)!important;gap:13px!important}
  .modal .span-2{grid-column:auto!important}
  .modal .field,.modal .field>*{min-width:0!important}
  .modal .input,.modal .select,.modal .textarea{width:100%!important;min-width:0!important}
  .modal .field>div[style*="grid-template-columns"]{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;width:100%!important;min-width:0!important}
  .modal-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;position:sticky;bottom:-16px;background:#fff;padding:12px 0 2px;margin-top:16px!important}
  .modal-actions .btn{width:100%!important;min-width:0!important;white-space:normal!important}

  /* General card/list alignment. */
  .card,.teacher-card{min-width:0}
  .section-title{align-items:flex-start!important}
  .section-title>*{min-width:0}
  .section-title h2{line-height:1.2}
  .badge{max-width:100%;white-space:normal;text-align:center}
  .kpi-line{gap:10px;align-items:flex-start!important}
  .kpi-line>div{min-width:0;flex:1}
  .kpi-line>b,.kpi-line>span{min-width:0}

  /* Generic data rows: keep related values grouped instead of scattering them. */
  .row:not(.header){
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:7px 12px!important;
    padding:13px 14px!important;
  }
  .row:not(.header)>*{
    display:block!important;
    min-width:0!important;
    flex:1 1 42%!important;
    overflow-wrap:anywhere;
  }
  .row:not(.header)>*:first-child{flex:1 1 58%!important}
  .row:not(.header)>*:last-child{flex:0 0 auto!important;margin-left:auto;text-align:right}
  .row:not(.header)>div:empty{display:none!important}

  /* Payment rows use two clean columns and actions below. */
  .payment-main-row{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px 14px!important}
  .payment-main-row>*{display:block!important;min-width:0!important}
  .payment-main-row>*:last-child{grid-column:1/-1!important;margin-left:0!important;display:flex!important;justify-content:flex-end!important;gap:8px!important;flex-wrap:wrap}

  /* Child-card ledgers. */
  .child-ledger-head{align-items:flex-start!important}
  .child-ledger-card .row:not(.header){border-top:1px solid var(--line)}

  /* Avoid tiny orphan punctuation/metadata lines. */
  .muted.mini{overflow-wrap:anywhere}

  /* Teacher attendance cards keep checkbox, name and photo aligned. */
  .student-check{
    grid-template-columns:auto minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:10px!important;
    padding:11px!important;
  }
  .student-check>div{min-width:0!important}
  .student-check .photo{grid-column:auto!important;width:auto!important;max-width:120px!important;white-space:nowrap}
  .student-check label.mini{line-height:1.3}
  .teacher-card{padding:14px!important}
  .teacher-content{padding:14px 12px calc(20px + env(safe-area-inset-bottom))!important}
  .teacher-top{padding-top:calc(14px + env(safe-area-inset-top))!important}
  .teacher-sticky{padding-bottom:calc(6px + env(safe-area-inset-bottom))!important}

  /* Top bar stays compact and stable. */
  .topbar{padding-left:12px!important;padding-right:12px!important}
  .mobile-top-left{min-width:0;flex:1}
  .crumb{min-width:0;max-width:150px!important}
  .top-actions{flex:0 0 auto}

  /* Forms/toolbars should not create horizontal scrolling. */
  .toolbar,.page-head,.split,.grid,.form-grid{max-width:100%}
  .toolbar>*{min-width:0!important}
  .toolbar .search{flex:1 1 100%!important}
  .toolbar .select{flex:1 1 150px!important}
  .toolbar .btn{white-space:normal}

  /* Tabs remain swipeable without widening the whole page. */
  .tabs{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .tabs::-webkit-scrollbar{display:none}

  /* Partner and statistics number alignment. */
  .partner-line,.calc-line,.info-line{align-items:flex-start!important}
  .partner-line span,.calc-line span,.info-line span{min-width:0}
  .partner-line b,.calc-line b,.info-line b{flex:0 0 auto;text-align:right;max-width:52%;overflow-wrap:anywhere}

  /* Group/site/teacher cards. */
  .group-card h3,.card h3{overflow-wrap:anywhere}
  .group-card .info-line b{max-width:58%}

  /* Long primary buttons shouldn't push outside the screen. */
  .btn{max-width:100%}
  .btn.primary{white-space:normal;text-align:center}
}

@media(max-width:390px){
  .modal-actions{grid-template-columns:1fr!important}
  .student-check{grid-template-columns:auto minmax(0,1fr)!important}
  .student-check .photo{grid-column:2!important;justify-self:start}
  .role-switch{max-width:112px!important}
  .crumb{max-width:96px!important}
}

/* ===== Итоговый каскад из mobile-fixes2.css ===== */
/* Mobile refinement layer v1.1.20 */
html,body{overscroll-behavior-x:none}
body.modal-open{overflow:hidden!important;touch-action:none}

@media(max-width:760px){
  .modal-backdrop{touch-action:none!important;padding:10px!important}
  .modal{width:min(620px,calc(100vw - 20px))!important;max-height:calc(100dvh - 20px)!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:16px!important}
  .modal *{min-width:0;box-sizing:border-box}
  .modal-actions{position:static!important;bottom:auto!important;padding:4px 0 0!important;margin-top:18px!important;background:transparent!important}
  .modal .field>div[style*="grid-template-columns"]{grid-template-columns:minmax(0,1fr) 22px minmax(0,1fr)!important;gap:8px!important}
  .modal .field>div[style*="grid-template-columns"]>span{display:flex!important;align-items:center!important;justify-content:center!important;width:22px!important;min-width:22px!important}

  .page-children .list .row:not(.header){display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px 12px!important;position:relative!important;padding:14px 40px 14px 14px!important;align-items:start!important}
  .page-children .list .row:not(.header)>*{margin:0!important;min-width:0!important;flex:none!important}
  .page-children .list .row:not(.header)>:nth-child(1){grid-column:1;grid-row:1}
  .page-children .list .row:not(.header)>:nth-child(2){grid-column:2;grid-row:1;justify-self:end}
  .page-children .list .row:not(.header)>:nth-child(3){grid-column:1;grid-row:2;color:var(--muted)}
  .page-children .list .row:not(.header)>:nth-child(4){grid-column:2;grid-row:2;justify-self:end;text-align:right}
  .page-children .list .row:not(.header)>:nth-child(5){position:absolute!important;right:14px!important;top:50%!important;transform:translateY(-50%)!important;font-size:22px!important;line-height:1!important}

  .page-balances .row:not(.header),.page-payments .row:not(.header),.page-refunds .row:not(.header){align-items:start!important}
  .page-balances .row:not(.header)>*,.page-payments .row:not(.header)>*,.page-refunds .row:not(.header)>*{line-height:1.35}

  .student-check{display:grid!important;grid-template-columns:38px minmax(0,1fr)!important;align-items:start!important;gap:8px 10px!important}
  .student-check>input,.student-check>span:first-child{grid-column:1;grid-row:1;align-self:start;margin-top:4px}
  .student-check>div{grid-column:2;grid-row:1;display:grid!important;gap:5px!important;justify-items:start!important;align-items:start!important;width:100%}
  .student-check .photo{grid-column:2!important;justify-self:start!important;margin-top:4px!important}
  .student-check .badge{margin-left:0!important}

  .teacher-card .section-title{display:flex!important;align-items:center!important;justify-content:space-between!important;flex-wrap:nowrap!important}
  .teacher-card .section-title h2{min-width:0!important}
  .teacher-card .section-title .badge{flex:0 0 auto!important}

  .info-line{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:12px!important}
  .info-line span:first-child{max-width:none!important}
  .info-line b{max-width:none!important;text-align:right!important;overflow-wrap:anywhere}

  .page-head .btn.primary{max-width:100%!important}
  .tabs button{flex:0 0 auto}
}

@media(max-width:390px){
  .page-children .list .row:not(.header){grid-template-columns:minmax(0,1fr) auto!important}
  .student-check{grid-template-columns:34px minmax(0,1fr)!important}
}

/* ===== Итоговый каскад из mobile-fixes3.css ===== */
/* Targeted mobile cleanup v1.1.21 */
*,*::before,*::after{box-sizing:border-box}

@media(max-width:760px){
  /* Native iOS controls must never overflow their container. */
  input,select,textarea,button{max-width:100%}
  .input,.select,.textarea{width:100%;min-width:0}
  input[type="date"],input[type="time"]{min-width:0;width:100%;-webkit-min-logical-width:0}

  /* Modal fields: keep all content inside the dialog. */
  .modal{padding:16px!important}
  .modal .field{min-width:0!important;width:100%!important}
  .modal .field>div[style*="grid-template-columns"]{
    grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr)!important;
    gap:6px!important;
    width:100%!important;
    min-width:0!important;
  }
  .modal .field>div[style*="grid-template-columns"]>.input{
    width:100%!important;min-width:0!important;padding-left:8px!important;padding-right:8px!important;
  }
  .modal .field>div[style*="grid-template-columns"]>span{
    width:24px!important;min-width:24px!important;display:flex!important;align-items:center!important;justify-content:center!important;
    position:static!important;transform:none!important;margin:0!important;
  }

  /* Add-child dialog: keep candidate information tidy, don't squash the badge. */
  .modal .student-check{
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    gap:8px 10px!important;
    align-items:start!important;
  }
  .modal .student-check>input,.modal .student-check>span:first-child{grid-column:1!important;grid-row:1!important;margin-top:4px!important}
  .modal .student-check>div{grid-column:2!important;grid-row:1!important;display:block!important;min-width:0!important}
  .modal .student-check>div>b{display:block!important;margin-bottom:3px!important}
  .modal .student-check .badge{display:inline-flex!important;width:auto!important;max-width:100%!important;white-space:nowrap!important;margin:7px 0 0!important}
  .modal .student-check .photo{grid-column:2!important;grid-row:2!important;justify-self:start!important;margin:4px 0 0!important}

  /* Teachers: name, phone, direction, status vertically; edit remains in the corner. */
  .page-teachers .card.list .row:not(.header){
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto auto auto auto!important;
    gap:6px 12px!important;
    align-items:center!important;
    padding:15px!important;
  }
  .page-teachers .card.list .row:not(.header)>*{margin:0!important;min-width:0!important;flex:none!important;text-align:left!important}
  .page-teachers .card.list .row:not(.header)>:nth-child(1){grid-column:1/-1;grid-row:1}
  .page-teachers .card.list .row:not(.header)>:nth-child(2){grid-column:1/-1;grid-row:2;color:var(--muted)}
  .page-teachers .card.list .row:not(.header)>:nth-child(3){grid-column:1/-1;grid-row:3;color:var(--muted);overflow-wrap:anywhere}
  .page-teachers .card.list .row:not(.header)>:nth-child(4){grid-column:1;grid-row:4;justify-self:start}
  .page-teachers .card.list .row:not(.header)>:nth-child(5){grid-column:2;grid-row:4;justify-self:end;text-align:right!important;white-space:nowrap}

  /* Balances: one clear vertical record instead of scattered columns. */
  .page-balances .row:not(.header){display:grid!important;grid-template-columns:1fr!important;gap:5px!important;padding:14px 15px!important;align-items:start!important}
  .page-balances .row:not(.header)>*{grid-column:1!important;margin:0!important;min-width:0!important;flex:none!important;text-align:left!important;line-height:1.35!important}
  .page-balances .row:not(.header)>:first-child{margin-bottom:3px!important}
  .page-balances .row:not(.header)>:not(:first-child){color:var(--muted)}
  .page-balances .row:not(.header)>:last-child{justify-self:start!important;margin-left:0!important;font-weight:700;color:inherit}

  /* Teacher attendance: strict vertical layout so controls never collide. */
  .teacher-content .student-check{
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    gap:8px 10px!important;
    align-items:start!important;
    padding:12px!important;
  }
  .teacher-content .student-check>input,.teacher-content .student-check>span:first-child{
    grid-column:1!important;grid-row:1!important;align-self:start!important;margin:4px 0 0!important;
  }
  .teacher-content .student-check>div{
    grid-column:2!important;grid-row:1!important;display:flex!important;flex-direction:column!important;
    align-items:flex-start!important;gap:5px!important;min-width:0!important;width:100%!important;
  }
  .teacher-content .student-check>div>b{display:block!important;width:100%!important;line-height:1.25!important}
  .teacher-content .student-check>div>.badge{display:inline-flex!important;width:auto!important;white-space:nowrap!important;margin:2px 0!important}
  .teacher-content .student-check>div>label{display:flex!important;align-items:center!important;gap:7px!important;margin:2px 0!important;line-height:1.3!important}
  .teacher-content .student-check .photo{
    grid-column:2!important;grid-row:2!important;justify-self:start!important;width:auto!important;max-width:160px!important;
    margin:2px 0 0!important;position:static!important;transform:none!important;
  }
  .teacher-content .attendance{display:grid!important;gap:9px!important}

  /* Statistics filters: dates and selectors in a single stable column. */
  .page-stats .toolbar:has(#stats-from){display:grid!important;grid-template-columns:1fr!important;gap:10px!important;align-items:stretch!important}
  .page-stats .toolbar:has(#stats-from)>.field{width:100%!important;min-width:0!important;max-width:none!important}
  .page-stats .toolbar:has(#stats-from) .input,.page-stats .toolbar:has(#stats-from) .select{width:100%!important;min-width:0!important;max-width:none!important}
  .page-stats .toolbar:has(#stats-from)>.btn{justify-self:start!important;width:auto!important}

  /* Statistics group efficiency: give every number an explicit label. */
  .page-stats .child-ledger-card .row:not(.header){
    display:grid!important;grid-template-columns:1fr 1fr!important;gap:12px 18px!important;padding:14px 15px!important;align-items:start!important;
  }
  .page-stats .child-ledger-card .row:not(.header)>*{margin:0!important;min-width:0!important;flex:none!important;text-align:left!important;color:inherit!important}
  .page-stats .child-ledger-card .row:not(.header)>:first-child{grid-column:1/-1!important;margin-bottom:2px!important}
  .page-stats .child-ledger-card .row:not(.header)>:nth-child(n+2){display:flex!important;flex-direction:column!important;gap:2px!important;font-size:16px!important;font-weight:700!important}
  .page-stats .child-ledger-card .row:not(.header)>:nth-child(n+2)::before{font-size:11px!important;font-weight:600!important;color:var(--muted)!important;line-height:1.2}
  .page-stats .child-ledger-card .row:not(.header)>:nth-child(2)::before{content:'Детей'}
  .page-stats .child-ledger-card .row:not(.header)>:nth-child(3)::before{content:'Заполненность'}
  .page-stats .child-ledger-card .row:not(.header)>:nth-child(4)::before{content:'Посещаемость'}
  .page-stats .child-ledger-card .row:not(.header)>:nth-child(5)::before{content:'Пропуски'}

  /* Statistics metric tabs stay readable and scroll horizontally only inside themselves. */
  .page-stats .tabs{display:flex!important;gap:4px!important;overflow-x:auto!important;padding-bottom:2px!important}
  .page-stats .tabs button{white-space:nowrap!important;flex:0 0 auto!important}
}

@media(max-width:390px){
  .page-stats .child-ledger-card .row:not(.header){grid-template-columns:1fr 1fr!important;gap:10px 12px!important}
  .teacher-content .student-check{grid-template-columns:38px minmax(0,1fr)!important}
}

/* ===== Итоговый каскад из mobile-fixes4.css ===== */
/* Mobile cleanup v1.1.22 */
@media(max-width:760px){
  /* iOS native date/time controls: never exceed container width. */
  .modal input[type="date"],
  .modal input[type="time"],
  .page-salary input[type="date"],
  .page-partner input[type="date"],
  .page-stats input[type="date"]{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    -webkit-appearance:none!important;
    appearance:none!important;
  }
  .modal .form-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;min-width:0!important}
  .modal .field,.modal .span-2{grid-column:1!important;width:100%!important;min-width:0!important;max-width:100%!important}

  /* Group lesson time: keep both fields and arrow fully inside the modal. */
  .modal #gf-start,.modal #gf-end{width:100%!important;min-width:0!important;max-width:100%!important;padding-left:6px!important;padding-right:6px!important}
  .modal #gf-start{grid-column:1!important}
  .modal #gf-start + span{grid-column:2!important;width:18px!important;min-width:18px!important;justify-self:center!important;font-size:17px!important}
  .modal #gf-end{grid-column:3!important}
  .modal .field:has(#gf-start)>div{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr)!important;
    gap:4px!important;
    width:100%!important;
    min-width:0!important;
    overflow:hidden!important;
  }

  /* Add-child candidate badge must hug the whole text. */
  .modal .student-check .badge.gray,
  .modal .student-check .badge{
    display:inline-flex!important;
    width:max-content!important;
    min-width:max-content!important;
    max-width:none!important;
    white-space:nowrap!important;
    padding-left:10px!important;
    padding-right:10px!important;
  }

  /* Teacher attendance: left = attendance + name/trial, right = photo + more. */
  .teacher-content .student-check{
    display:grid!important;
    grid-template-columns:38px minmax(0,1fr) auto!important;
    grid-template-rows:auto!important;
    column-gap:10px!important;
    row-gap:6px!important;
    align-items:start!important;
    padding:12px!important;
  }
  .teacher-content .student-check>input,
  .teacher-content .student-check>span:first-child{
    grid-column:1!important;
    grid-row:1!important;
    margin:4px 0 0!important;
    align-self:start!important;
  }
  .teacher-content .student-check>div:nth-of-type(1){
    grid-column:2!important;
    grid-row:1!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    gap:5px!important;
    min-width:0!important;
    width:100%!important;
  }
  .teacher-content .student-check>div:nth-of-type(1)>b{display:block!important;width:100%!important;line-height:1.25!important;word-break:normal!important;overflow-wrap:normal!important;white-space:normal!important}
  .teacher-content .student-check>div:nth-of-type(1)>.badge{margin:2px 0!important;white-space:nowrap!important}
  .teacher-content .student-check>div:nth-of-type(1)>label{display:flex!important;align-items:center!important;gap:6px!important;margin:0!important;white-space:normal!important}
  .teacher-content .student-check>div:nth-of-type(2){
    grid-column:3!important;
    grid-row:1!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:6px!important;
    width:auto!important;
    min-width:0!important;
  }
  .teacher-content .student-check>div:nth-of-type(2) .photo,
  .teacher-content .student-check>div:nth-of-type(2) .trial-more{
    position:static!important;
    transform:none!important;
    margin:0!important;
    width:auto!important;
    min-width:0!important;
    max-width:118px!important;
    white-space:nowrap!important;
  }
  .teacher-content .student-check>div:nth-of-type(2) .trial-more{align-self:flex-end!important;width:44px!important;height:40px!important;padding:0!important}

  /* Salary: stack each accrual vertically and keep totals obvious. */
  .page-salary .toolbar{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
  .page-salary .toolbar>select{grid-column:1/-1!important;width:100%!important}
  .page-salary .toolbar>input[type="date"]{width:100%!important;min-width:0!important}
  .page-salary .toolbar>.btn{grid-column:1/-1!important;width:100%!important}
  .page-salary .row:not(.header){display:grid!important;grid-template-columns:1fr!important;gap:5px!important;padding:14px 15px!important;align-items:start!important}
  .page-salary .row:not(.header)>*{grid-column:1!important;text-align:left!important;margin:0!important;min-width:0!important}
  .page-salary .row:not(.header)>*:last-child{font-weight:800!important;font-size:18px!important;color:#101828!important}
  .page-salary .section-title{display:grid!important;grid-template-columns:1fr auto!important;gap:10px!important;align-items:start!important}

  /* Partner filters: partner on first row, both dates together, action below. */
  .page-partner .toolbar,.page-settlements .toolbar{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px!important;align-items:stretch!important}
  .page-partner #partner-project{grid-column:1/-1!important;width:100%!important;max-width:none!important}
  .page-partner #partner-from,.page-settlements #partner-from{grid-column:1!important;width:100%!important;max-width:none!important;min-width:0!important}
  .page-partner #partner-to,.page-settlements #partner-to{grid-column:2!important;width:100%!important;max-width:none!important;min-width:0!important}
  .page-partner .toolbar>.btn,.page-settlements .toolbar>.btn{grid-column:1/-1!important;width:100%!important}
  .page-partner .partner-line,.page-settlements .partner-line{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important}
  .page-partner .partner-line span,.page-settlements .partner-line span{min-width:0!important;overflow-wrap:anywhere!important}
  .page-partner .partner-line b,.page-settlements .partner-line b{white-space:nowrap!important}

  /* Statistics: keep date fields full-width and metrics readable. */
  .page-stats #stats-from,.page-stats #stats-to{width:100%!important;min-width:0!important;max-width:100%!important}

  /* General modal controls on iPhone. */
  .modal input,.modal select,.modal textarea{font-size:16px!important}
}

@media(max-width:390px){
  .teacher-content .student-check{grid-template-columns:34px minmax(0,1fr) auto!important;column-gap:8px!important}
  .teacher-content .student-check>div:nth-of-type(2) .photo{font-size:13px!important;padding-left:9px!important;padding-right:9px!important}
  .page-partner .toolbar,.page-settlements .toolbar,.page-salary .toolbar{gap:7px!important}
}

/* ===== Итоговый каскад из mobile-fixes5.css ===== */
/* Targeted mobile cleanup v1.1.23 */
@media(max-width:760px){
  /* iOS Safari collapses empty native date controls unless height/padding are explicit. */
  input[type="date"].input,
  .modal input[type="date"],
  .toolbar input[type="date"]{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    height:56px!important;
    min-height:56px!important;
    padding:0 14px!important;
    line-height:56px!important;
    font-size:16px!important;
    border-radius:12px!important;
  }
  input[type="date"]::-webkit-date-and-time-value{
    text-align:left!important;
    min-height:56px!important;
    line-height:56px!important;
  }

  /* Modal should be immediately interactive and scroll only inside itself. */
  .modal-backdrop{
    touch-action:none!important;
    overscroll-behavior:contain!important;
  }
  .modal{
    touch-action:pan-y!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
  }
  .modal button,.modal input,.modal select,.modal textarea,.modal .btn{
    touch-action:manipulation!important;
  }

  /* Salary filters: teacher on top, dates side by side, apply full width. */
  .page-salary>.toolbar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:8px!important;
  }
  .page-salary>.toolbar>#salary-teacher{
    grid-column:1/-1!important;
    width:100%!important;
    max-width:none!important;
  }
  .page-salary>.toolbar>#salary-from,
  .page-salary>.toolbar>#salary-to{
    grid-column:auto!important;
    width:100%!important;
    max-width:none!important;
  }
  .page-salary>.toolbar>.btn{
    grid-column:1/-1!important;
    width:100%!important;
  }

  /* Salary ledger: explain every number instead of leaving anonymous values. */
  .page-salary .salary-row:not(.header){
    display:block!important;
    padding:14px 15px!important;
  }
  .page-salary .salary-row:not(.header)>div:first-child{
    margin-bottom:10px!important;
  }
  .page-salary .salary-row:not(.header)>div:nth-child(n+2){
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:16px!important;
    width:100%!important;
    padding:5px 0!important;
    margin:0!important;
    text-align:right!important;
  }
  .page-salary .salary-row:not(.header)>div:nth-child(n+2)::before{
    color:var(--muted)!important;
    font-weight:500!important;
    text-align:left!important;
    flex:1 1 auto!important;
  }
  .page-salary .salary-row:not(.header)>div:nth-child(2)::before{content:'Детей'}
  .page-salary .salary-row:not(.header)>div:nth-child(3)::before{content:'Фикс'}
  .page-salary .salary-row:not(.header)>div:nth-child(4)::before{content:'За детей'}
  .page-salary .salary-row:not(.header)>div:nth-child(5)::before{content:'Итого'}
  .page-salary .salary-row:not(.header)>div:nth-child(5){
    margin-top:5px!important;
    padding-top:9px!important;
    border-top:1px solid var(--line)!important;
    font-size:18px!important;
  }

  .page-salary .card.pad[style*="justify-content:space-between"]{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    gap:12px!important;
  }
  .page-salary .card.pad[style*="justify-content:space-between"]>b{
    white-space:nowrap!important;
    font-size:24px!important;
    line-height:1.15!important;
  }
}

@media(max-width:390px){
  input[type="date"].input,
  .modal input[type="date"],
  .toolbar input[type="date"]{
    height:54px!important;
    min-height:54px!important;
    line-height:54px!important;
  }
}



/* Context help */
.context-help-title-row{display:flex;align-items:center;gap:9px;min-width:0;flex-wrap:wrap}
.context-help-title-row h1{margin-bottom:0}
.context-help-button{width:30px;height:30px;min-width:30px;padding:0;border:1px solid #cfd7e6;border-radius:50%;background:#fff;color:#344054;font-weight:800;font-size:15px;line-height:1;display:inline-grid;place-items:center;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.context-help-button:hover{background:#f8fafc;border-color:#98a2b3}
.context-help-button:focus-visible,.context-help-close:focus-visible{outline:3px solid #dbeafe;outline-offset:2px}
.context-help-backdrop{position:fixed;inset:0;z-index:100;background:rgba(17,24,39,.5);display:grid;place-items:center;padding:18px}
.context-help-modal{width:min(720px,calc(100vw - 36px));max-height:80vh;background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.24);display:flex;flex-direction:column;overflow:hidden}
.context-help-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 20px 14px;border-bottom:1px solid var(--line)}
.context-help-dialog-head h2{margin:0;font-size:21px;line-height:1.25}
.context-help-close{width:34px;height:34px;min-width:34px;border:1px solid var(--line);border-radius:10px;background:#fff;color:#475467;font-size:24px;line-height:1;display:grid;place-items:center;padding:0}
.context-help-scroll{overflow-y:auto;overflow-x:hidden;padding:18px 20px;-webkit-overflow-scrolling:touch}
.context-help-section+.context-help-section{margin-top:18px;padding-top:17px;border-top:1px solid var(--line)}
.context-help-section h3{margin:0 0 8px;font-size:15px}
.context-help-section ul{margin:0;padding-left:20px;display:grid;gap:7px}
.context-help-section li{padding-left:2px;overflow-wrap:anywhere}
.context-help-temporary{margin-bottom:16px}
.context-help-actions{display:flex;justify-content:flex-end;padding:14px 20px 18px;border-top:1px solid var(--line);background:#fff}
body.context-help-open{overflow:hidden}

@media(max-width:760px){
  .context-help-title-row{gap:7px}
  .context-help-button{width:30px;height:30px;min-width:30px}
  .context-help-backdrop{padding:12px}
  .context-help-modal{width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:85dvh;border-radius:14px}
  .context-help-dialog-head{padding:16px 16px 12px;position:sticky;top:0;background:#fff;z-index:1}
  .context-help-dialog-head h2{font-size:19px}
  .context-help-scroll{padding:15px 16px}
  .context-help-actions{padding:12px 16px 14px}
  .context-help-actions .btn{width:100%}
}


/* Director site rent report */
.rent-toolbar{align-items:end}
.rent-toolbar>.field{min-width:180px}
.rent-toolbar>#rent-site,.rent-toolbar>.field:first-child{min-width:240px}
.rent-period{margin:0 0 14px}
.rent-summary-grid{margin-top:14px}
.rent-summary-card{display:flex;justify-content:space-between;align-items:center;gap:16px}
.rent-summary-card h3{margin:0 0 5px;font-size:17px}
.rent-summary-amount{font-size:21px;white-space:nowrap}
.rent-total-card{margin-top:14px;display:flex;justify-content:space-between;align-items:center;gap:16px}
.rent-total-amount{font-size:28px;white-space:nowrap}
.rent-details{display:grid;gap:14px;margin-top:14px}
.rent-detail-group .section-title{margin-bottom:5px}
.rent-detail-list{display:grid}
.rent-detail-row{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:12px 0;border-top:1px solid var(--line)}
.rent-detail-row:first-child{border-top:0}
.rent-detail-side{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap;text-align:right;white-space:nowrap}

@media(max-width:760px){
  .page-rent .rent-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;align-items:stretch!important}
  .page-rent .rent-toolbar>.field,.page-rent .rent-toolbar>.btn{width:100%!important;min-width:0!important;max-width:none!important}
  .page-rent .rent-summary-grid{grid-template-columns:1fr!important}
  .rent-summary-card,.rent-total-card{align-items:flex-start}
  .rent-summary-amount{font-size:19px}
  .rent-total-amount{font-size:24px}
  .rent-detail-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px}
  .rent-detail-side{align-items:flex-end;flex-direction:column;white-space:normal}
}
@media(max-width:390px){
  .rent-summary-card,.rent-total-card{display:grid;grid-template-columns:1fr}
  .rent-summary-amount,.rent-total-amount{white-space:normal}
  .rent-detail-row{grid-template-columns:1fr}
  .rent-detail-side{align-items:flex-start;text-align:left}
}


/* ===== Lesson photos: mobile attendance layout v1.1.24 ===== */
/* Keep attendance identity on the first row and photo actions below it on phones. */
@media(max-width:760px){
  .teacher-content .student-check{
    display:grid!important;
    grid-template-columns:38px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    column-gap:10px!important;
    row-gap:8px!important;
    align-items:start!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  .teacher-content .student-check>input,
  .teacher-content .student-check>span:first-child{
    grid-column:1!important;
    grid-row:1!important;
    align-self:start!important;
    margin:4px 0 0!important;
  }
  .teacher-content .student-check>div:nth-of-type(1){
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
    width:100%!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    gap:5px!important;
  }
  .teacher-content .student-check>div:nth-of-type(1)>b{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    white-space:normal!important;
    line-height:1.3!important;
  }
  .teacher-content .student-check>div:nth-of-type(1) .muted.mini{
    word-break:normal!important;
    overflow-wrap:normal!important;
    white-space:normal!important;
  }
  .teacher-content .student-check>div:nth-of-type(2){
    grid-column:2!important;
    grid-row:2!important;
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:wrap!important;
    align-items:flex-start!important;
    justify-content:flex-start!important;
    gap:7px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .teacher-content .student-check .lesson-photo-control{
    display:flex!important;
    flex:1 1 100%!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:7px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
  }
  .teacher-content .student-check .lesson-photo-thumbs{
    display:flex!important;
    flex:0 1 auto!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:6px!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .teacher-content .student-check .lesson-photo-thumb{
    flex:0 0 52px!important;
    width:52px!important;
    height:52px!important;
    max-width:52px!important;
  }
  .teacher-content .student-check .lesson-photo-control>.photo{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:38px!important;
    margin:0!important;
    padding:7px 10px!important;
    white-space:nowrap!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    line-height:1.2!important;
  }
  .teacher-content .student-check>div:nth-of-type(2)>.btn{
    flex:0 0 auto!important;
    width:auto!important;
    max-width:100%!important;
    margin:0!important;
    white-space:nowrap!important;
  }
}

@media(max-width:390px){
  .teacher-content .student-check{
    grid-template-columns:34px minmax(0,1fr)!important;
    column-gap:8px!important;
  }
  .teacher-content .student-check .lesson-photo-thumb{
    flex-basis:50px!important;
    width:50px!important;
    height:50px!important;
    max-width:50px!important;
  }
}


/* ===== Fixed lesson student grid v1.1.26 ===== */
/* Explicit six-slot grid with stable class-based placement. */
.student-check.lesson-student-card,
.teacher-content .student-check.lesson-student-card{
  display:grid!important;
  grid-template-columns:32px minmax(0,1fr) 52px!important;
  grid-template-rows:52px 34px!important;
  column-gap:10px!important;
  row-gap:4px!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  padding:8px 10px!important;
  overflow:visible!important;
}
.student-check.lesson-student-card>.lesson-student-attendance-slot,
.teacher-content .student-check.lesson-student-card>.lesson-student-attendance-slot{
  grid-column:1!important;
  grid-row:1!important;
  align-self:center!important;
  justify-self:center!important;
  display:grid!important;
  place-items:center!important;
  width:32px!important;
  height:52px!important;
  min-width:0!important;
}
.student-check.lesson-student-card>.lesson-student-attendance-slot>.lesson-student-attendance{
  width:19px!important;
  height:19px!important;
  margin:0!important;
}
.student-check.lesson-student-card>.lesson-student-name-cell,
.teacher-content .student-check.lesson-student-card>.lesson-student-name-cell{
  grid-column:2!important;
  grid-row:1!important;
  align-self:center!important;
  justify-self:stretch!important;
  min-width:0!important;
  max-width:100%!important;
  text-align:left!important;
}
.student-check.lesson-student-card .lesson-student-name{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  text-align:left!important;
  line-height:1.25!important;
}
.student-check.lesson-student-card .lesson-student-subtitle{
  display:block!important;
  max-width:100%!important;
  margin-top:2px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  line-height:1.1!important;
  text-align:left!important;
}
.student-check.lesson-student-card>.lesson-photo-summary-slot,
.teacher-content .student-check.lesson-student-card>.lesson-photo-summary-slot{
  grid-column:3!important;
  grid-row:1!important;
  align-self:center!important;
  justify-self:end!important;
  display:grid!important;
  place-items:center!important;
  width:52px!important;
  height:52px!important;
  min-width:0!important;
}
.student-check.lesson-student-card>.lesson-student-more-slot,
.teacher-content .student-check.lesson-student-card>.lesson-student-more-slot{
  grid-column:1!important;
  grid-row:2!important;
  align-self:center!important;
  justify-self:center!important;
  display:grid!important;
  place-items:center!important;
  width:32px!important;
  height:34px!important;
  min-width:0!important;
}
.student-check.lesson-student-card .student-more,
.student-check.lesson-student-card .student-extra-remove,
.teacher-content .student-check.lesson-student-card .student-more,
.teacher-content .student-check.lesson-student-card .student-extra-remove{
  position:static!important;
  transform:none!important;
  display:inline-grid!important;
  place-items:center!important;
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  max-width:30px!important;
  max-height:30px!important;
  padding:0!important;
  margin:0!important;
  border-radius:9px!important;
  line-height:1!important;
  align-self:center!important;
  justify-self:center!important;
  flex:none!important;
}
.student-check.lesson-student-card .student-more{font-size:18px!important}
.student-check.lesson-student-card .student-extra-remove{font-size:18px!important;color:var(--red)!important}
.student-check.lesson-student-card>.lesson-student-trial-slot,
.teacher-content .student-check.lesson-student-card>.lesson-student-trial-slot{
  grid-column:2!important;
  grid-row:2!important;
  align-self:center!important;
  justify-self:start!important;
  min-width:0!important;
  max-width:100%!important;
  height:34px!important;
  display:flex!important;
  align-items:center!important;
  transform:translateX(-10px)!important;
}
.student-check.lesson-student-card .lesson-student-trial{
  display:inline-flex!important;
  align-items:center!important;
  gap:5px!important;
  width:max-content!important;
  max-width:100%!important;
  min-height:28px!important;
  margin:0!important;
  padding:3px 8px!important;
  border:1px solid transparent!important;
  border-radius:999px!important;
  color:#475467!important;
  line-height:1.15!important;
  white-space:nowrap!important;
}
.student-check.lesson-student-card .lesson-student-trial input{
  flex:0 0 auto!important;
  width:17px!important;
  height:17px!important;
  margin:0!important;
}
.student-check.lesson-student-card .lesson-student-trial.is-active{
  background:var(--amberbg)!important;
  border-color:#fedf89!important;
  color:var(--amber)!important;
  font-weight:700!important;
}
.student-check.lesson-student-card>.lesson-photo-add-slot,
.teacher-content .student-check.lesson-student-card>.lesson-photo-add-slot{
  grid-column:3!important;
  grid-row:2!important;
  align-self:center!important;
  justify-self:end!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  width:52px!important;
  height:34px!important;
  min-width:0!important;
}
.student-check.lesson-student-card .lesson-photo-add,
.teacher-content .student-check.lesson-student-card .lesson-photo-add{
  position:static!important;
  transform:none!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:none!important;
  width:40px!important;
  min-width:40px!important;
  max-width:40px!important;
  height:32px!important;
  min-height:32px!important;
  max-height:32px!important;
  margin:0!important;
  padding:0!important;
  border-radius:8px!important;
  white-space:nowrap!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  line-height:1!important;
  font-size:14px!important;
}
.lesson-photo-summary{
  position:relative;
  width:48px;
  height:48px;
  padding:0;
  border:0;
  background:transparent;
  overflow:visible;
  cursor:pointer;
  isolation:isolate;
}
.lesson-photo-summary-media{
  position:relative;
  z-index:3;
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  overflow:hidden;
  border:1px solid #d0d5dd;
  border-radius:10px;
  background:#f8fafc;
  box-shadow:0 1px 3px rgba(16,24,40,.14);
}
.lesson-photo-summary-media img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.lesson-photo-summary.is-stack::before,
.lesson-photo-summary.is-stack::after{
  content:'';
  position:absolute;
  inset:2px;
  border:1px solid #c7ced8;
  border-radius:9px;
  background:#fff;
  box-shadow:0 1px 3px rgba(16,24,40,.12);
}
.lesson-photo-summary.is-stack::before{
  z-index:1;
  transform:translate(-4px,3px) rotate(-5deg);
}
.lesson-photo-summary.is-stack::after{
  z-index:2;
  transform:translate(4px,3px) rotate(5deg);
}
.lesson-photo-count{
  position:absolute;
  right:-4px;
  bottom:-4px;
  z-index:6;
  display:grid;
  place-items:center;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:999px;
  background:#344054;
  color:#fff;
  border:2px solid #fff;
  font-size:11px;
  line-height:1;
  font-weight:800;
}
.lesson-photo-state-mark{
  position:absolute;
  left:-4px;
  top:-4px;
  z-index:7;
  display:grid;
  place-items:center;
  width:19px;
  height:19px;
  border-radius:999px;
  border:2px solid #fff;
  background:#d97706;
  color:#fff;
  font-size:11px;
  font-weight:800;
  line-height:1;
}
.lesson-photo-summary.is-uploaded .lesson-photo-state-mark,
.lesson-photo-gallery-item.is-uploaded .lesson-photo-state-mark{
  background:var(--green);
}
.lesson-photo-summary.is-error .lesson-photo-state-mark,
.lesson-photo-gallery-item.is-error .lesson-photo-state-mark{
  background:var(--red);
}
.lesson-photo-summary.is-expired .lesson-photo-state-mark,
.lesson-photo-gallery-item.is-expired .lesson-photo-state-mark{
  background:#667085;
}
.lesson-photo-gallery-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(92px,1fr));
  gap:10px;
  margin-top:4px;
}
.lesson-photo-gallery-item{
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:1;
  padding:0;
  border:1px solid var(--line);
  border-radius:11px;
  overflow:hidden;
  background:#f8fafc;
}
.lesson-photo-gallery-media{
  display:grid;
  place-items:center;
  width:100%;
  height:100%;
  overflow:hidden;
}
.lesson-photo-gallery-media img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.lesson-photo-gallery-item .lesson-photo-state-mark{
  left:5px;
  top:5px;
}
.lesson-sync-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 12px;
  padding:9px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#f8fafc;
  color:#475467;
  font-size:13px;
  font-weight:700;
}
.lesson-sync-status.is-saved{border-color:#abefc6;background:#ecfdf3;color:#067647}
.lesson-sync-status.is-pending{border-color:#fedf89;background:#fffaeb;color:#b54708}
.lesson-sync-status.is-error{border-color:#fecdca;background:#fef3f2;color:#b42318}

@media(max-width:760px){
  .student-check.lesson-student-card,
  .teacher-content .student-check.lesson-student-card{
    grid-template-columns:30px minmax(0,1fr) 48px!important;
    grid-template-rows:48px 32px!important;
    column-gap:8px!important;
    row-gap:4px!important;
    padding:8px!important;
  }
  .student-check.lesson-student-card>.lesson-student-attendance-slot{
    width:30px!important;
    height:48px!important;
  }
  .student-check.lesson-student-card>.lesson-photo-summary-slot{
    width:48px!important;
    height:48px!important;
  }
  .student-check.lesson-student-card>.lesson-student-more-slot{
    width:30px!important;
    height:32px!important;
  }
  .student-check.lesson-student-card>.lesson-student-trial-slot{height:32px!important}
  .student-check.lesson-student-card>.lesson-photo-add-slot{
    width:48px!important;
    height:32px!important;
  }
  .lesson-photo-summary,
  .lesson-photo-summary-media{
    width:46px!important;
    height:46px!important;
  }
  .student-check.lesson-student-card .lesson-student-name{font-size:14px!important}
  .student-check.lesson-student-card .lesson-student-trial{
    min-height:28px!important;
    padding:2px 7px!important;
    font-size:12px!important;
  }
  .lesson-photo-gallery-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
  }
}
@media(max-width:390px){
  .student-check.lesson-student-card,
  .teacher-content .student-check.lesson-student-card{
    grid-template-columns:28px minmax(0,1fr) 46px!important;
    column-gap:7px!important;
    padding-left:7px!important;
    padding-right:7px!important;
  }
  .student-check.lesson-student-card>.lesson-student-attendance-slot{width:28px!important}
  .student-check.lesson-student-card>.lesson-student-more-slot{width:28px!important}
  .student-check.lesson-student-card>.lesson-photo-summary-slot{width:46px!important}
  .student-check.lesson-student-card>.lesson-photo-add-slot{width:46px!important}
  .lesson-photo-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}


/* Compact Web Push control */
.notification-header-actions{display:inline-flex;align-items:center;gap:7px}.push-bell-button{position:relative;appearance:none;-webkit-appearance:none;width:42px;height:42px;min-width:42px;min-height:42px;max-width:42px;max-height:42px;padding:0;margin:0;border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--text);display:inline-grid;place-items:center;font:inherit;font-size:20px;line-height:1;cursor:pointer;flex:0 0 42px;box-sizing:border-box}
.push-bell-button:hover{background:#f9fafb}
.push-bell-button [data-push-bell-icon]{display:block;line-height:1}
.push-bell-button [data-notification-badge]{position:absolute;right:-5px;top:-6px;display:grid;place-items:center;min-width:19px;height:19px;padding:0 4px;border-radius:12px;background:#f04438;color:#fff;font:700 11px/1 system-ui;font-style:normal}.push-bell-button [data-notification-badge][hidden]{display:none}.push-settings-button{width:42px;height:42px;min-width:42px;min-height:42px;max-width:42px;max-height:42px;padding:0;border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--muted);font-size:22px;line-height:1;cursor:pointer}.push-settings-button:hover{background:#f9fafb;color:var(--text)}
.push-popover{position:fixed;z-index:120;box-sizing:border-box;max-width:calc(100vw - 24px);max-height:min(70vh,420px);overflow:auto;-webkit-overflow-scrolling:touch;padding:14px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--text);box-shadow:0 16px 40px rgba(16,24,40,.18);isolation:isolate}
.push-popover-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.push-popover-close{width:32px;height:32px;padding:0;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:24px;line-height:1;cursor:pointer}
.push-popover-close:hover{background:#f2f4f7}
.push-popover-status{margin-top:8px;color:var(--muted);font-size:14px;line-height:1.4}
.push-popover-actions{display:grid;gap:8px;margin-top:14px}
.push-popover-actions .btn{width:100%;min-height:42px;white-space:normal;text-align:center}
.notification-inbox-list{display:grid;gap:8px;margin-top:10px}.notification-inbox-item{display:grid;gap:4px;width:100%;padding:11px;border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--text);text-align:left;cursor:pointer}.notification-inbox-item.unread{border-left:4px solid var(--accent);background:#f8fbff}.notification-inbox-item span{color:#475467;line-height:1.35}.notification-inbox-item small{color:var(--muted)}
.payment-main-row>div:last-child,.child-ledger-card .row>div:last-child{min-width:0}.payment-receipt-action{white-space:nowrap}.payment-receipt-hint{margin:0 0 12px}.payment-receipt-linked{color:var(--green);text-align:right}.payment-receipt-payment-target{display:grid;gap:4px;margin-bottom:14px}.payment-receipt-payment-target span{color:var(--muted)}
@media(max-width:760px){
  .push-bell-button{appearance:none!important;-webkit-appearance:none!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;max-width:42px!important;max-height:42px!important;padding:0!important;margin:0!important;border:1px solid var(--line)!important;border-radius:12px!important;background:#fff!important;display:inline-grid!important;place-items:center!important;box-sizing:border-box!important}
  .push-popover{position:fixed!important;top:calc(env(safe-area-inset-top,0px) + 64px)!important;left:12px!important;right:12px!important;width:auto!important;max-width:none!important;max-height:calc(100dvh - 88px)!important;padding:14px!important;background:#fff!important;border:1px solid var(--line)!important;border-radius:14px!important;box-shadow:0 16px 40px rgba(16,24,40,.22)!important;overflow-y:auto!important;z-index:120!important}
  .push-popover-actions{display:grid;gap:9px}
  .push-popover-actions .btn{width:100%;min-height:44px}
  .push-settings-button{width:42px;height:42px}.payment-row-actions{flex-wrap:wrap;white-space:normal;gap:8px}.payment-receipt-action span{display:none}.payment-receipt-action{min-width:42px;padding-left:10px;padding-right:10px}
}


/* PWA onboarding */
.pwa-onboarding-backdrop{position:fixed;z-index:180;inset:0;display:grid;place-items:center;padding:12px;background:rgba(16,24,40,.56)}
.pwa-onboarding-dialog{box-sizing:border-box;width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;padding:20px;border:1px solid var(--line);border-radius:18px;background:#fff;color:var(--text);box-shadow:0 24px 70px rgba(16,24,40,.28)}
.pwa-onboarding-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.pwa-onboarding-head h2{margin:2px 0 0;font-size:24px;line-height:1.2}
.pwa-onboarding-kicker{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.pwa-onboarding-close{flex:0 0 38px;width:38px;height:38px;padding:0;border:0;border-radius:10px;background:#f2f4f7;color:var(--muted);font-size:26px;line-height:1;cursor:pointer}
.pwa-onboarding-intro{margin:14px 0 0;color:var(--muted);font-size:15px;line-height:1.5}
.pwa-onboarding-steps{display:grid;gap:10px;margin-top:18px}
.pwa-onboarding-step{display:grid;grid-template-columns:38px minmax(0,1fr);gap:12px;padding:12px;border:1px solid var(--line);border-radius:13px;background:#f9fafb}
.pwa-onboarding-step-number{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--accent2);color:#1d4ed8;font-weight:800}
.pwa-onboarding-step b{display:block;font-size:14px}
.pwa-onboarding-step p{margin:4px 0 0;color:#475467;font-size:14px;line-height:1.45}
.pwa-onboarding-push{display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px 12px;align-items:center;margin-top:16px;padding:13px;border:1px solid var(--line);border-radius:13px;background:#fff}
.pwa-onboarding-push.done{background:#f6fef9;border-color:#abefc6}
.pwa-onboarding-push-icon{font-size:24px;text-align:center}
.pwa-onboarding-push-copy{display:grid;gap:3px}
.pwa-onboarding-push-copy span{color:var(--muted);font-size:13px;line-height:1.4}
.pwa-onboarding-push>.btn{grid-column:1/-1;min-height:44px}
.pwa-onboarding-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.pwa-onboarding-actions .btn{min-height:44px}
.pwa-onboarding-toast{position:fixed;z-index:190;left:50%;bottom:max(18px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(420px,calc(100vw - 24px));box-sizing:border-box;padding:11px 14px;border-radius:12px;background:#172033;color:#fff;box-shadow:0 10px 30px rgba(16,24,40,.24);font-size:13px;line-height:1.4;text-align:center}
@media(max-width:640px){.pwa-onboarding-dialog{padding:16px;border-radius:16px}.pwa-onboarding-head h2{font-size:22px}.pwa-onboarding-actions{display:grid;grid-template-columns:1fr}.pwa-onboarding-actions .btn{width:100%}.pwa-onboarding-step{padding:11px}}
