:root {
  --ink: #1e1a17;
  --ink-2: #4a413a;
  --muted: #8c7e73;
  --line: #eee3da;
  --line-2: #f4ece5;
  --card: #ffffff;
  --cream: #fffcf8;
  --seg: #f3ebe4;
  --red: #c8372d;
  --red-d: #ad2c23;
  --red-soft: #fdeceb;
  --red-tint: #fdf3f1;
  --green: #2f8a57;
  --green-soft: #e9f6ee;
  --amber: #b97d10;
  --amber-soft: #fdf4e2;
  --violet: #8a4fd8;
  --violet-soft: #f1e9fd;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(80, 50, 30, .05), 0 6px 24px rgba(80, 50, 30, .06);
  --hour: 66px; /* высота часа: карточка вмещает время, имя и «1/8» с обводкой */
  /* поверхности (для тёмной темы переопределяются) */
  --surface: #ffffff;
  --soft: #fbf6f2;
  --hover: #f8f0ea;
  --track: #f0e6de;
  --today: #fdf7f4;
  --green-tint: #f6fbf8;
  --ink-3: #6f6259;
  --page-bg: linear-gradient(135deg, #faf3ee 0%, #f8eee8 45%, #f4e4dd 100%);
  --top-bg: rgba(255, 251, 248, .92);
  --backdrop: rgba(40, 25, 15, .38);
  --tone: #000;       /* к чему «темнеет» цвет ученика для текста */
  --ev-a: 13%;        /* насыщенность фона занятия */
  --ev-b: 38%;
  --ct-a: 85%;
  --cd-a: 62%;
  color-scheme: light;
}
[data-theme="dark"] {
  --ink: #f2eae4;
  --ink-2: #d5c9c0;
  --ink-3: #b3a69c;
  --muted: #988b82;
  --line: #3a312c;
  --line-2: #2e2723;
  --card: #1e1916;
  --cream: #26201c;
  --seg: #2d2622;
  --red: #e65a4e;
  --red-d: #cf463b;
  --red-soft: #3b2220;
  --red-tint: #2c1d1b;
  --green: #4fc283;
  --green-soft: #1b3326;
  --amber: #e5ab43;
  --amber-soft: #362a16;
  --violet: #ad85f3;
  --violet-soft: #2d2442;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .28);
  --surface: #241e1a;
  --soft: #221c19;
  --hover: #2e2723;
  --track: #3a312c;
  --today: #2a1f1c;
  --green-tint: #1a2620;
  --page-bg: linear-gradient(135deg, #171310 0%, #1a1512 45%, #1f1714 100%);
  --top-bg: rgba(26, 21, 18, .9);
  --backdrop: rgba(0, 0, 0, .55);
  --tone: #fff;
  --ev-a: 20%;
  --ev-b: 45%;
  --ct-a: 62%;
  --cd-a: 48%;
  color-scheme: dark;
}
[data-theme="dark"] .card { border-color: rgba(58, 49, 44, .7); }
[data-theme="dark"] .kpi.main { background: linear-gradient(135deg, #34201d, #2c1b19); border-color: #4a2b27; }
[data-theme="dark"] .pay-row.overdue { border-color: #4a2b27; }
[data-theme="dark"] .pay-row.paid { border-color: #24412f; }
[data-theme="dark"] .note { border-color: #4b3a1a; color: #e9c983; }
[data-theme="dark"] .tag.mv { background: #3a2d14; color: #e9bd62; border-color: #5a4520; }
[data-theme="dark"] .ev .sub { color: var(--muted); }
[data-theme="dark"] .ev.ghost { background: repeating-linear-gradient(45deg, #221d1a 0 6px, #2a2420 6px 12px); border-color: #4a403a; border-left-color: #4a403a; }
[data-theme="dark"] .ev.ghost .t, [data-theme="dark"] .ev.ghost .nm,
[data-theme="dark"] .ev.cancelled .t, [data-theme="dark"] .ev.cancelled .nm { color: #7d7069; }
[data-theme="dark"] .ev.cancelled { background: repeating-linear-gradient(45deg, #221d1a 0 6px, #282220 6px 12px); border-color: #3d3430; border-left-color: #574b44; }
[data-theme="dark"] .ev:hover, [data-theme="dark"] .pk:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
[data-theme="dark"] .wk-hd.wkend .d, [data-theme="dark"] .dp-wd span.we, [data-theme="dark"] .days button.we { color: #6f635b; }
[data-theme="dark"] .mo-cell.out .mo-n, [data-theme="dark"] .dp-d.out { color: #5c524c; }
[data-theme="dark"] .inp::placeholder { color: #6f645d; }
[data-theme="dark"] .inp:focus { background: var(--surface); border-color: #8a443d; }
[data-theme="dark"] .chip:hover, [data-theme="dark"] .picker:hover, [data-theme="dark"] .acc:hover:not(:disabled) { border-color: #514540; }
[data-theme="dark"] .check, [data-theme="dark"] .acc .tick { border-color: #5a4e47; }
[data-theme="dark"] .acc-btn { border-color: #5a4e47; }
[data-theme="dark"] .acc-btn.on, [data-theme="dark"] .ank-list span.first { border-color: #6b3530; }
[data-theme="dark"] .btn.danger { border-color: #5a2c28; }
[data-theme="dark"] .day-time { border-color: var(--line); }
[data-theme="dark"] .wh-it { color: #6f635b; }
[data-theme="dark"] .wh-band { border-color: #6b3530; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
[data-theme="dark"] .pk.stopped { border-left-color: #574b44; }
[data-theme="dark"] .sw.used::after { border-color: #6f635b; }
[data-theme="dark"] #toast { background: #f2eae4; color: #1e1916; }
[data-theme="dark"] .modal, [data-theme="dark"] .pop { border: 1px solid var(--line); }
[data-theme="dark"] .logo { box-shadow: 0 6px 14px rgba(0, 0, 0, .4); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); font-size: 16px; line-height: 1.4;
  background: var(--page-bg) fixed;
  min-height: 100vh;
}
/* телефоны/планшеты: «закреплённый» фон в iOS перерисовывается на каждое нажатие клавиши — ввод дёргается */
@media (hover: none), (pointer: coarse) { body { background-attachment: scroll; } }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--red); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 11px 18px; font-weight: 800; font-size: 15px; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(200, 55, 45, .28); }
.btn.red:hover { background: var(--red-d); }
.btn.full { width: 100%; }
.btn.big { padding: 15px 20px; font-size: 17px; border-radius: 16px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.danger { color: var(--red); border-color: #f3cdc9; }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 11px; }
.btn:disabled { opacity: .5; cursor: default; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-weight: 900; font-size: 18px; display: inline-grid; place-items: center; padding: 0; color: var(--ink); }
.round-btn:hover { background: var(--soft); }

/* ---------- inputs ---------- */
.field { display: block; margin-bottom: 16px; }
.field > .lbl, .lbl { display: block; font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.inp { width: 100%; border: 1.5px solid var(--line); background: var(--cream); border-radius: 14px; padding: 13px 15px; font-size: 16px; font-weight: 600; outline: none; transition: border-color .15s, box-shadow .15s; caret-color: var(--red); -webkit-user-select: text; user-select: text; }
.inp:focus { border-color: #e2a39c; box-shadow: 0 0 0 4px rgba(200, 55, 45, .08); background: var(--surface); }
.inp::placeholder { color: #b9aca2; font-weight: 600; }
textarea.inp { resize: vertical; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.err { color: var(--red); font-weight: 700; font-size: 14px; min-height: 20px; margin: 4px 0 8px; }

/* segmented & chips */
.seg { display: flex; gap: 4px; background: var(--seg); padding: 4px; border-radius: 16px; }
.seg button { flex: 1; border: none; background: transparent; border-radius: 12px; padding: 10px 12px; font-weight: 800; color: var(--ink-3); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.seg button.on { background: var(--surface); color: var(--red); box-shadow: 0 2px 8px rgba(80, 50, 30, .1); }
.seg.sm button { padding: 7px 12px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--cream); border-radius: 999px; padding: 8px 15px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: #e6d6ca; }
.chip.on { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 48px 16px 32px; }
.auth-brand { width: 100%; max-width: 440px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-weight: 900; font-size: 26px; }
.logo { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(160deg, #d8473c, #b52b22); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 500; box-shadow: 0 6px 14px rgba(200, 55, 45, .3); flex: none; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.roles { display: flex; gap: 4px; background: var(--seg); border-radius: 20px; padding: 5px; margin-bottom: 14px; }
.roles button { flex: 1; border: none; background: transparent; border-radius: 16px; padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; color: var(--ink-3); font-size: 16px; }
.roles button .ic { font-size: 24px; line-height: 1; }
.roles button.on { background: var(--surface); color: var(--red); box-shadow: 0 2px 10px rgba(80, 50, 30, .12); }
.auth-card .seg { margin-bottom: 18px; border-radius: 999px; }
.auth-card .seg button { border-radius: 999px; padding: 11px; }
.or { border-top: 1.5px dashed var(--line); margin: 20px 0 14px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.note { background: var(--amber-soft); border: 1px solid #f3e0b5; color: #7a5a14; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; background: var(--top-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px 24px; }
.logo img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.logo:has(img) { background: none; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 21px; flex: none; }
.brand .logo { width: 42px; height: 42px; font-size: 24px; border-radius: 13px; }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; min-width: 0; }
.nav a { position: relative; text-decoration: none; color: var(--ink-3); font-weight: 800; font-size: 16px; padding: 9px 14px; border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--hover); }
.nav a.on { color: var(--red); background: var(--red-soft); }
.nav a.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -13px; height: 3px; border-radius: 3px; background: var(--red); }
.nav .badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.top-right { display: flex; align-items: center; gap: 10px; flex: none; }
.gender { display: flex; background: var(--seg); border-radius: 999px; padding: 3px; }
.gender button { border: none; background: transparent; width: 36px; height: 32px; border-radius: 999px; font-size: 16px; color: var(--muted); font-weight: 800; }
.gender button.on { background: var(--surface); color: var(--red); box-shadow: 0 1px 6px rgba(80, 50, 30, .12); }

/* ---------- page ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 900; flex: 1; letter-spacing: -.01em; }
.page-head .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid rgba(238, 227, 218, .6); }
.soon { padding: 56px 24px; text-align: center; }
.soon .ic { font-size: 44px; }
.soon h2 { margin: 10px 0 6px; font-size: 22px; }
.soon p { margin: 0; color: var(--muted); }

/* ---------- income ---------- */
.income { padding: 20px; margin-bottom: 22px; }
.inc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.inc-head h2 { margin: 0; font-size: 19px; font-weight: 900; }
.inc-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.inc-top .inc-head { margin: 0; }
.inc-top .seg { flex: none; }
.inc-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-range .lbl { font-weight: 800; color: var(--muted); }
.inc-ptitle { margin: 0 0 14px; font-size: 19px; font-weight: 900; }
.inc-ptitle small { color: var(--muted); font-weight: 700; font-size: 14px; margin-left: 6px; }
.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.kpi { border-radius: var(--r-md); padding: 16px 18px; background: var(--soft); border: 1px solid var(--line); }
.kpi .l { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.kpi .v { font-size: 28px; font-weight: 900; margin-top: 4px; letter-spacing: -.01em; }
.kpi .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi.main { background: linear-gradient(135deg, #fff4f2, #fdecea); border-color: #f6cfca; }
.kpi.main .v { color: var(--red); font-size: 32px; }
.kpi.ok .v { color: var(--green); }
.kpi.wait .v { color: var(--amber); }
.bar { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.pay-rows { display: flex; flex-direction: column; gap: 8px; }
.pay-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.pay-row.overdue { background: var(--red-tint); border-color: #f5d3ce; }
.pay-row.paid { background: var(--green-tint); border-color: #d3ebdc; }
.pay-row .who { font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.pay-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pay-row .meta { color: var(--muted); font-size: 14px; }
.pay-row .pinfo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-row .sum { font-weight: 900; white-space: nowrap; }
.check { width: 26px; height: 26px; border-radius: 8px; border: 1.8px solid #dccfc4; background: var(--surface); display: grid; place-items: center; flex: none; padding: 0; color: #fff; font-weight: 900; font-size: 15px; }
.check.on { background: var(--green); border-color: var(--green); }
.pay-row .check { margin: 0 7px; } /* квадратик и «1/2» занимают одну и ту же колонку 40px — имена выровнены */
.cnt { width: 40px; height: 26px; border-radius: 8px; background: var(--seg); font-weight: 900; font-size: 13px; display: grid; place-items: center; padding: 0 6px; flex: none; border: none; }
.cnt.full { background: var(--green); color: #fff; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 800; white-space: nowrap; background: var(--seg); color: var(--ink-3); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.today { background: var(--seg); color: var(--ink-2); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.members-pay { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 4px 68px; }
.members-pay .chip { padding: 6px 12px; font-size: 14px; }
.members-pay .chip.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1.5px dashed var(--line); border-radius: 14px; }

/* ---------- calendar ---------- */
.cal-card { padding: 16px; }
.cal-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-top .seg { flex: none; }
.cal-top .sp { flex: 1; }
.cal-title { font-weight: 900; font-size: 17px; min-width: 190px; text-align: center; }
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; align-items: start; }
.cal-main { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }

.wk { overflow-x: auto; }
.wk-inner { min-width: 700px; }
.wk-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); background: var(--soft); border-bottom: 1px solid var(--line); }
.wk-hd { text-align: center; padding: 10px 2px 8px; }
.wk-hd .d { font-size: 13px; color: var(--muted); font-weight: 700; }
.wk-hd .n { font-size: 22px; font-weight: 900; margin-top: 2px; display: inline-grid; place-items: center; min-width: 38px; height: 38px; border-radius: 50%; }
.wk-hd.today .n { background: var(--red); color: #fff; }
.wk-hd.wkend .d { color: #b7a99e; }
.wk-scroll { max-height: 640px; overflow-y: auto; }
.wk-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); position: relative; }
.wk-times { position: sticky; left: 0; z-index: 6; background: var(--surface); }
.wk-head > div:first-child { position: sticky; left: 0; z-index: 6; background: var(--soft); }
.wk-head { position: sticky; top: 0; z-index: 7; }
.wk-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 13px; color: var(--muted); font-weight: 700; }
.wk-col { position: relative; border-left: 1px solid var(--line-2);
  background-image: linear-gradient(to bottom, var(--line-2) 1px, transparent 1px);
  background-size: 100% var(--hour); }
.wk-col.today { background-color: var(--today); }
.wk-col.click { cursor: copy; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 5; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

.ev { position: absolute; border-radius: 10px; padding: 4px 7px 4px 9px; overflow: hidden; cursor: pointer; font-size: 13px; line-height: 1.25; z-index: 2;
  background: var(--bg); border: 1.5px solid var(--bd); border-left: 4px solid var(--c); transition: box-shadow .15s, transform .1s; }
.ev:hover { box-shadow: 0 4px 14px rgba(60, 40, 20, .15); z-index: 4; }
.ev .t { font-weight: 900; color: var(--c-t); white-space: nowrap; }
.ev .nm { font-weight: 800; color: var(--c-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .sub { color: var(--muted); font-size: 12px; font-weight: 700; }
.ev.due { border: 2px solid var(--c); border-left-width: 4px; }
.ev.moved { border-style: dashed; border-left-style: solid; }
.ev .tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 1px 6px; margin-top: 2px; white-space: nowrap; }
.tag.mv { background: #fdf0d8; color: #9a6a0c; border: 1px solid #f2d79f; }
.tag.extra { background: var(--violet); color: #fff; }
.tag.paid { background: var(--green-soft); color: var(--green); }
.ev .star { position: absolute; top: 0; right: 0; width: 20px; height: 20px; background: var(--violet); color: #fff; font-size: 11px; display: grid; place-items: center; border-bottom-left-radius: 8px; }
.ev.extra { background-image: radial-gradient(rgba(138, 79, 216, .16) 1px, transparent 1.4px); background-size: 7px 7px; }
.ev.ghost { background: repeating-linear-gradient(45deg, #fbfaf9 0 6px, #f3f1ef 6px 12px); border: 1.5px dashed #cfc6be; border-left: 1.5px dashed #cfc6be; }
.ev.ghost .t, .ev.ghost .nm { color: #a69a90; text-decoration: line-through; display: inline; }
.ev.cancelled { background: repeating-linear-gradient(45deg, #fff 0 6px, #faf5f2 6px 12px); border-color: #e6dcd4; border-left-color: #cfc3b9; }
.ev.cancelled .t, .ev.cancelled .nm { color: #a69a90; text-decoration: line-through; }
.ev.burned { opacity: .75; filter: saturate(.55); }
.ev .st { font-size: 11px; font-weight: 800; color: var(--red); }

/* month */
.mo-head, .mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-head { background: var(--soft); border-bottom: 1px solid var(--line); }
.mo-head div { text-align: center; padding: 10px 2px; font-size: 13px; font-weight: 800; color: var(--muted); }
.mo-cell { min-height: 112px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mo-cell:nth-child(7n) { border-right: none; }
.mo-cell.out { background: var(--soft); }
.mo-cell.out .mo-n { color: #c8bcb2; }
.mo-n { font-weight: 900; font-size: 14px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
.mo-cell.today .mo-n { background: var(--red); color: #fff; }
.mo-ev { font-size: 12px; font-weight: 800; border-radius: 6px; padding: 2px 6px; background: var(--bg); color: var(--c-d); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.mo-ev.cancelled, .mo-ev.ghost { text-decoration: line-through; opacity: .6; }
.mo-more { font-size: 12px; font-weight: 800; color: var(--muted); padding-left: 4px; cursor: pointer; }

/* list */
.ls { padding: 6px 14px 14px; max-height: 720px; overflow-y: auto; }
.ls-day { font-weight: 900; margin: 14px 0 8px; text-transform: capitalize; }
.ls-day.today { color: var(--red); }
.ls-ev { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border-left: 4px solid var(--c); margin-bottom: 6px; cursor: pointer; flex-wrap: wrap; }
.ls-ev .t { font-weight: 900; color: var(--c-d); min-width: 96px; }
.ls-ev .nm { font-weight: 800; flex: 1; min-width: 120px; }
.ls-ev.cancelled .nm, .ls-ev.ghost .nm { text-decoration: line-through; color: var(--muted); }

/* sidebar */
.side { background: var(--soft); border: 1px solid var(--line); border-radius: 18px; padding: 14px; max-height: 760px; overflow-y: auto; }
.side h3 { margin: 0 0 12px; font-size: 16px; font-weight: 900; }
.pk { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: box-shadow .15s; }
.pk:hover { box-shadow: 0 4px 14px rgba(60, 40, 20, .1); }
.pk .nm { font-weight: 900; display: flex; align-items: center; gap: 8px; }
.pk .nm i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.pk .l { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pk .l b { color: var(--ink); }
.pk .l.bad { color: var(--red); font-weight: 700; }
.pk .l.ok { color: var(--green); font-weight: 700; }
.pk .bar { height: 5px; margin: 10px 0 6px; }
.pk .bar i { background: var(--c); }
.pk .row { display: flex; gap: 12px; color: var(--muted); font-size: 13px; margin-top: 4px; flex-wrap: wrap; }
.pk .row b { color: var(--ink); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: var(--backdrop); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 26px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 70px rgba(40, 20, 10, .3); animation: pop .18s ease-out; }
.modal.wide { max-width: 620px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 22px 24px 8px; }
.modal-head h3 { margin: 0; font-size: 22px; font-weight: 900; flex: 1; display: flex; align-items: center; gap: 10px; }
.modal-head .x { border: none; background: transparent; font-size: 26px; line-height: 1; padding: 4px 8px; color: var(--ink-2); border-radius: 10px; }
.modal-head .x:hover { background: var(--hover); }
.modal-body { padding: 10px 24px 24px; overflow-y: auto; }
.modal-foot { padding: 14px 24px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; flex-wrap: wrap; }
.modal-foot .sp { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.kind { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.kind button { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 16px; }
.kind button b { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; }
.kind button span { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.kind button.on { border-color: var(--red); background: var(--red-soft); }
.kind button.on b { color: var(--red); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.days button { aspect-ratio: 1; max-height: 58px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; font-weight: 900; font-size: 16px; }
.days button.we { color: #b0a297; }
.days button.on { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 14px rgba(200, 55, 45, .3); }
.day-times { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.day-time { display: flex; align-items: center; gap: 10px; background: var(--soft); border: 1px solid #f1e4da; border-radius: 16px; padding: 9px 10px 9px 16px; }
.day-time b { flex: 1; font-weight: 800; }
.day-time .in { color: var(--muted); font-size: 14px; }
.picker-w { display: inline-flex; }
.picker { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 15px; font-weight: 900; font-size: 16px; cursor: pointer; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.picker:hover { border-color: #e6d6ca; }
.picker:focus-visible, .picker:active { border-color: #e2a39c; box-shadow: 0 0 0 4px rgba(200, 55, 45, .08); }
.picker .ic { font-size: 17px; }

/* всплывающие окна выбора даты / времени */
.pop { position: fixed; z-index: 250; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 50px rgba(60, 30, 15, .22); padding: 14px; animation: pop .14s ease-out; }
.pop.dp { width: 312px; }
.pop.tp { width: 296px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-head b { font-size: 16px; font-weight: 900; }
.dp-head .round-btn { width: 34px; height: 34px; font-size: 16px; }
.dp-wd, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-wd span { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.dp-wd span.we { color: #c3b6ab; }
.dp-d { height: 38px; border: none; background: transparent; border-radius: 12px; font-weight: 800; font-size: 15px; color: var(--ink); }
.dp-d:hover { background: var(--hover); }
.dp-d.out { color: #cdc1b7; }
.dp-d.today { box-shadow: inset 0 0 0 1.5px var(--red); color: var(--red); }
.dp-d.on { background: var(--red); color: #fff; box-shadow: 0 4px 10px rgba(200, 55, 45, .3); }
.dp-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.dp-foot .chip { padding: 6px 11px; font-size: 13px; }
.pop.tp { width: 240px; }
.wh-head { display: grid; grid-template-columns: 1fr 24px 1fr; text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.wh-head span:last-child { grid-column: 3; }
.wh { position: relative; display: grid; grid-template-columns: 1fr 24px 1fr; height: 220px; background: var(--cream); border-radius: 16px; overflow: hidden; }
.wh-col { position: relative; z-index: 1; height: 220px; overflow-y: scroll; scroll-snap-type: y mandatory; padding: 88px 0; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent); mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent); }
.wh-col::-webkit-scrollbar { display: none; }
.wh-it { height: 44px; display: grid; place-items: center; scroll-snap-align: center; font-weight: 800; font-size: 20px; color: #a99a8f; cursor: pointer; user-select: none; transition: color .1s, font-size .1s; }
.wh-it.on { color: var(--ink); font-size: 26px; font-weight: 900; }
.wh-sep { z-index: 1; display: grid; place-items: center; font-weight: 900; font-size: 24px; color: var(--ink); }
.wh-band { position: absolute; left: 8px; right: 8px; top: 88px; height: 44px; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 10px rgba(80, 50, 30, .1); border: 1.5px solid #f1c6c1; z-index: 0; pointer-events: none; }
.colors { display: grid; grid-template-columns: repeat(auto-fill, 34px); gap: 8px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); padding: 0; position: relative; }
.sw.on { box-shadow: 0 0 0 2.5px var(--ink); }
.sw.used { opacity: .28; cursor: not-allowed; filter: saturate(.6); }
.sw.used::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.sw:disabled:hover { transform: none; }
.cb { display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; padding: 6px 0; }
.cb input { width: 22px; height: 22px; accent-color: var(--red); }
.member-row { display: grid; grid-template-columns: 1fr minmax(120px, auto) 44px; gap: 8px; margin-bottom: 8px; }
.member-row .inp { padding: 11px 12px; }
.member-row .del { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; font-size: 18px; }
.acc-btn { border: 1.5px dashed #dccfc4; background: var(--surface); border-radius: 12px; padding: 0 12px; font-weight: 800; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.acc-btn.on { border-style: solid; border-color: #f1c6c1; background: var(--red-soft); color: var(--red); }
.acc-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 260px; overflow-y: auto; }
.acc { display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px solid var(--line); background: var(--cream); border-radius: 14px; padding: 9px 12px; width: 100%; }
.acc:hover:not(:disabled) { border-color: #e6d6ca; background: var(--surface); }
.acc:disabled { opacity: .45; cursor: default; }
.acc .av { width: 34px; height: 34px; border-radius: 50%; background: var(--seg); display: grid; place-items: center; font-weight: 900; color: var(--ink-2); flex: none; }
.acc .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc .who b { font-weight: 800; }
.acc .who small { color: var(--muted); font-size: 13px; }
.acc .tick { width: 24px; height: 24px; border-radius: 50%; border: 1.8px solid #dccfc4; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #fff; flex: none; }
.acc.on { border-color: var(--red); background: var(--red-soft); }
.acc.on .tick { background: var(--red); border-color: var(--red); }
.pop.ap { width: 320px; }
.ank-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; background: var(--cream); border: 1.5px solid var(--line); border-radius: 14px; padding: 4px; flex: none; }
.stepper button { width: 38px; height: 38px; border: none; border-radius: 10px; background: var(--surface); font-size: 22px; font-weight: 900; color: var(--red); box-shadow: 0 1px 4px rgba(80, 50, 30, .08); }
.stepper span { min-width: 44px; text-align: center; font-weight: 900; font-size: 20px; }
.ank-prev { margin-top: 14px; background: var(--cream); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; }
.ank-sum { font-size: 15px; margin-bottom: 10px; }
.ank-sum b { font-size: 22px; font-weight: 900; color: var(--red); margin-right: 4px; }
.ank-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ank-list span { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px 9px; font-size: 13px; font-weight: 700; }
.ank-list span.first { border-color: #f1c6c1; color: var(--red); }
.ank-next { font-size: 15px; }
.ank-next b { font-weight: 900; }
.pop.cm { width: 250px; padding: 6px; }
.pop.cm .cm-head { display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; align-items: center; padding: 8px 10px 10px; border-bottom: 1.5px solid var(--line); margin-bottom: 4px; }
.pop.cm .cm-head i { width: 10px; height: 10px; border-radius: 50%; }
.pop.cm .cm-head b { font-weight: 900; }
.pop.cm .cm-head small { grid-column: 2; color: var(--muted); font-size: 13px; }
.pop.cm button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 9px 10px; border-radius: 10px; font-weight: 700; font-size: 15px; color: var(--ink); }
.pop.cm button:hover { background: var(--cream); }
.pop.cm button.danger { color: var(--red); }
.pop.cm button.danger:hover { background: var(--red-soft); }
.pk.stopped { opacity: .6; border-left-color: #cfc3b9; }
.info { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.info:last-of-type { border-bottom: none; }
.info b { min-width: 118px; color: var(--muted); font-weight: 700; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ini button { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 12px 14px; }
.ini button b { display: block; font-weight: 800; }
.ini button span { font-size: 13px; color: var(--muted); }
.ini button.on { border-color: var(--red); background: var(--red-soft); }
.ini button.on b { color: var(--red); }
.hist { margin: 6px 0 0; padding-left: 20px; }
.hist li { margin: 4px 0; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.mini-kpis .kpi { padding: 12px 14px; }
.mini-kpis .kpi .v { font-size: 20px; }
.outbox { list-style: none; padding: 0; margin: 0; }
.outbox li { padding: 10px 0; border-bottom: 1px solid var(--line-2); white-space: pre-wrap; font-size: 14px; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #2a211c; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 300; max-width: calc(100vw - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .cal-body { grid-template-columns: 1fr; }
  .side { max-height: none; }
  .side .pk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
  .side .pk { margin-bottom: 0; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .top-in { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px 0; }
  .brand { flex: 1; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; margin: 0 -14px; padding-left: 10px; padding-right: 10px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a.on::after { bottom: -9px; }
  .page { padding: 18px 12px 48px; }
  .page-head h1 { font-size: 26px; }
}
@media (max-width: 640px) {
  :root { --hour: 60px; }
  body { font-size: 15px; }
  .page-head .btns { width: 100%; }
  .page-head .btns .btn { flex: 1; padding: 11px 10px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .kpi.main { grid-column: 1 / -1; }
  .kpi .v { font-size: 22px; }
  .kpi.main .v { font-size: 28px; }
  .income, .cal-card { padding: 12px; border-radius: 18px; }
  .pay-row { flex-wrap: wrap; padding: 10px 12px; }
  .pay-row .pinfo { flex-basis: calc(100% - 60px); }
  .pay-row .right { margin-left: 52px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .members-pay { padding-left: 0; }
  .cal-top .seg { order: 2; width: 100%; }
  .cal-title { min-width: 0; flex: 1; font-size: 15px; }
  .wk-inner { min-width: 640px; }
  .wk-head, .wk-grid { grid-template-columns: 44px repeat(7, minmax(0, 1fr)); }
  .wk-hd .n { font-size: 18px; min-width: 32px; height: 32px; }
  .wk-scroll { max-height: 70vh; }
  .ev { font-size: 12px; padding: 3px 5px 3px 7px; }
  .mo-cell { min-height: 76px; padding: 4px 3px; }
  .mo-ev { font-size: 10px; padding: 1px 4px; }
  .modal-back { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 24px 24px 0 0; max-height: 94vh; }
  .modal-head { padding: 18px 18px 6px; }
  .modal-body { padding: 8px 18px 18px; }
  .modal-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .days { gap: 5px; }
  .days button { border-radius: 12px; font-size: 15px; }
  .member-row { grid-template-columns: 1fr 44px; }
  .member-row .acc-btn { grid-column: 1 / 2; grid-row: 2; height: 40px; max-width: none; }
  .top-in { gap: 8px; }
  .brand { font-size: 18px; gap: 9px; min-width: 0; }
  .brand .logo { width: 36px; height: 36px; font-size: 20px; border-radius: 11px; }
  .top-right { gap: 6px; }
  .top-right .round-btn { width: 36px; height: 36px; font-size: 16px; }
  .top-right .btn { padding: 7px 10px; font-size: 14px; }
  .gender button { width: 28px; height: 28px; font-size: 14px; }
  .nav a { font-size: 15px; padding: 8px 12px; }
  .top-in { flex-wrap: wrap; }
  .brand { flex: 1 1 0; overflow: hidden; }
  .brand-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-right { flex: none; }
  .auth { padding-top: 28px; }
}

/* ---------- анимации ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes popOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes evIn { from { opacity: 0; transform: scale(.96); } }
@keyframes spinIn { from { transform: rotate(-90deg) scale(.6); opacity: 0; } }

/* появление страницы и блоков */
.page > * { animation: fadeUp .38s cubic-bezier(.2, .8, .2, 1) backwards; }
.page > *:nth-child(2) { animation-delay: .05s; }
.page > *:nth-child(3) { animation-delay: .1s; }
.page > *:nth-child(4) { animation-delay: .15s; }
.auth-card { animation: popIn .4s cubic-bezier(.2, .8, .2, 1) backwards; }
.enter .kpi { animation: fadeUp .4s cubic-bezier(.2, .8, .2, 1) backwards; }
.enter .kpi:nth-child(2) { animation-delay: .04s; } .enter .kpi:nth-child(3) { animation-delay: .08s; } .enter .kpi:nth-child(4) { animation-delay: .12s; }
.enter .pk { animation: fadeUp .35s ease-out both; }
.enter .ev:not(.ghost), .enter .mo-ev, .enter .ls-ev { animation: evIn .25s ease-out both; }

/* окна: открытие и закрытие */
.modal { animation: popIn .22s cubic-bezier(.2, .8, .2, 1); }
.modal-back.closing { animation: fadeOut .17s ease-in forwards; }
.modal-back.closing .modal { animation: popOut .17s ease-in forwards; }
.pop { transform-origin: top center; animation: popIn .16s cubic-bezier(.2, .8, .2, 1); }
.members-pay, .acc-list, .ank-prev { animation: fadeUp .22s ease-out; }

/* наведение */
.btn { transition: background .15s, transform .15s, box-shadow .2s, border-color .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(80, 50, 30, .1); }
.btn.red:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(200, 55, 45, .35); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.round-btn { transition: background .15s, transform .2s, box-shadow .2s; }
.round-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(80, 50, 30, .12); }
.round-btn:active { transform: scale(.94); }
.theme-btn span { display: inline-block; animation: spinIn .35s cubic-bezier(.2, .8, .2, 1); }
.chip, .seg button, .days button, .kind button, .ini button, .acc, .picker, .dp-d, .check, .cnt, .sw { transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s; }
.chip:hover, .days button:hover, .sw:hover { transform: translateY(-1px); }
.chip:active, .days button:active, .check:active, .cnt:active, .dp-d:active { transform: scale(.94); }
.check:hover, .cnt:hover { box-shadow: 0 0 0 4px rgba(47, 138, 87, .12); }
.nav a { transition: color .15s, background .15s; }
.nav a.on::after { animation: navLine .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes navLine { from { transform: scaleX(0); } }
.ev { transition: box-shadow .18s, transform .18s; }
.ev:hover { transform: translateY(-1px); }
.pk { transition: box-shadow .18s, transform .18s; }
.pk:hover { transform: translateY(-2px); }
.pay-row { transition: background .2s, border-color .2s, transform .15s; }
.pay-row:hover { transform: translateX(2px); }
.mo-ev, .ls-ev { transition: transform .15s, filter .15s; }
.mo-ev:hover, .ls-ev:hover { transform: translateX(2px); filter: brightness(.97); }
.pop.cm button { transition: background .12s, padding-left .15s; }
.pop.cm button:hover { padding-left: 14px; }
.bar i { transition: width .6s cubic-bezier(.2, .8, .2, 1); }

/* плавная смена темы */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after { transition: background-color .35s, border-color .35s, color .35s, box-shadow .35s !important; }

@media (max-width: 640px) {
  .modal { animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1); }
  .modal-back.closing .modal { animation: sheetDown .17s ease-in forwards; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- день оплаты: жёлтая полосатая обводка (снаружи карточки — не закрывает текст) ---------- */
.ev.due { overflow: visible; }
.ls-ev.due, .mo-ev.due { position: relative; }
.ev.due::after, .ls-ev.due::after, .mo-ev.due::after {
  content: ""; position: absolute; inset: -2.5px; border-radius: 12.5px; pointer-events: none; z-index: 3;
  padding: 2px;
  background: repeating-linear-gradient(-45deg, #f2a900 0 5px, #3a2600 5px 8px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.ls-ev.due::after { border-radius: 14.5px; }
.mo-ev.due { overflow: visible; margin: 2px 1px; }
.mo-ev.due::after { inset: -2px; padding: 1.5px; border-radius: 8px; }
.mo-ev.due > .mo-t { display: block; overflow: hidden; text-overflow: ellipsis; }
/* ---------- смена темы: круг + волны от кнопки ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
.ripple-wave { position: fixed; z-index: 9999; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(200, 55, 45, .55); box-shadow: 0 0 18px rgba(200, 55, 45, .25), inset 0 0 12px rgba(200, 55, 45, .2);
  animation: wave 1s cubic-bezier(.2, .7, .3, 1) forwards; }
.ripple-wave.dark { border-color: rgba(255, 214, 170, .55); box-shadow: 0 0 18px rgba(255, 200, 150, .25), inset 0 0 12px rgba(255, 200, 150, .2); }
@keyframes wave { from { transform: scale(.4); opacity: 1; } to { transform: scale(14); opacity: 0; border-width: .5px; } }

/* ---------- перетаскивание занятий ---------- */
.wk .ev:not(.ghost):not(.burned) { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }
.ev.drag-src { opacity: .35; filter: saturate(.6); }
.ev.drag-ghost { z-index: 20; animation: none !important; transform: rotate(-1.5deg) scale(1.03); box-shadow: 0 14px 30px rgba(40, 20, 10, .28), 0 0 0 2px var(--c); pointer-events: none; transition: top .06s linear; }
.ev.drag-ghost.same { opacity: .6; }
.ev.drag-ghost .t { color: var(--c-t); }
.tz-note { flex-basis: 100%; font-size: 13px; color: var(--muted); font-weight: 700; background: var(--soft); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; }

/* при перетаскивании: время красным */
.ev.drag-ghost .t { color: var(--red) !important; }
.wk-times span { transition: color .12s, font-weight .12s; }
.wk-times span.hot { color: var(--red); font-weight: 900; }
.drag-band { position: absolute; right: 0; width: 4px; border-radius: 3px; background: var(--red); opacity: .75; pointer-events: none; }
.drag-mark { position: absolute; right: 6px; transform: translateY(-50%); z-index: 2; background: var(--red); color: #fff; font-size: 12px; font-weight: 900; padding: 2px 6px; border-radius: 7px; box-shadow: 0 3px 8px rgba(200, 55, 45, .35); pointer-events: none; white-space: nowrap; }
.drag-line { position: absolute; left: 56px; right: 0; height: 0; border-top: 2px dashed var(--red); opacity: .55; pointer-events: none; z-index: 5; }
@media (max-width: 640px) { .drag-line { left: 44px; } }

/* ---------- масштаб: на компьютере и планшете сайт на 20% компактнее (как масштаб 80% в браузере) ---------- */
@media (min-width: 900px) {
  html { zoom: .8; }
  .wk-scroll { max-height: 780px; }
  .side { max-height: 920px; }
}

/* ---------- звоночек уведомлений о переносе ---------- */
.bell { position: absolute; right: 4px; bottom: 4px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #f2d79f;
  background: #fff7e6; display: grid; place-items: center; font-size: 12px; line-height: 1; padding: 0; cursor: pointer; z-index: 4;
  box-shadow: 0 1px 3px rgba(60, 30, 15, .15); transition: transform .15s, box-shadow .15s; }
.bell:hover { transform: scale(1.12); box-shadow: 0 3px 8px rgba(60, 30, 15, .25); }
.bell:hover { animation: ring .5s ease-in-out; }
.bell.off { filter: grayscale(1); opacity: .7; }
[data-theme="dark"] .bell { background: #3a2d14; border-color: #5a4520; }
@keyframes ring { 0%, 100% { rotate: 0deg; } 20% { rotate: 14deg; } 40% { rotate: -12deg; } 60% { rotate: 8deg; } 80% { rotate: -4deg; } }
.ls-ev .bell { position: static; margin-left: auto; }
.pop.nt { width: 290px; }
.nt-head { font-weight: 900; font-size: 16px; }
.nt-sub { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.nt-list { display: grid; gap: 2px; margin-bottom: 8px; }
.nt-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 15px; user-select: none; }
.nt-row:hover { background: var(--hover); }
.nt-row input { position: absolute; opacity: 0; pointer-events: none; }
.nt-row .box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.nt-row input:checked + .box { background: var(--red); border-color: var(--red); }
.nt-row input:checked + .box::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.nt-row input:focus-visible + .box { outline: 2px solid var(--red); outline-offset: 2px; }
.nt-row small { color: var(--green); font-weight: 700; }
.nt-hint { color: var(--muted); font-size: 12.5px; margin: 0 4px 12px; }
.nt-foot { display: flex; justify-content: space-between; gap: 8px; }
#mvN .nt-list { margin-bottom: 4px; }
.nt-row.nt-par { border-top: 1.5px dashed var(--line); margin-top: 4px; padding-top: 10px; border-radius: 0 0 10px 10px; }
.nt-row small.no { color: var(--muted); }
.chip.add-par { border-style: dashed; color: var(--red); font-weight: 800; }
.ap-link { display: flex; gap: 8px; margin-top: 8px; }
.ap-link .inp { flex: 1; min-width: 0; font-size: 13px; }
.par-chip { display: inline-flex; align-items: center; gap: 6px; padding-right: 6px; cursor: default; }
.par-x { border: none; background: rgba(0, 0, 0, .12); color: inherit; width: 20px; height: 20px; border-radius: 50%; line-height: 1; font-size: 14px; font-weight: 900; display: grid; place-items: center; padding: 0; cursor: pointer; }
.par-x:hover { background: var(--red); color: #fff; }
.pop.par-pop { width: 320px; }
.pop.par-pop #parQ { margin: 8px 0 0; }

/* «1/8» и метка переноса — в одной строке, чтобы метка не вылезала за карточку */
.ev .ev-row { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; }
.ev .ev-row:empty { display: none; }
.ev .ev-row .sub { flex: none; }
.ev .ev-row .tag { margin-top: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; padding: 0 5px; }
.ev:has(.bell) .ev-row { padding-right: 22px; }

/* ---------- неделя ученика/родителя: одна строка ---------- */
.wk-mini .wk-head, .wk-mini .wk-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wk-mini .wk-head { position: static; }
.wk-mini .wk-head > div:first-child { position: static; background: transparent; }
.wk-row { display: grid; }
.wk-cell { border-left: 1px solid var(--line-2); padding: 8px 5px 10px; min-height: 64px; display: flex; flex-direction: column; gap: 6px; }
.wk-cell:first-child { border-left: 0; }
.wk-cell.today { background: var(--today); }
.mini { border-radius: 10px; padding: 6px 6px 6px 8px; cursor: pointer; background: var(--bg); border: 1.5px solid var(--bd); border-left: 4px solid var(--c);
  display: flex; flex-direction: column; gap: 1px; min-width: 0; transition: box-shadow .15s, transform .1s; }
.mini:hover { box-shadow: 0 4px 14px rgba(60, 40, 20, .15); transform: translateY(-1px); }
.mini .t { font-weight: 900; color: var(--c-t); font-size: 15px; white-space: nowrap; }
.mini .t .e { font-weight: 700; color: var(--muted); font-size: 13px; }
.mini .nm { font-weight: 800; color: var(--c-d); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .mv { font-size: 11px; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .st { font-size: 11px; font-weight: 800; color: var(--red); }
.mini.cancelled .t, .mini.ghost .t { color: #a69a90; text-decoration: line-through; }
.mini.cancelled, .mini.ghost { background: repeating-linear-gradient(45deg, var(--card) 0 6px, var(--soft) 6px 12px); border: 1.5px dashed #cfc6be; }
.mini.burned { opacity: .7; filter: saturate(.55); }
@media (max-width: 720px) {
  .wk-cell { padding: 6px 2px 8px; }
  .mini { padding: 5px 1px; border-left-width: 3px; border-radius: 8px; align-items: center; text-align: center; }
  .mini .t { font-size: 12px; letter-spacing: -.02em; }
  .mini .nm { font-size: 10px; max-width: 100%; }
  .mini .t .e { display: none; }
  .mini .mv { display: none; }
}

/* ---------- шаг 2: подключение уведомлений ---------- */
.seg.ch { margin-bottom: 6px; }
.seg.ch button small { font-size: 11px; font-weight: 700; color: var(--muted); }
.seg.ch button:disabled { opacity: .55; cursor: not-allowed; }
.link-card .step { font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.link-card h2 { margin: 4px 0 6px; font-size: 22px; font-weight: 900; }
.link-card .lead { margin: 0 0 14px; color: var(--ink-2); line-height: 1.45; }
.howto { margin: 14px 0 16px; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; }
.howto li { counter-increment: st; position: relative; padding-left: 36px; line-height: 1.4; min-height: 26px; }
.howto li::before { content: counter(st); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 900; font-size: 13px; color: var(--red); }
.btn.wa { background: #25a35a; border-color: #25a35a; color: #fff; text-decoration: none; }
.btn.wa:hover { background: #1f8f4e; }
.link-card a.btn { text-decoration: none; display: flex; justify-content: center; }
.link-card .alt { margin-top: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.link-card .alt summary { cursor: pointer; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.link-card .wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--muted); }
.link-card .wait .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

/* ---------- настройки WhatsApp ---------- */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }

.linkbtn { display:block; margin:10px auto 0; background:none; border:0; padding:6px 10px; font:inherit; font-weight:700; font-size:14px; color:var(--red); cursor:pointer; }
.linkbtn:hover { text-decoration:underline; }

