:root {
	--bg: #141518;
	--panel: #1e2025;
	--panel-2: #272a31;
	--line: #33363e;
	--text: #eceef2;
	--muted: #9aa0ab;
	--accent: #3d7bff;
	--accent-2: #2f66e0;
	--danger: #e5484d;
	--ok: #30a46c;
	--warn: #f5a524;
	--radius: 12px;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
	background: var(--bg);
	color: var(--text);
	font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: #7aa2ff; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px;
	padding: 9px 16px; cursor: pointer; white-space: nowrap; transition: background .15s; text-decoration: none;
}
.btn:hover { background: #31353d; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input {
	width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
	padding: 10px 12px; outline: none;
}
.input:focus { border-color: var(--accent); }
label.field { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }

/* ---------- главная ---------- */
.home { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.brand .logo svg { width: 20px; height: 20px; stroke: #fff; }
.home header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 200px; min-width: 0; }
.room-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.room-item:first-of-type { border-top: 0; }
.room-item .meta { flex: 1 1 220px; min-width: 0; }
.room-item .title { font-weight: 600; }
.room-item .link { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note { color: var(--muted); font-size: 13px; }
.hero { text-align: center; padding: 40px 0 8px; }
.hero h1 { font-size: 28px; margin: 0 0 8px; }

/* ---------- экран входа ---------- */
.prejoin { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.prejoin .pvbtns { display: flex; gap: 10px; margin-top: 18px; }
.prejoin .pvbtns .btn { padding: 12px; justify-content: center; flex: 1; }
.prejoin .pvbtns .primary { flex: 2; }
.prejoin .pvbtns a.btn { color: var(--text); text-decoration: none; }
.prejoin .box { width: 100%; max-width: 880px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.preview { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .off { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.preview .ctrls { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 12px; }
.round {
	width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
	background: rgba(60, 64, 72, .85); color: #fff;
}
.round.off { background: var(--danger); }
.meter { height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(61, 123, 255, .18); color: #9db9ff; }
.error { color: #ff8a8d; margin-top: 10px; font-size: 14px; }
@media (max-width: 720px) {
	.prejoin .box { grid-template-columns: 1fr; }
}

/* ---------- комната ---------- */
.meeting { position: fixed; inset: 0; display: flex; flex-direction: column; }
.topbar { height: 48px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-bottom: 1px solid #000; background: var(--panel); }
.topbar .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .timer { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.topbar .spacer { flex: 1; }
.rec-dot { display: inline-flex; align-items: center; gap: 6px; color: #ff8a8d; font-size: 13px; }
.rec-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.body { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; position: relative; min-width: 0; display: flex; }
.banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.banner.green { background: #1d3b2b; border-color: #2c5a41; }

.grid { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 8px; padding: 8px; overflow: auto; }
.grid .tile { width: var(--tw, 320px); height: var(--th, 180px); }

.stage-wrap { flex: 1; display: flex; gap: 8px; padding: 8px; min-height: 0; min-width: 0; }
.stage { flex: 1; min-width: 0; min-height: 0; display: flex; }
.stage .tile { flex: 1; height: auto; }
.strip { width: 220px; flex: none; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.strip .tile { width: 100%; aspect-ratio: 16/9; height: auto; flex: none; }
@media (max-width: 720px), (max-aspect-ratio: 1/1) {
	.stage-wrap { flex-direction: column; }
	.strip { width: auto; height: 96px; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
	.strip .tile { width: auto; height: 100%; }
}

.tile { position: relative; background: var(--panel-2); border-radius: 10px; overflow: hidden; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .15s; }
.tile.speaking { outline-color: var(--ok); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.contain video, .stage .tile video { object-fit: contain; }
.tile.mirror video { transform: scaleX(-1); }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; }
.tile.novideo .avatar { display: grid; }
.tile.novideo video { display: none; }
.tile .avatar span { width: min(40%, 96px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: clamp(14px, 3vw, 32px); color: #fff; }
.tile .label { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); display: flex; gap: 5px; align-items: center; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 6px; font-size: 13px; }
.tile .label .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .label svg.i { width: 15px; height: 15px; color: #ff6b6f; }
.tile .hand { position: absolute; top: 6px; left: 6px; font-size: 22px; display: none; animation: wave 1s ease-in-out 2; }
.tile.hand-up .hand { display: block; }
@keyframes wave { 50% { transform: rotate(18deg); } }
.tile .tbtns { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.tile:hover .tbtns { opacity: 1; }
.tile .tbtns button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tile .tbtns svg.i { width: 16px; height: 16px; }
.tile .q { position: absolute; right: 8px; bottom: 9px; display: flex; gap: 2px; align-items: flex-end; height: 12px; }
.tile .q i { width: 3px; background: #fff; opacity: .85; border-radius: 1px; }
.tile .q i:nth-child(1) { height: 4px; } .tile .q i:nth-child(2) { height: 8px; } .tile .q i:nth-child(3) { height: 12px; }
.tile .q.poor i:nth-child(n+2), .tile .q.lost i { opacity: .2; }
.tile .q.poor i { background: var(--danger); }
.tile .q.good i:nth-child(3) { opacity: .2; }
.tile .q.good i { background: var(--warn); }
.tile .q.excellent { display: none; }
.float-emoji { position: absolute; bottom: 10%; font-size: 40px; pointer-events: none; animation: floatup 2.6s ease-out forwards; z-index: 4; }
@keyframes floatup { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-10px) scale(1.1); } 100% { transform: translateY(-160px) scale(1); opacity: 0; } }

/* боковая панель */
.side { width: 340px; flex: none; background: var(--panel); border-left: 1px solid #000; display: flex; flex-direction: column; min-height: 0; }
.side .tabs { display: flex; border-bottom: 1px solid var(--line); }
.side .tabs button { flex: 1; background: none; border: 0; padding: 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.side .tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.side .tabs .x { flex: none; width: 44px; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.msg .who { font-size: 12px; color: var(--muted); }
.msg .who b { color: var(--text); font-weight: 600; }
.msg .txt { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.sys { color: var(--muted); font-size: 13px; text-align: center; }
.compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.compose textarea { flex: 1; resize: none; height: 42px; max-height: 120px; }
.people { flex: 1; overflow-y: auto; padding: 6px 0; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.person:hover { background: var(--panel-2); }
.person .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.person .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .nm small { color: var(--muted); }
.person .st { display: flex; gap: 6px; color: var(--muted); align-items: center; }
.person .st svg.i { width: 17px; height: 17px; }
.person .st .red { color: #ff6b6f; }
.person .act { display: none; gap: 4px; }
.person:hover .act, .person.open .act { display: flex; }
.person .act button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; }
.person .act svg.i { width: 16px; height: 16px; }
.host-tools { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 720px) {
	.side { position: fixed; inset: 48px 0 68px 0; width: auto; z-index: 20; border-left: 0; }
	.person .act { display: flex; }
}

/* нижняя панель */
.toolbar { flex: none; min-height: 68px; display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--panel); border-top: 1px solid #000; overflow-x: auto; }
.toolbar .grp { display: flex; gap: 4px; align-items: center; }
.toolbar .spacer { flex: 1; min-width: 4px; }
.tb {
	position: relative; min-width: 64px; height: 56px; border-radius: 10px; border: 0; background: transparent; cursor: pointer;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: var(--text); padding: 0 6px;
}
.tb:hover { background: var(--panel-2); }
.tb.off svg.i { color: #ff6b6f; }
.tb.on { background: rgba(61, 123, 255, .18); color: #a9c3ff; }
.tb.rec svg.i { color: var(--danger); }
.tb .dot { position: absolute; top: 6px; right: 14px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); font-size: 10px; display: grid; place-items: center; color: #fff; }
.tb.show-m { display: none; }
.tb.leave { background: var(--danger); color: #fff; min-width: 76px; }
.tb.leave:hover { background: #c93a3f; }
@media (max-width: 720px) {
	.tb { min-width: 52px; font-size: 10px; }
	.tb.hide-m { display: none; }
	.tb.show-m { display: flex; }
}

.pop { position: fixed; z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); padding: 8px; }
.pop.emojis { display: flex; gap: 4px; }
.pop.emojis button { font-size: 26px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.pop.emojis button:hover { background: var(--panel-2); }
.pop.menu { display: flex; flex-direction: column; min-width: 220px; }
.pop.menu button { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.pop.menu button:hover { background: var(--panel-2); }
.pop.menu button.red { color: #ff8a8d; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.modal h3 { margin: 0 0 6px; }
.modal .row { justify-content: flex-end; margin-top: 18px; }

.toasts { position: fixed; left: 16px; bottom: 84px; z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100% - 32px); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: tin .2s ease-out; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

.center-msg { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
.center-msg h2 { margin: 0 0 8px; }
.center-msg .row { justify-content: center; margin-top: 18px; }

/* ---------- ученики ---------- */
.home.wide { max-width: 980px; }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.sec-title h2 { margin: 0; font-size: 19px; }
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.av.big { width: 64px; height: 64px; font-size: 22px; }
.grade { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.grade.st { background: rgba(48,164,108,.16); color: #6fd3a0; border-color: transparent; }
.bal { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 99px; display: inline-block; white-space: nowrap; }
.bal.ok { background: rgba(48,164,108,.16); color: #6fd3a0; }
.bal.debt { background: rgba(229,72,77,.16); color: #ff8a8d; }

.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.scard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; }
.scard:hover { border-color: #4a4f5a; }
.scard .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.scard .name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.scard .stat { color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.scard .foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; color: var(--muted); margin-top: auto; }
.scard.add { border-style: dashed; align-items: center; justify-content: center; color: var(--muted); min-height: 150px; background: transparent; cursor: pointer; font: inherit; }
.scard.add svg { width: 28px; height: 28px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }

.back { color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 18px; font-size: 14px; }
.back svg { width: 18px; height: 18px; }
.shead { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.shead .who { flex: 1 1 200px; min-width: 0; }
.shead h1 { margin: 0 0 6px; font-size: 26px; overflow-wrap: anywhere; }
.share-note { display: flex; gap: 10px; align-items: center; background: rgba(61,123,255,.12); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #b9cdff; margin-bottom: 16px; }
.share-note svg { width: 18px; height: 18px; }

.pay { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pay .info { flex: 1 1 200px; }
.pay .big { font-size: 30px; font-weight: 700; line-height: 1.1; }
.pay .big.ok { color: #6fd3a0; }
.pay .big.debt { color: #ff8a8d; }
.hist { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.hist .hr { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; color: var(--muted); min-height: 34px; }
.hist b { color: var(--text); font-weight: 600; }
.hist .hr .ico-btn { margin-left: 4px; }
.linkish { background: none; border: 0; color: #7aa2ff; padding: 6px 0; cursor: pointer; font-size: 14px; }

.lesson { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.lesson .lh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lesson .date { font-weight: 700; font-size: 16px; white-space: nowrap; }
.lesson .wd { color: var(--muted); font-size: 13px; }
.lesson .sp { flex: 1; }
.lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.todo label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 2px 0; }
.todo input { position: absolute; opacity: 0; pointer-events: none; }
.cb { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #555b66; flex: none; margin-top: 1px; display: grid; place-items: center; }
.todo input:checked + .cb { background: var(--ok); border-color: var(--ok); }
.todo input:checked + .cb::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.todo input:focus-visible + .cb { outline: 2px solid var(--accent); outline-offset: 2px; }
.todo input:checked ~ span { color: var(--muted); text-decoration: line-through; }
.comment { color: #cfd3da; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ico-btn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; }
.ico-btn:hover { background: var(--panel-2); color: var(--text); }
.ico-btn svg { width: 18px; height: 18px; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(48,164,108,.16); color: #6fd3a0; white-space: nowrap; }
.pill.part { background: rgba(245,165,36,.16); color: #f5c06a; }
.dur { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: #cfd3da; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }

.modal.wide { max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; }
.modal .mfoot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal .mfoot .sp { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { padding: 8px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.num { min-width: 42px; padding: 8px 0; }
.chips .input.other { width: 90px; padding: 8px 10px; }
.todo-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo-edit li { display: flex; gap: 6px; align-items: center; }
.todo-edit .input { padding: 8px 10px; }
textarea.input { min-height: 80px; resize: vertical; }
.modal .error { margin-top: 12px; }
.mrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mrow > .grow { flex: 1 1 200px; min-width: 0; }
.hist .hr > span { display: inline-flex; align-items: center; }

/* ---------- плашка записи ---------- */
.recbox { position: fixed; left: 16px; bottom: 88px; z-index: 70; width: min(380px, calc(100% - 32px)); display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center;
	background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.45); font-size: 14px; }
.recbox .meter { grid-column: 1 / 2; margin: 0; }
.recbox .ico-btn { grid-row: 1; grid-column: 2; align-self: start; }
.recbox + .recbox { bottom: 190px; }

/* вход по коду */
.login-screen { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; text-align: center; }
.login h1 { margin: 0 0 22px; font-size: 22px; }
.login .note { margin: -14px 0 18px; }
.login .btn.primary { width: 100%; padding: 12px; justify-content: center; }
.login .error { margin-top: 14px; }
.code { position: relative; display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; cursor: text; }
.code span { width: 46px; height: 56px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.code span.cur { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61,123,255,.25); }
.code i { width: 6px; }
.code input { position: absolute; inset: 0; width: 100%; opacity: 0; font-size: 16px; caret-color: transparent; }
@media (max-width: 480px) {
	.login { padding: 28px 16px; }
	.code { gap: 6px; }
	.code span { width: 40px; height: 52px; font-size: 24px; }
	.code i { width: 2px; }
}
.tgicon { width: 52px; height: 52px; border-radius: 50%; background: #2aabee; display: grid; place-items: center; margin: 0 auto 14px; color: #fff; }
.tgicon svg { width: 26px; height: 26px; }
.spin { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--panel-2); border-top-color: var(--accent); margin: 0 auto 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* код ученика */
.codeedit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.codeedit .sp { flex: 1; }
.codeedit .input.num { width: 150px; font-size: 22px; font-weight: 700; letter-spacing: .12em; text-align: center; padding: 8px 10px; }
.codeval { color: var(--text); letter-spacing: .08em; }
.moved { background: rgba(61,123,255,.14); border: 1px solid rgba(61,123,255,.35); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.moved .t { flex: 1 1 220px; font-weight: 600; }
.moved .c { font-size: 13px; color: var(--muted); }
.moved .c b { display: block; font-size: 24px; color: var(--text); letter-spacing: .08em; }
.next { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #2f66e0, #3d7bff); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; color: #fff; }
.next .w { flex: 1; min-width: 0; }
.next .w b { font-size: 17px; display: block; }
.next .w span { font-size: 13px; opacity: .85; overflow-wrap: anywhere; }
.next .btn { background: #fff; color: #1d4fc4; border: 0; }
.topline { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; }
.scard .foot + .foot { margin-top: 0; border-top: 0; padding-top: 0; }

/* ---------- календарь (calendar.js), в стиле Apple ---------- */
.navtabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.navtabs a { padding: 6px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.navtabs a.on { background: var(--panel-2); color: var(--text); }
.home.wide.cal-on { max-width: 1280px; }
.home header .hl { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.calwrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.cal { --cal-red: #ff453a; --cal-line: #2c2c2e; background: #1c1c1e; border: 1px solid var(--cal-line); border-radius: 14px; overflow: hidden; position: relative; }
.calbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--cal-line); flex-wrap: wrap; }
.calbar h2 { margin: 0; font-size: 21px; font-weight: 700; white-space: nowrap; }
.calbar h2 span { color: var(--cal-red); font-weight: 400; }
.calbar .sp { flex: 1; }
.calseg, .calnav { display: flex; background: #2c2c2e; border-radius: 8px; padding: 2px; }
.calseg button, .calnav button { background: none; border: 0; padding: 4px 12px; font-size: 13px; border-radius: 6px; color: #d1d1d6; cursor: pointer; }
.calseg button.on { background: #636366; color: #fff; }
.calnav button:hover, .calseg button:not(.on):hover { background: #3a3a3c; }
.calbtn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; font-size: 13px; border-radius: 7px; background: #2c2c2e; color: #e5e5ea; border: 0; cursor: pointer; text-decoration: none; }
.calbtn svg.i { width: 15px; height: 15px; }
.calbtn.red { background: var(--cal-red); color: #fff; }
.calerr { padding: 10px 14px; color: #ff8a8d; font-size: 14px; border-bottom: 1px solid var(--cal-line); }
.cal-head { display: grid; grid-template-columns: 52px repeat(var(--cols), 1fr); border-bottom: 1px solid var(--cal-line); }
.cal-head .dh { background: none; border: 0; border-left: 1px solid var(--cal-line); color: #98989d; font-size: 13px; text-align: left; padding: 7px 8px; cursor: pointer; white-space: nowrap; }
.cal-head .dh b { font-size: 19px; font-weight: 400; color: #e5e5ea; margin-left: 4px; display: inline-grid; place-items: center; min-width: 28px; height: 28px; }
.cal-head .dh.we { color: #6e6e73; }
.cal-head .dh.today { color: var(--cal-red); }
.cal-head .dh.today b { background: var(--cal-red); color: #fff; border-radius: 50%; font-weight: 600; }
.cal-strip { display: grid; grid-template-columns: repeat(7, 1fr); padding: 6px 6px 8px; border-bottom: 1px solid var(--cal-line); }
.cal-strip button { background: none; border: 0; color: #8e8e93; font-size: 11px; text-transform: uppercase; cursor: pointer; padding: 2px 0; }
.cal-strip b { display: grid; place-items: center; margin: 3px auto 0; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; font-weight: 400; color: #fff; }
.cal-strip .today b { color: var(--cal-red); }
.cal-strip .sel b { background: #fff; color: #000; font-weight: 600; }
.cal-strip .sel.today b { background: var(--cal-red); color: #fff; }
.cal-strip i { display: block; width: 5px; height: 5px; border-radius: 50%; margin: 3px auto 0; }
.cal-strip i.has { background: #8e8e93; }
.cal-dayline { padding: 8px 14px; font-size: 15px; color: #e5e5ea; border-bottom: 1px solid var(--cal-line); }
.cal-dayline::first-letter { text-transform: uppercase; }
.cal-scroll { overflow-y: auto; max-height: max(380px, calc(100vh - 250px)); max-height: max(380px, calc(100dvh - 250px)); }
.cal-grid { position: relative; display: grid; grid-template-columns: 52px repeat(var(--cols), 1fr); }
.cal-hours div { height: 48px; font-size: 11px; color: #8e8e93; text-align: right; padding-right: 7px; transform: translateY(-7px); }
.cal-col { position: relative; border-left: 1px solid var(--cal-line); background-image: repeating-linear-gradient(var(--cal-line) 0 1px, transparent 1px 48px); cursor: cell; }
.cal-col.we { background-color: #19191b; }
.cev { position: absolute; border: 0; border-left: 3px solid; border-radius: 6px; padding: 3px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; text-align: left; cursor: pointer; z-index: 1; }
.cev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 12px; }
.cev small { opacity: .85; white-space: nowrap; }
.cev.short { display: flex; gap: 6px; align-items: baseline; padding-top: 1px; }
.cev.past { opacity: .6; }
.cev .tick { position: absolute; right: 5px; top: 3px; font-size: 12px; }
.cev .tick.late { color: #ff9f0a; }
div.cev { cursor: default; }
.cev:hover { filter: brightness(1.15); }
.c0 { --c: 10,132,255; } .c1 { --c: 48,209,88; } .c2 { --c: 255,159,10; } .c3 { --c: 191,90,242; }
.c4 { --c: 255,55,95; } .c5 { --c: 100,210,255; } .c6 { --c: 255,214,10; } .c7 { --c: 172,142,104; } .cx { --c: 142,142,147; }
.cev[class*=" c"] { background: rgba(var(--c), .26); border-left-color: rgb(var(--c)); color: #fff; }
.cev.cx { background: rgba(142,142,147,.2); color: #e5e5ea; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--cal-red); z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--cal-red); }
.cal-nowlbl { position: absolute; left: 0; width: 48px; text-align: right; padding-right: 4px; font-size: 11px; color: var(--cal-red); font-weight: 600; transform: translateY(-7px); background: #1c1c1e; z-index: 4; pointer-events: none; }
.cal-mhead { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--cal-line); }
.cal-mhead div { font-size: 12px; color: #8e8e93; text-align: right; padding: 6px 8px; }
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(92px, 1fr); }
.cm-day { background: none; border: 0; border-right: 1px solid var(--cal-line); border-bottom: 1px solid var(--cal-line); color: #e5e5ea; text-align: left; padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; overflow: hidden; }
.cm-day b { align-self: flex-end; font-weight: 400; font-size: 14px; min-width: 24px; height: 24px; display: grid; place-items: center; }
.cm-day.out { color: #636366; }
.cm-day.we { background: #19191b; }
.cm-day.today b { background: var(--cal-red); color: #fff; border-radius: 50%; font-weight: 600; }
.cm-ev { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.cm-ev i { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c)); flex: none; }
.cm-more { font-size: 11px; color: #8e8e93; }
.callegend { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.callegend h4 { margin: 6px 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.callegend h4 + p, .callegend .note { font-size: 13px; }
.callegend .who { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14px; }
.callegend .who i { width: 11px; height: 11px; border-radius: 3px; background: rgb(var(--c)); flex: none; }
.callegend .who span { margin-left: auto; color: var(--muted); font-size: 12px; }
.callegend .btn.wide { width: 100%; white-space: normal; margin: 4px 0 14px; }
.lg-ok { color: #e5e5ea; } .lg-late { color: #ff9f0a; }
.cpop { position: fixed; z-index: 45; width: 310px; background: #2c2c2e; border: 1px solid #3a3a3c; border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.55); padding: 14px 16px; }
.cpop.sheet { left: 10px; right: 10px; bottom: 10px; width: auto; }
.cpop h3 { margin: 0 0 2px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.cpop h3 i { width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--c)); flex: none; }
.cpop .meta { color: #aeaeb2; font-size: 13px; margin-bottom: 8px; }
.cpop .meta::first-letter { text-transform: uppercase; }
.cpop .line { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; padding: 7px 0; border-top: 1px solid #3a3a3c; color: #d1d1d6; }
.cpop .line > span:first-child { color: #8e8e93; }
.cpop .line.warn { color: #f5c06a; display: block; }
.cpop .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cpop .acts .btn { color: var(--text); }
.cpop .acts .btn.primary { color: #fff; }
label.check { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 14px; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
ol.steps { margin: 10px 0 14px; padding-left: 20px; color: #d1d1d6; line-height: 1.6; font-size: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.kv span { color: var(--muted); }
.kv code { font: 14px ui-monospace, Menlo, monospace; color: #fff; overflow-wrap: anywhere; }
.scal { margin-bottom: 18px; }
.scal .note { margin-top: 8px; }
@media (max-width: 1000px) {
	.calwrap { grid-template-columns: 1fr; }
	.callegend { display: none; }
}
@media (max-width: 720px) {
	.home.wide.cal-on { padding: 16px 0 24px; }
	.home.wide.cal-on header { padding: 0 12px; margin-bottom: 12px; }
	.cal-on .cal { border-radius: 0; border-left: 0; border-right: 0; }
	.calbar { padding: 10px 12px; gap: 8px; }
	.calbar h2 { font-size: 19px; flex: 1; }
	.calbar .sp { display: none; }
	.calseg { flex: 1; }
	.calseg button { flex: 1; }
	.cal-on .brand { font-size: 17px; }
	.cal-head .dh { font-size: 11px; padding: 5px 2px; text-align: center; }
	.cal-head .dh b { display: grid; margin: 2px auto 0; font-size: 16px; }
	.cal-month { grid-auto-rows: minmax(64px, 1fr); }
	.cm-ev { font-size: 10px; } .cm-ev i { display: none; }
}
