:root { 
    --primary: #00f0ff; --success: #00ff66; --warning: #ffbe0b; --danger: #ff0055; 
    --bg: #0b0c10; --card-bg: #14161c; --border: #1f222e; --text: #c5c6c7; 
    --text-bright: #ffffff; --input-bg: #0f1115; --shadow-glow: 0 0 10px rgba(0, 240, 255, 0.2);
    --bg-pattern: linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
}

/* === СВЕТЛАЯ ТЕМА === */
body.light-mode {
    --primary: #0077cc; --success: #00aa44; --warning: #e6a800; --danger: #cc0044;
    --bg: #f0f2f5; --card-bg: #ffffff; --border: #dde1e7; --text: #444c5e;
    --text-bright: #1a1d24; --input-bg: #f8f9fb; --shadow-glow: 0 0 10px rgba(0, 119, 204, 0.15);
    --bg-pattern: linear-gradient(rgba(0, 119, 204, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 119, 204, 0.04) 1px, transparent 1px);
}

body { 
    font-family: 'Segoe UI', Roboto, sans-serif; 
    background: var(--bg); 
    background-image: var(--bg-pattern); 
    background-size: 30px 30px; 
    margin: 0; padding: 20px; 
    color: var(--text); 
    transition: background 0.3s, color 0.3s; 
    -webkit-user-select: none; 
    user-select: none; 
}
input, textarea, .ql-editor { -webkit-user-select: text; user-select: text; }
h1, h2, h3, h4 { color: var(--text-bright); margin-top: 0; font-weight: 600; }

/* === ХЕДЕР === */
.header { 
    display: flex; justify-content: space-between; align-items: center; 
    background: var(--card-bg); padding: 15px 20px; border-radius: 8px; 
    margin-bottom: 25px; border: 1px solid var(--border); 
    border-bottom: 2px solid var(--primary); 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); 
}
.header-brand { min-width: 0; flex: 1 1 auto; }
.header-actions { flex: 0 0 auto; gap: 10px; justify-content: flex-end; }
.header-bonus-account {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 193, 7, 0.45);
    background: rgba(255, 193, 7, 0.08);
    color: var(--warning);
    box-shadow: none;
    white-space: nowrap;
}
.header-bonus-account strong { color: var(--text-bright); font-size: 14px; }
.bonus-account-card { display:flex;align-items:center;justify-content:space-between;gap:20px;border-color:var(--warning); }
.bonus-account-card > div:first-child { display:flex;flex-direction:column;gap:4px; }
.bonus-account-card strong { color:var(--warning);font-size:26px; }
.bonus-account-card small { color:gray; }
.bonus-referral-copy { display:flex;gap:8px;flex:1;max-width:560px; }
.bonus-referral-copy input,
.bonus-center-link input {
    margin:0;
    background:var(--input-bg) !important;
    color:var(--text-bright) !important;
    border:1px solid var(--border) !important;
    box-shadow:none !important;
}
.bonus-center-modal { align-items:center;justify-content:center;padding:18px; }
.bonus-center-content { width:min(820px, 100%);max-width:820px;max-height:min(90vh, 860px);margin:0;padding:0;overflow-y:auto;border-color:rgba(255,193,7,.5); }
.bonus-center-close { position:absolute;right:16px;top:14px;z-index:2;width:36px;height:36px;padding:0;border:0;background:rgba(0,0,0,.18);box-shadow:none;font-size:26px;line-height:1;color:var(--text-bright); }
.bonus-center-head { display:flex;align-items:center;justify-content:space-between;gap:20px;padding:30px;background:linear-gradient(135deg,rgba(255,193,7,.18),rgba(0,240,255,.07));border-bottom:1px solid var(--border); }
.bonus-center-head span { color:var(--warning);font-weight:800;text-transform:uppercase;letter-spacing:.08em;font-size:12px; }
.bonus-center-head h2 { margin:5px 0 2px;font-size:38px; }
.bonus-center-head h2 small { font-size:16px;color:var(--text); }
.bonus-center-head p { margin:0;color:gray;font-size:13px; }
.bonus-center-wallet { width:72px;height:72px;border-radius:50%;display:grid;place-items:center;background:rgba(255,193,7,.12);border:1px solid rgba(255,193,7,.4);color:var(--warning);font-size:34px; }
.bonus-expiry-alert { display:flex;gap:10px;align-items:center;margin:18px 24px 0;padding:12px 14px;border:1px solid rgba(255,193,7,.35);border-radius:8px;background:rgba(255,193,7,.08);color:var(--warning); }
.bonus-center-section { padding:24px 30px;border-bottom:1px solid var(--border); }
.bonus-center-section:last-child { border-bottom:0; }
.bonus-center-section h3 { margin:0 0 16px;font-size:17px; }
.bonus-rules { display:grid;gap:10px; }
.bonus-rule { display:flex;align-items:flex-start;gap:12px;padding:13px;border-radius:8px;background:var(--input-bg);border:1px solid var(--border); }
.bonus-rule > i { flex:0 0 auto;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:rgba(0,240,255,.08);color:var(--primary);font-size:19px; }
.bonus-rule div { display:flex;flex-direction:column;gap:3px; }
.bonus-rule b { color:var(--text-bright);font-size:14px; }
.bonus-rule span { color:gray;font-size:12px;line-height:1.45; }
.bonus-rule.muted { opacity:.78; }
.bonus-center-link { display:flex;gap:8px;margin-top:14px; }
.bonus-center-link button { white-space:nowrap; }
.bonus-spend-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px; }
.bonus-spend-grid > div { display:flex;flex-direction:column;align-items:center;text-align:center;gap:5px;padding:16px 10px;border:1px solid var(--border);border-radius:8px;background:rgba(0,240,255,.025); }
.bonus-spend-grid i { color:var(--primary);font-size:25px; }
.bonus-spend-grid b { color:var(--text-bright);font-size:13px; }
.bonus-spend-grid span { color:gray;font-size:11px; }
.bonus-center-note { margin:14px 0 0;color:gray;font-size:11px;line-height:1.5; }
.bonus-history-list { display:grid;gap:6px; }
.bonus-history-item { display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border); }
.bonus-history-item:last-child { border-bottom:0; }
.bonus-history-icon { width:30px;height:30px;display:grid;place-items:center;border-radius:50%; }
.bonus-history-icon.positive { color:var(--success);background:rgba(0,255,136,.08); }
.bonus-history-icon.negative { color:var(--warning);background:rgba(255,193,7,.08); }
.bonus-history-item div { display:flex;flex-direction:column;gap:2px; }
.bonus-history-item b { color:var(--text-bright);font-size:12px; }
.bonus-history-item small { color:gray;font-size:10px; }
.bonus-history-item > strong { font-size:13px; }
.bonus-history-item > strong.positive { color:var(--success); }
.bonus-history-item > strong.negative { color:var(--warning); }
.bonus-history-empty,.bonus-center-loading { padding:28px;text-align:center;color:gray; }
.bonus-payment-badge { display:inline-flex;align-items:center;gap:6px;width:fit-content;padding:5px 9px;border-radius:999px;border:1px solid rgba(255,193,7,.45);background:rgba(255,193,7,.08);color:var(--warning);font-size:11px;font-weight:800; }
.notification-center {
    position: relative;
}
.notification-main-btn {
    position: relative;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(0, 240, 255, 0.06);
    color: var(--primary);
    border: 1px solid rgba(0, 240, 255, 0.38);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.1);
    white-space: nowrap;
}
.notification-main-btn i {
    font-size: 20px;
}
.notification-badge {
    position: absolute;
    right: -5px;
    top: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    font-weight: 900;
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.45);
}
.notification-panel {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(380px, calc(100vw - 28px));
    max-height: min(520px, calc(100vh - 115px));
    overflow: hidden;
    background: rgba(20, 22, 28, 0.98);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.48), 0 0 20px rgba(0, 240, 255, 0.08);
    z-index: 1800;
}
.notification-center.open .notification-panel {
    display: block;
}
.notification-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
}
.notification-panel-head b {
    color: var(--text-bright);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.notification-panel-head button {
    padding: 7px;
    min-width: 34px;
    box-shadow: none;
    background: transparent;
}
.notification-list {
    max-height: 455px;
    overflow-y: auto;
    padding: 8px;
}
.notification-item,
.notification-empty {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    box-shadow: none;
    text-align: left;
    margin-bottom: 8px;
}
.notification-item:hover {
    background: rgba(0, 240, 255, 0.08);
    transform: none;
    text-shadow: none;
}
.notification-item i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: rgba(0, 240, 255, 0.07);
    color: var(--primary);
    font-size: 20px;
}
.notification-item > span {
    flex: 1 1 auto;
    min-width: 0;
}
.notification-item strong {
    display: block;
    color: var(--text-bright);
    margin-bottom: 3px;
}
.notification-item span,
.notification-empty {
    color: gray;
    font-size: 13px;
    line-height: 1.35;
}
.notification-item.danger i { color: var(--danger); }
.notification-item.warning i { color: var(--warning); }
.notification-item.success i { color: var(--success); }
body.light-mode .notification-panel {
    background: rgba(255, 255, 255, 0.98);
    border-color: #d9e1ec;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18), 0 0 18px rgba(0, 119, 204, 0.08);
}
body.light-mode .notification-panel-head {
    background: rgba(248, 250, 252, 0.92);
    border-bottom-color: #d9e1ec;
}
body.light-mode .notification-panel-head button {
    color: var(--primary);
    border-color: rgba(0, 119, 204, 0.28);
}
body.light-mode .notification-item,
body.light-mode .notification-empty {
    background: #f8fafc;
    border-color: #d9e1ec;
    color: #5d6678;
}
body.light-mode .notification-item:hover {
    background: rgba(0, 119, 204, 0.08);
}
body.light-mode .notification-item i {
    background: rgba(0, 119, 204, 0.09);
}
body.light-mode .notification-item span,
body.light-mode .notification-empty {
    color: #6b7280;
}
.theme-btn {
    width: 40px; height: 40px; min-width: 40px;
    background: transparent; border: none; font-size: 24px; cursor: pointer;
    color: var(--text); box-shadow: none; padding: 0; margin: 0;
}
.theme-btn i { font-size: 24px; }
.theme-btn:hover { background: rgba(0, 240, 255, 0.08); transform: none; text-shadow: none; }

/* === КНОПКИ === */
button, .theme-btn-upload { 
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; 
    background: rgba(0, 240, 255, 0.05); color: var(--primary); 
    border: 1px solid var(--primary); padding: 12px 20px; border-radius: 6px; 
    cursor: pointer; font-weight: bold; font-size: 14px; 
    transition: all 0.3s ease; box-shadow: var(--shadow-glow); 
}
button i, .theme-btn-upload i { font-size: 18px; }
button:hover, .theme-btn-upload:hover { 
    background: rgba(0, 240, 255, 0.15); 
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4); 
    text-shadow: none;
    transform: translateY(-1px); 
}
button.btn-success { background: rgba(0, 255, 102, 0.05); color: var(--success); border-color: var(--success); }
button.btn-success:hover { background: rgba(0, 255, 102, 0.15); text-shadow: none; }
button.btn-solid-success {
    background: linear-gradient(135deg, rgba(0,255,102,0.95), rgba(0,240,255,0.85));
    color: #06120a;
    border-color: var(--success);
    box-shadow: 0 0 18px rgba(0,255,102,0.22), 0 0 12px rgba(0,240,255,0.18);
}

.question-points-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 92px;
    padding: 10px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 6px;
    background: rgba(0, 240, 255, 0.06);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.question-points-field input {
    width: 100%;
    margin: 0;
    padding: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    color: var(--text-bright);
}

#question-editor-form {
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
}

.question-main-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 12px;
    align-items: start;
    margin-bottom: 18px;
}

#question-editor-form #q-text {
    width: 100%;
    min-height: 132px;
    margin: 0;
    resize: vertical;
    line-height: 1.5;
}

.question-main-tools {
    display: grid;
    gap: 10px;
}

.question-main-image-btn {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

#q-image-limit-hint {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.question-main-tools .question-image-preview {
    max-width: 100%;
}

.question-partial-credit {
    margin: 14px 0 20px;
    padding: 14px;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.04);
}

.question-partial-credit-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.question-partial-credit-toggle input {
    width: 19px;
    height: 19px;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.question-partial-credit-toggle > span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.question-partial-credit-toggle b {
    color: var(--text-bright);
}

.question-partial-credit-toggle small,
.question-partial-credit-fields > small {
    color: gray;
    line-height: 1.4;
}

.question-partial-credit-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 0 29px;
    max-width: 380px;
}

.question-partial-credit-fields[hidden] {
    display: none;
}

.question-partial-credit-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.question-partial-credit-fields label > span {
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.question-partial-credit-fields input {
    margin: 0;
}

.question-partial-credit-fields > small {
    grid-column: 1 / -1;
}

.question-option-image-btn,
.question-option-delete-btn {
    min-width: 100px;
    min-height: 44px;
    margin: 0;
    padding: 10px;
}

.question-option-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.question-type-note,
.question-order-preview {
    border: 1px dashed rgba(0, 240, 255, 0.35);
    border-radius: 6px;
    background: rgba(0, 240, 255, 0.05);
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.question-order-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.12);
}

.question-order-index {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    background: rgba(255, 190, 11, 0.12);
    border: 1px solid rgba(255, 190, 11, 0.45);
    color: var(--warning);
    font-weight: 900;
}

.question-order-actions {
    display: inline-flex;
    gap: 6px;
    flex: 0 0 auto;
}

.question-order-actions button {
    padding: 8px;
    min-width: 34px;
    box-shadow: none;
}

.question-order-preview ol {
    margin: 8px 0 0 20px;
    padding: 0;
}

.question-order-preview li {
    margin: 5px 0;
    color: var(--text-bright);
}

.question-image-preview {
    display: none;
    align-items: center;
    gap: 8px;
    min-width: 130px;
    max-width: 240px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
    color: var(--text);
    font-size: 12px;
    line-height: 1.25;
}

.question-image-preview.visible {
    display: inline-flex;
    cursor: zoom-in;
}

.question-image-preview.multi {
    align-items: stretch;
    flex-direction: column;
    max-width: 280px;
}

.question-image-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.question-image-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--danger);
    border-radius: 50%;
    background: rgba(255, 0, 85, 0.08);
    color: var(--danger);
    box-shadow: none;
    cursor: pointer;
    flex: 0 0 auto;
}

.question-image-remove:hover {
    background: rgba(255, 0, 85, 0.18);
}

.question-image-preview img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    flex: 0 0 auto;
}

.question-image-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.question-option-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.question-option-row .q-opt-text {
    min-width: 180px;
}

.teacher-test-card {
    display: grid;
    gap: 14px;
    background: var(--bg);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.teacher-test-main {
    min-width: 0;
}

.teacher-test-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.teacher-test-heading b {
    color: var(--text-bright);
    overflow-wrap: anywhere;
}

.teacher-test-card.is-linked {
    border-color: rgba(0, 255, 102, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 255, 102, 0.08), 0 0 14px rgba(0, 255, 102, 0.08);
    background: linear-gradient(135deg, rgba(0, 255, 102, 0.045), var(--bg));
}

.test-linked-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 0;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 102, 0.4);
    color: var(--success);
    background: rgba(0, 255, 102, 0.08);
    font-size: 11px;
    font-weight: 800;
}

.test-meta-editor {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(170px, 0.8fr) minmax(150px, 0.7fr) 46px;
    gap: 10px;
    align-items: start;
    margin-top: 8px;
    max-width: 860px;
}

.test-meta-field {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.test-meta-field > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.test-meta-editor input,
.test-meta-editor select {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 9px 10px;
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text-bright);
    border: 1px solid rgba(0, 240, 255, 0.34);
    border-radius: 6px;
    box-sizing: border-box;
}

.test-answer-reveal-field {
    display: grid;
    gap: 9px;
    align-items: center;
    min-width: 0;
    grid-column: 1 / 4;
    padding: 8px 9px;
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.035);
}

.test-answer-reveal-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.test-answer-reveal-field label {
    color: var(--text-bright);
    font-size: 12px;
    font-weight: 800;
}

.test-answer-reveal-info {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary);
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.58);
    font-size: 17px;
    font-weight: 900;
    box-shadow: none;
}

.test-answer-reveal-info:hover {
    background: rgba(0, 240, 255, 0.16);
    border-color: var(--primary);
}

.test-answer-reveal-info span {
    display: block;
    font-size: 17px;
    line-height: 1;
}

.teacher-test-actions {
    display: flex;
    gap: 10px;
}

.teacher-test-actions button {
    min-height: 42px;
    padding: 9px 14px;
    font-size: 12px;
}

.test-meta-editor .test-meta-save-btn {
    width: 46px;
    min-height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    grid-column: 4;
    grid-row: 1;
}

.test-meta-editor .test-meta-save-btn span {
    display: none;
}

.teacher-course-access-list {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.teacher-course-access-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}

.teacher-course-access-row.has-access {
    border-color: rgba(0, 255, 102, 0.38);
    background: linear-gradient(135deg, rgba(0, 255, 102, 0.05), var(--bg));
}

.teacher-course-access-row b,
.teacher-course-access-row span {
    display: block;
}

.teacher-course-access-row span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.teacher-course-access-row button {
    min-width: 150px;
    padding: 8px 12px;
    font-size: 12px;
}

.teacher-course-access-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 255, 102, 0.4);
    border-radius: 999px;
    color: var(--success) !important;
    background: rgba(0, 255, 102, 0.08);
    font-size: 12px !important;
    font-weight: 800;
}

.teacher-student-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.teacher-student-head {
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.teacher-student-identity {
    min-width: 0;
}

.teacher-student-identity b,
.teacher-student-identity span {
    display: block;
}

.teacher-student-identity b {
    color: var(--text-bright);
    overflow-wrap: anywhere;
}

.teacher-student-identity span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.teacher-student-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(0, 240, 255, 0.07);
    font-size: 11px;
    white-space: nowrap;
}

.teacher-student-status.status-blocked,
.teacher-student-status.status-rejected {
    border-color: rgba(255, 0, 85, 0.4);
    color: var(--danger);
    background: rgba(255, 0, 85, 0.07);
}

.teacher-student-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.teacher-student-actions button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.teacher-course-card {
    border-color: var(--border);
}
.teacher-course-card.state-public {
    border-color: rgba(0, 255, 102, 0.5);
}
.teacher-course-card.state-unlisted {
    border-color: rgba(0, 240, 255, 0.5);
}
.teacher-course-card.state-private {
    border-color: rgba(166, 120, 255, 0.5);
}
.teacher-course-card.state-draft {
    border-color: rgba(255, 190, 11, 0.42);
}
.teacher-course-state {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 12px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--input-bg);
}
.teacher-course-state > i {
    margin-top: 1px;
    color: var(--primary);
    font-size: 18px;
}
.teacher-course-state b,
.teacher-course-state span {
    display: block;
}
.teacher-course-state b {
    color: var(--text-bright);
    font-size: 12px;
}
.teacher-course-state span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}
.teacher-course-card.state-public .teacher-course-state > i { color: var(--success); }
.teacher-course-card.state-private .teacher-course-state > i { color: #a678ff; }
.teacher-course-card.state-draft .teacher-course-state > i { color: var(--warning); }

/* Responsive layout: phone <= 760px, tablet 761-1024px, desktop > 1024px. */
@media (max-width: 760px) {
    .teacher-course-access-row {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-course-access-row button {
        width: 100%;
    }

    .teacher-student-card {
        display: grid;
        gap: 14px;
    }

    .teacher-student-head {
        min-width: 0;
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .teacher-student-status {
        flex: 0 0 auto;
        align-self: flex-start;
    }

    .teacher-student-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .teacher-student-actions button {
        width: 100%;
        min-width: 0;
        padding: 10px 8px;
    }

    .teacher-student-block-btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 380px) {
    .teacher-student-actions {
        grid-template-columns: 1fr;
    }

    .teacher-student-block-btn {
        grid-column: 1;
    }
}

@media (max-width: 1024px) {
    .test-meta-editor {
        grid-template-columns: 1fr;
    }

    .test-meta-editor .test-meta-save-btn {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        gap: 8px;
    }

    .test-meta-editor .test-meta-save-btn span {
        display: inline;
    }

    .test-answer-reveal-field {
        grid-column: 1;
        padding: 9px;
    }

    .test-answer-reveal-info {
        width: 30px;
        min-width: 30px;
        height: 30px;
    }
}

@media (max-width: 760px) {
    .teacher-test-card {
        padding: 14px;
    }

    .teacher-test-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .test-meta-editor {
        width: 100%;
        gap: 12px;
        margin-top: 14px;
    }

    .test-meta-field > span {
        font-size: 12px;
    }

    .test-meta-editor input,
    .test-meta-editor select {
        min-height: 46px;
        font-size: 14px;
    }

    .test-answer-reveal-field {
        width: 100%;
        padding: 11px;
        box-sizing: border-box;
        border-color: rgba(0, 240, 255, 0.42);
    }

    .test-answer-reveal-heading label {
        font-size: 13px;
        line-height: 1.3;
    }

    .teacher-test-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 52px;
        width: 100%;
    }

    .teacher-test-actions button {
        width: 100%;
        min-width: 0;
        min-height: 46px;
    }
}

.table-fill-editor {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(0, 240, 255, 0.22);
    border-radius: 8px;
    background: rgba(8, 14, 18, 0.78);
}

.table-fill-editor label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 13px;
}

.table-fill-editor textarea {
    min-height: 92px;
    margin: 0;
    resize: vertical;
    font-family: inherit;
}

.question-editor-inline-anchor {
    margin: 14px 0;
}

.btn-secondary,
.mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

.btn-secondary {
    min-height: 42px;
    padding: 10px 14px;
}

.mini-btn {
    width: 34px;
    height: 34px;
    padding: 0;
}

.mini-btn.danger {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 0, 85, 0.06);
}

.table-fill-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.table-fill-size-control {
    display: inline-flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    gap: 8px !important;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}

.table-fill-size-control span {
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
}

.table-fill-size-control input {
    width: 72px;
    margin: 0;
    padding: 8px;
}

.table-fill-limit-note {
    color: gray;
    font-size: 12px;
    font-weight: 700;
}

.table-fill-scroll {
    width: 100%;
    overflow-x: auto;
    padding: 2px 2px 8px;
}

.table-fill-builder {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(5, 8, 12, 0.82);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.table-fill-builder th,
.table-fill-builder td {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    vertical-align: top;
}

.table-fill-builder th {
    background: rgba(0, 240, 255, 0.055);
}

.table-fill-builder th:last-child,
.table-fill-builder td:last-child {
    width: 52px;
    border-right: 0;
}

.table-fill-builder tr:last-child td {
    border-bottom: 0;
}

.table-fill-col-input,
.table-fill-cell-text,
.table-fill-blank-answer,
.table-fill-item-row input {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    min-height: 40px;
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 6px;
    background: rgba(6, 9, 14, 0.95);
    color: var(--text-bright);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    box-shadow: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.table-fill-col-input:focus,
.table-fill-cell-text:focus,
.table-fill-blank-key:focus,
.table-fill-blank-answer:focus,
.table-fill-item-row input:focus {
    border-color: var(--primary);
    background: rgba(8, 14, 20, 1);
}

.table-fill-col-input {
    font-weight: 800;
    background: rgba(13, 23, 28, 0.95);
}

.table-fill-builder th .mini-btn {
    margin: 8px auto 0;
}

.table-fill-cell {
    min-width: 210px;
}

.table-fill-cell.is-blank {
    background: linear-gradient(180deg, rgba(255, 196, 0, 0.08), rgba(255, 196, 0, 0.035));
}

.table-fill-cell-text:disabled {
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 196, 0, 0.18);
}

.table-fill-blank-toggle {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    gap: 8px !important;
    margin-top: 8px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.2;
}

.table-fill-blank-toggle input {
    width: auto;
    margin: 0;
    accent-color: var(--primary);
}

.table-fill-blank-controls {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 196, 0, 0.18);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
}

.table-fill-blank-controls span {
    color: var(--text);
    font-size: 12px;
}

.table-fill-blank-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid rgba(255, 196, 0, 0.34);
    border-radius: 999px;
    color: var(--warning) !important;
    background: rgba(255, 196, 0, 0.08);
    font-weight: 800;
}

.table-fill-row-actions {
    text-align: center;
    vertical-align: middle !important;
}

.table-fill-items-editor {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(5, 8, 12, 0.58);
}

.table-fill-items-title {
    color: var(--text-bright);
    font-weight: 800;
    margin-bottom: 2px;
}

.table-fill-item-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(0, 240, 255, 0.11);
    border-radius: 8px;
    background: rgba(11, 15, 22, 0.76);
}

.table-fill-item-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 6px;
    border: 1px solid rgba(0, 240, 255, 0.22);
    color: var(--primary);
    background: rgba(0, 240, 255, 0.07);
    font-weight: 900;
}

.table-fill-task-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    margin: 12px 0 16px;
    background: var(--input-bg);
    color: var(--text-bright);
}

.table-fill-task-table th,
.table-fill-task-table td {
    border: 1px solid var(--border);
    padding: 10px;
    vertical-align: middle;
    text-align: left;
    max-width: 340px;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.table-fill-task-table th {
    background: rgba(0, 240, 255, 0.08);
    font-weight: 800;
}

.table-fill-select {
    width: 100%;
    min-width: 180px;
    max-width: 100%;
    margin: 0;
    padding: 11px 34px 11px 12px;
    background: var(--bg);
    color: var(--text-bright);
    border-color: var(--primary);
    border-radius: 6px;
    white-space: normal;
    text-overflow: ellipsis;
}

.table-fill-task-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 12px 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(5, 8, 12, 0.55);
}

.table-fill-task-wrap .table-fill-task-table {
    margin: 0;
}

.table-fill-items {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
    padding-left: 0;
    list-style: none;
    color: var(--text-bright);
}

.table-fill-items li {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(0, 240, 255, 0.045);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.table-fill-items li span {
    margin-left: 0;
}

.question-clickable-image {
    cursor: zoom-in;
}

.text-gap-editor {
    display: grid;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(0, 240, 255, 0.24);
    border-radius: 10px;
    background: rgba(8, 14, 18, 0.78);
}

.text-gap-editor > label,
.text-gap-editor-field {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.text-gap-editor select,
.text-gap-editor input {
    margin: 0;
}

.text-gap-insert-help {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.text-gap-visual-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.text-gap-visual-editor {
    min-height: 150px;
    padding: 14px;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 8px;
    background: rgba(6, 9, 14, 0.95);
    color: var(--text-bright);
    font-size: 15px;
    font-weight: 500;
    line-height: 2.2;
    outline: none;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.text-gap-visual-editor:focus {
    border-color: var(--primary);
    background: rgba(8, 14, 20, 1);
}

.text-gap-visual-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
}

.text-gap-editor-token {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    margin: 2px 4px;
    padding: 1px 5px 1px 10px;
    border: 1px solid var(--warning);
    border-radius: 999px;
    color: var(--warning);
    background: rgba(255, 196, 0, 0.1);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    vertical-align: middle;
    user-select: none;
}

.text-gap-editor-token button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 196, 0, 0.12);
    color: var(--warning);
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
}

.text-gap-preview,
.text-gap-admin-preview,
.text-gap-student-passage {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(4, 8, 12, 0.72);
    color: var(--text-bright);
    line-height: 2;
    overflow-wrap: anywhere;
}

.text-gap-preview > b {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
}

.text-gap-preview-blank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 30px;
    margin: 0 4px;
    padding: 2px 10px;
    border: 1px dashed var(--warning);
    border-radius: 7px;
    color: var(--warning);
    background: rgba(255, 196, 0, 0.08);
    font-weight: 900;
    line-height: 1.2;
}

.text-gap-section-title {
    margin-bottom: 9px;
    color: var(--text-bright);
    font-weight: 900;
}

.text-gap-items-editor,
#text-gap-answer-list {
    display: grid;
    gap: 10px;
}

.text-gap-item-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: center;
}

.text-gap-item-input,
.text-gap-correct-input,
.text-gap-correct-choice {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid rgba(0, 240, 255, 0.24);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text-bright);
    font: inherit;
    font-size: 15px;
    outline: none;
    box-shadow: none;
    color-scheme: dark;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.text-gap-item-input:focus,
.text-gap-correct-input:focus,
.text-gap-correct-choice:focus {
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: var(--shadow-glow);
}

.text-gap-item-input::placeholder,
.text-gap-correct-input::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

body.light-mode .text-gap-item-input,
body.light-mode .text-gap-correct-input,
body.light-mode .text-gap-correct-choice {
    color-scheme: light;
}

.text-gap-item-number,
.text-gap-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 7px;
    color: var(--primary);
    background: rgba(0, 240, 255, 0.07);
    font-weight: 900;
}

.text-gap-answer-row {
    display: grid !important;
    grid-template-columns: 46px minmax(115px, auto) minmax(0, 1fr);
    gap: 10px !important;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(0, 240, 255, 0.13);
    border-radius: 9px;
    background: rgba(5, 8, 12, 0.55);
}

.text-gap-answer-row > span:nth-child(2) {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.text-gap-empty {
    padding: 14px;
    border: 1px dashed var(--warning);
    border-radius: 8px;
    color: var(--warning);
    background: rgba(255, 196, 0, 0.05);
}

.text-gap-admin-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.text-gap-admin-answers span {
    padding: 5px 9px;
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 999px;
    color: var(--text);
    background: rgba(0, 240, 255, 0.05);
    font-size: 12px;
    line-height: 1.3;
}

.text-gap-student-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px dashed rgba(0, 240, 255, 0.35);
    border-radius: 7px;
    color: var(--text);
    background: rgba(0, 240, 255, 0.05);
    font-size: 13px;
}

.text-gap-student-control {
    display: inline-block;
    width: auto;
    min-width: 130px;
    max-width: min(260px, 100%);
    min-height: 38px;
    margin: 3px 5px;
    padding: 7px 10px;
    border: 1px solid var(--primary);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text-bright);
    font: inherit;
    line-height: 1.2;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .text-gap-editor {
        padding: 12px;
    }

    .text-gap-answer-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .text-gap-answer-row > span:nth-child(2) {
        grid-column: 2;
    }

    .text-gap-answer-row input,
    .text-gap-answer-row select {
        grid-column: 1 / -1;
        width: 100%;
    }

    .text-gap-student-passage {
        padding: 13px;
        line-height: 2.35;
    }

    .text-gap-student-control {
        min-width: 105px;
        max-width: 100%;
        font-size: 15px;
    }
}

#lesson-viewer {
    max-width: min(1760px, calc(100vw - 48px));
}

#lesson-viewer .lesson-viewer-grid {
    flex-wrap: nowrap !important;
}

#lesson-viewer .lesson-nav-panel {
    flex: 0 0 320px !important;
}

#lesson-viewer .lesson-main-panel {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

#single-lesson-container .card {
    width: 100%;
    box-sizing: border-box;
}
button.btn-solid-success:hover {
    background: linear-gradient(135deg, #00ff66, #00f0ff);
    color: #06120a;
    text-shadow: none;
}
button.btn-danger { background: rgba(255, 0, 85, 0.05); color: var(--danger); border-color: var(--danger); }
button.btn-danger:hover { background: rgba(255, 0, 85, 0.15); text-shadow: none; }
.test-actions { display: flex; gap: 12px; margin-top: 10px; }
.test-actions button { flex: 1 1 0; min-height: 54px; font-size: 16px; }
.lesson-complete-btn { min-height: 54px; }

/* === ДАШБОРДЫ === */
.dashboard { display: none; max-width: 1000px; margin: 0 auto; }
.active-dashboard { display: block; animation: fadeIn 0.4s ease; }
#teacher-dashboard { max-width: 1500px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* === КАРТОЧКИ === */
.card { 
    background: var(--card-bg); border: 1px solid var(--border); 
    border-radius: 8px; padding: 20px; margin-bottom: 20px; 
    position: relative; transition: all 0.3s ease; 
}
.card:hover { 
    border-color: rgba(0, 240, 255, 0.3); 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 240, 255, 0.05); 
}
.course-cover { 
    width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 6px; 
    margin-bottom: 15px; background: var(--border); 
}
.public-course-hero {
    display: grid;
    grid-template-columns: minmax(240px, 340px) 1fr;
    gap: 28px;
    align-items: start;
}
.public-course-info {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.catalog-section-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-bright);
    font-size: 20px;
    font-weight: 800;
    margin: 8px 0 0;
}
.catalog-section-title i { color: var(--primary); }
.trainer-catalog-row {
    grid-column: 1 / -1;
    margin: 0 0 8px;
}
.trainer-catalog-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 24px;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: rgba(0, 240, 255, 0.045);
    border-color: rgba(0, 240, 255, 0.32);
    color: var(--text-bright);
    text-align: left;
}
.trainer-catalog-toggle span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
}
.trainer-catalog-toggle i {
    color: var(--primary);
}
.trainer-catalog-toggle small {
    color: gray;
    font-weight: 600;
}
.trainer-catalog-details {
    margin-top: 10px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.trainer-price-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}
.trainer-price-row div {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
}
.trainer-price-row b {
    display: block;
    color: var(--text-bright);
}
.trainer-price-row span {
    color: var(--success);
    font-weight: 900;
}

/* === ФОРМЫ === */
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], textarea, select {
    width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 4px; 
    margin-bottom: 15px; box-sizing: border-box; font-size: 14px; 
    background: var(--input-bg); color: var(--text-bright); font-family: inherit; transition: 0.3s; 
}
input:focus, textarea:focus, select:focus { 
    outline: none; border-color: var(--primary); box-shadow: var(--shadow-glow); 
}

#question-editor-form input,
#question-editor-form textarea,
#question-editor-form select {
    border-color: rgba(80, 230, 255, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(80, 230, 255, 0.12);
}

#question-editor-form input:focus,
#question-editor-form textarea:focus,
#question-editor-form select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 1px rgba(80, 230, 255, 0.32), 0 0 14px rgba(80, 230, 255, 0.16);
}

body.light-mode #question-editor-form input,
body.light-mode #question-editor-form textarea,
body.light-mode #question-editor-form select {
    border-color: rgba(28, 156, 190, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(28, 156, 190, 0.1);
}
input[type="datetime-local"] {
    color-scheme: dark;
    min-height: 44px;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(135deg);
    opacity: 0.85;
    cursor: pointer;
}
body.light-mode input[type="datetime-local"] {
    color-scheme: light;
}
body.light-mode input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: none;
}
.checkbox-container { 
    display: flex; align-items: center; gap: 12px; margin-bottom: 15px; cursor: pointer; 
    background: var(--card-bg); padding: 12px 15px; border-radius: 6px; border: 1px solid var(--border); 
    line-height: 1.35;
    min-height: 44px;
}
.checkbox-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
    display: grid;
    place-content: center;
    flex: 0 0 18px;
    cursor: pointer;
}
.checkbox-container input[type="checkbox"]::before {
    content: "";
    width: 9px;
    height: 9px;
    transform: scale(0);
    transition: transform 0.12s ease-in-out;
    clip-path: polygon(14% 44%, 0 65%, 43% 100%, 100% 18%, 80% 0%, 38% 62%);
    background: var(--bg);
}
.checkbox-container input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}
.checkbox-container input[type="checkbox"]:checked::before {
    transform: scale(1);
}
.checkbox-container span {
    min-width: 0;
}

/* === ТАБЫ === */
.tab-menu { 
    display: flex; gap: 10px; margin-bottom: 25px; 
    border-bottom: 1px solid var(--border); overflow-x: auto; padding-bottom: 5px; 
    scrollbar-width: none;
}
.tab-menu::-webkit-scrollbar { display: none; }
.tab-btn { 
    background: none; color: gray; border: none; border-bottom: 2px solid transparent; 
    border-radius: 0; padding: 10px; font-size: 15px; box-shadow: none; font-weight: normal; 
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: bold; text-shadow: none; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.teacher-tab-menu {
    overflow: visible;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 6px;
}
.teacher-more-menu {
    position: relative;
    display: inline-flex;
}
.teacher-more-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    z-index: 500;
}
.teacher-more-menu.open .teacher-more-dropdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.teacher-more-dropdown .tab-btn {
    width: 100%;
    justify-content: flex-start;
    border-bottom: 0;
    border-radius: 6px;
    padding: 10px 12px;
}
.teacher-more-dropdown .tab-btn.active,
.teacher-more-dropdown .tab-btn:hover {
    background: rgba(0, 240, 255, 0.08);
    border-bottom: 0;
}

.teacher-more-section-title {
    padding: 10px 12px 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.teacher-more-section-title:not(:first-child) {
    margin-top: 5px;
    border-top: 1px solid var(--border);
}

.teacher-workspace {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.teacher-sidebar {
    position: sticky;
    top: 20px;
    background: rgba(20, 22, 28, 0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}
.teacher-sidebar-title {
    color: var(--text-bright);
    font-weight: 800;
    padding: 8px 10px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.teacher-nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}
.teacher-nav-section > span {
    color: gray;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 10px 4px;
}
.teacher-sidebar .tab-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 11px 10px;
    color: var(--text);
    text-align: left;
}
.teacher-sidebar .tab-btn.active {
    background: rgba(0, 240, 255, 0.09);
    border-color: rgba(0, 240, 255, 0.35);
    color: var(--primary);
}
body.light-mode .teacher-sidebar {
    background: rgba(255, 255, 255, 0.94);
    border-color: #d9e1ec;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}
body.light-mode .teacher-sidebar .tab-btn {
    color: #526072;
}
body.light-mode .teacher-sidebar .tab-btn.active {
    background: rgba(0, 119, 204, 0.09);
    border-color: rgba(0, 119, 204, 0.26);
    color: var(--primary);
}
body.light-mode .teacher-nav-section > span {
    color: #7b8493;
}
.teacher-main {
    min-width: 0;
}
.teacher-mobile-nav {
    display: none;
}
.student-mobile-nav {
    display: none;
}
.student-more-menu {
    display: none;
}
@media (max-width: 1024px) {
    #student-dashboard > .student-more-menu .teacher-more-dropdown {
        position: fixed;
        right: 12px;
        left: 12px;
        bottom: 86px;
        top: auto;
        min-width: 0;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }
}
.teacher-workspace > .teacher-more-menu {
    display: none;
}
.nav-badge,
.profile-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 999px;
    margin-left: auto;
}
.achievements-module {
    background: var(--card-bg);
    border: 1px solid rgba(255, 190, 11, 0.35);
    border-radius: 8px;
    padding: 0;
    margin-bottom: 20px;
}
.achievements-module summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    color: var(--text-bright);
    font-weight: 800;
    list-style: none;
}
.achievements-module summary::-webkit-details-marker {
    display: none;
}
.achievements-module summary span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.achievements-module summary i {
    color: var(--warning);
    font-size: 22px;
}
.achievements-module summary small {
    color: gray;
    font-weight: 600;
}
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 0 18px 18px;
}

.student-stats-panel {
    background: var(--card-bg);
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.student-stats-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.student-stats-head h3 {
    margin: 0 0 6px;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 8px;
}
.student-stats-head h3 i {
    color: var(--primary);
}
.student-stats-head p {
    margin: 0;
    color: gray;
    font-size: 13px;
}
.student-stats-score {
    min-width: 74px;
    text-align: center;
    color: var(--success);
    font-size: 28px;
    font-weight: 900;
}
.student-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.student-stats-grid div {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 10px;
}
.student-stats-grid b {
    display: block;
    color: var(--text-bright);
    font-size: 20px;
    margin-bottom: 4px;
}
.student-stats-grid span,
.student-course-row span,
.learning-muted,
.learning-list-item small {
    color: gray;
    font-size: 12px;
}
.student-course-progress {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}
.student-stats-details {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,0.015);
    overflow: hidden;
}
.student-stats-details > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--text-bright);
    font-weight: 800;
}
.student-stats-details > summary::-webkit-details-marker { display: none; }
.student-stats-details > summary small { color: var(--primary); font-weight: 700; }
.student-stats-details[open] > summary { border-bottom: 1px solid var(--border); }
.student-stats-details > .student-course-progress,
.student-stats-details > .student-learning-columns { margin: 16px; }
.student-course-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    background: rgba(0, 240, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}
.student-course-row b {
    display: block;
    color: var(--text-bright);
    margin-bottom: 4px;
}
.student-course-row strong {
    color: var(--primary);
}
.student-course-row .progress-bar {
    grid-column: 1 / -1;
    height: 8px;
}
.student-course-row .progress-bar div,
.student-stats-panel .progress-bar div {
    background: var(--primary);
    height: 100%;
}
.student-learning-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.student-learning-columns h4 {
    margin: 0 0 10px;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 8px;
}
.student-learning-columns h4 i {
    color: var(--primary);
}
.learning-list-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    margin-bottom: 8px;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
}
.learning-list-item.danger {
    border-color: rgba(255, 0, 85, 0.38);
}
.learning-list-item.success {
    border-color: rgba(91, 255, 126, 0.34);
}
.learning-list-item b {
    display: block;
    color: var(--text-bright);
    margin-bottom: 3px;
}
.learning-list-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    color: gray;
    font-size: 12px;
    white-space: nowrap;
}
.learning-item-comment {
    margin-top: 6px;
    color: var(--text);
    font-size: 12px;
}
.learning-empty-state {
    border: 1px dashed rgba(0, 240, 255, 0.28);
    border-radius: 8px;
    padding: 14px;
    background: rgba(0, 240, 255, 0.035);
}
.learning-empty-state b {
    display: block;
    color: var(--text-bright);
    margin-bottom: 6px;
}
.learning-empty-state span {
    color: gray;
    font-size: 13px;
}

/* === ЛИЧНОЕ ДЕЛО УЧЕНИКА === */
.profile-section,
.student-profile-hero {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 18px;
}
.profile-section-heading,
.student-profile-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.profile-section-heading h3,
.student-profile-hero h2 {
    margin: 0 0 6px;
    color: var(--text-bright);
}
.profile-section-heading h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 19px;
}
.profile-section-heading h3 i {
    color: var(--primary);
}
.profile-section-heading p,
.student-profile-hero-head p {
    margin: 0;
    color: gray;
    font-size: 13px;
    line-height: 1.45;
}
.profile-section-count {
    min-width: 32px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 190, 11, 0.45);
    border-radius: 999px;
    color: var(--warning);
    font-weight: 800;
    text-align: center;
}
.student-profile-hero {
    border-color: rgba(0, 240, 255, 0.35);
    background:
        linear-gradient(135deg, rgba(0, 240, 255, 0.08), transparent 48%),
        var(--card-bg);
}
.student-profile-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.student-profile-last-seen {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: gray;
    font-size: 12px;
}
.student-profile-main-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.student-profile-metric {
    min-height: 84px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
}
.student-profile-metric b {
    display: block;
    margin-bottom: 7px;
    color: var(--text-bright);
    font-size: 27px;
    line-height: 1;
}
.student-profile-metric span {
    color: gray;
    font-size: 12px;
}
.student-profile-metric.primary { border-color: rgba(0, 240, 255, 0.4); }
.student-profile-metric.primary b { color: var(--primary); }
.student-profile-metric.success { border-color: rgba(0, 255, 102, 0.35); }
.student-profile-metric.success b { color: var(--success); }
.student-profile-metric.warning { border-color: rgba(255, 190, 11, 0.35); }
.student-profile-metric.warning b { color: var(--warning); }
.student-profile-activity {
    padding: 13px 14px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.12);
}
.student-profile-activity > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-bright);
    font-size: 13px;
}
.student-profile-activity > div:first-child span {
    color: gray;
    font-size: 12px;
}
.student-activity-sparkline {
    display: grid;
    grid-template-columns: repeat(14, minmax(5px, 1fr));
    align-items: end;
    gap: 5px;
    height: 62px;
    margin-top: 8px;
}
.student-activity-sparkline > div {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 100%;
}
.student-activity-sparkline i {
    width: 100%;
    min-height: 3px;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, var(--success), var(--primary));
    opacity: 0.75;
}
.student-activity-sparkline strong {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--primary);
    font-size: 10px;
}
.student-attention-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.student-attention-list .learning-list-item {
    margin: 0;
}
.student-course-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.student-course-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    width: 100%;
    padding: 15px;
    text-align: left;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
}
.student-course-card:hover {
    border-color: rgba(0, 240, 255, 0.5);
    transform: translateY(-1px);
}
.student-course-card-title {
    color: var(--text-bright);
    font-weight: 800;
}
.student-course-card-meta {
    grid-column: 1 / -1;
    color: gray;
    font-size: 12px;
}
.student-course-card-progress {
    grid-column: 1;
    display: block;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg);
}
.student-course-card-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--success));
}
.student-course-card strong {
    grid-column: 2;
    grid-row: 1;
    color: var(--primary);
}
.student-learning-more,
.student-profile-tools {
    margin-top: 14px;
    border-top: 1px solid var(--border);
}
.student-learning-more > summary,
.student-profile-tools > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 2px 0;
    color: var(--text-bright);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}
.student-learning-more > summary::-webkit-details-marker,
.student-profile-tools > summary::-webkit-details-marker {
    display: none;
}
.student-learning-more > summary span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.student-learning-more > summary small {
    color: var(--primary);
}
.student-learning-more .student-learning-columns {
    margin-top: 16px;
}
.achievements-module {
    padding: 20px;
}
.achievements-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 0;
}
.achievement-card {
    display: flex;
    flex-direction: column;
    min-height: 138px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
}
.achievement-card.unlocked { border-color: rgba(0, 255, 102, 0.4); }
.achievement-card.max { border-color: rgba(255, 190, 11, 0.5); }
.achievement-card.locked { opacity: 0.68; }
.achievement-card-head,
.achievement-card-progress {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.achievement-card-head h4 {
    margin: 0;
    color: var(--text-bright);
    font-size: 15px;
}
.achievement-card-head > span {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
}
.achievement-card p {
    flex: 1;
    margin: 9px 0 12px;
    color: gray;
    font-size: 12px;
    line-height: 1.4;
}
.achievement-card-progress {
    margin-bottom: 6px;
    color: gray;
    font-size: 11px;
}
.achievement-card-progress strong { color: var(--primary); }
.achievement-card .progress-bar { height: 6px; }
.achievement-card .progress-bar div {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
}
.student-profile-lower-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.student-level-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.student-level-label {
    display: block;
    margin-bottom: 4px;
    color: gray;
    font-size: 11px;
}
.student-level-main strong {
    color: var(--primary);
    font-size: 22px;
}
.student-level-xp {
    color: gray;
    font-size: 12px;
}
.student-level-progress { height: 8px; }
.student-level-progress > div {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
}
.student-referral-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 8px;
}
.student-referral-row input,
.student-referral-row button {
    margin: 0;
}
.student-referral-row button {
    width: 46px;
    padding: 0;
}
.student-profile-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
}
.student-profile-fields label > span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-bright);
    font-size: 12px;
    font-weight: 700;
}
.student-profile-fields input {
    margin: 0;
}
.student-profile-fields small {
    display: block;
    min-height: 16px;
    margin-top: 5px;
    color: gray;
    font-size: 10px;
}
.student-profile-save {
    min-height: 48px;
    margin-bottom: 21px;
    white-space: nowrap;
}
.student-notification-settings {
    margin-top: 18px;
}
.student-profile-tools > summary {
    justify-content: flex-start;
    color: gray;
    font-size: 13px;
}
.student-profile-tools > button {
    margin-top: 12px;
    box-shadow: none;
}

@media (max-width: 760px) {
    .profile-section,
    .student-profile-hero {
        padding: 15px;
        margin-bottom: 14px;
    }
    .student-profile-hero-head,
    .profile-section-heading {
        flex-direction: column;
        gap: 9px;
    }
    .student-profile-last-seen {
        align-self: flex-start;
    }
    .student-profile-main-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }
    .student-profile-metric {
        min-height: 76px;
        padding: 11px 8px;
    }
    .student-profile-metric b {
        font-size: 20px;
    }
    .student-profile-metric span {
        font-size: 10px;
        line-height: 1.25;
    }
    .student-profile-activity > div:first-child {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
    .student-activity-sparkline {
        gap: 3px;
        height: 54px;
    }
    .student-attention-list,
    .student-profile-lower-grid,
    .student-learning-columns,
    .student-profile-fields {
        grid-template-columns: 1fr;
    }
    .student-course-card-grid,
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    .student-profile-save {
        width: 100%;
        margin: 0;
    }
    .learning-list-item {
        flex-direction: column;
    }
    .learning-list-meta {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        white-space: normal;
    }
}

/* === АВТОРИЗАЦИЯ === */
.auth-box { 
    position: relative; max-width: 400px; margin: 50px auto; 
    background: var(--card-bg); padding: 35px; border-radius: 12px; 
    border: 1px solid var(--border); text-align: center; 
}
.tg-login-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    color: #40bfff; text-decoration: none; font-weight: 800;
    font-size: 13px; margin-top: 10px; transition: 0.2s; cursor: pointer;
    width: auto; box-sizing: border-box;
    background: transparent; border: 0; padding: 0;
}
.login-captcha-wrap {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid rgba(255, 190, 11, 0.35);
    border-radius: 10px;
    background: rgba(255, 190, 11, 0.06);
    text-align: left;
}
.login-captcha-wrap p {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 10px;
    color: var(--warning);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}
.login-captcha-question {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 240, 255, 0.32);
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.06);
    color: var(--text-bright);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.03em;
}
.login-captcha-row {
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 8px;
}
.login-captcha-row input {
    margin: 0;
}
.login-captcha-row button {
    min-width: 0;
    padding: 0;
    border-color: rgba(0, 240, 255, 0.45);
}
.social-login-block {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin: 22px 0 4px;
}
.social-login-block > span {
    color: gray;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.social-login-stack {
    width: min(230px, 100%);
    display: grid;
    gap: 8px;
    justify-items: center;
}
.social-login-row {
    width: 100%;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 800;
    text-shadow: none;
}
.social-login-row:hover,
.social-login-row:focus-visible {
    transform: translateY(-1px);
    text-shadow: none;
}
.social-login-yandex {
    color: var(--text-bright);
    background: rgba(252, 63, 29, 0.1);
    border-color: rgba(252, 63, 29, 0.55);
}
.social-login-vk {
    color: var(--text-bright);
    background: rgba(47, 125, 246, 0.1);
    border-color: rgba(47, 125, 246, 0.55);
}
.social-login-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}
.social-login-yandex .social-login-mark {
    background: #fc3f1d;
}
.social-login-vk .social-login-mark {
    background: #2f7df6;
}
.telegram-widget-box,
.telegram-link-widget {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.telegram-widget-box iframe {
    border-radius: 999px;
}
.telegram-widget-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(64, 191, 255, 0.5);
    border-radius: 50%;
    color: #40bfff;
    font-size: 0;
    background: rgba(0, 136, 204, 0.1);
}
.telegram-widget-loading::before {
    content: "\ebdc";
    font-family: boxicons;
    font-size: 22px;
}

/* === СТАТИСТИКА / БЕЙДЖИ === */
.stats-badge { 
    background: transparent; border: 1px solid var(--primary); color: var(--primary); 
    padding: 8px 15px; border-radius: 4px; font-weight: bold; margin-bottom: 20px; 
    display: inline-flex; align-items: center; gap: 8px; font-size: 14px; 
    text-shadow: none; box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}
.price-tag { font-weight: bold; color: var(--success); font-size: 20px; margin-top: 0; margin-bottom: 15px; }

.classroom-start-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
    gap: 24px;
    align-items: start;
}
.classroom-template-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 16px;
}
.classroom-mode-tabs {
    display: none;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.classroom-mode-tabs button {
    flex: 1;
    min-width: 150px;
    padding: 12px;
}
.classroom-mode-tabs button.active {
    color: #000;
    background: var(--primary);
    border-color: var(--primary);
}
.classroom-panel-section {
    display: none;
}
.classroom-panel-section.active {
    display: block;
}
.classroom-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1200;
    max-width: none !important;
    padding: 0 !important;
    overflow: hidden;
    background: #080b10;
}
.classroom-fullscreen.active-dashboard {
    display: block;
}
.classroom-topbar,
.classroom-floating-toolbar,
.classroom-toolbar-toggle,
.classroom-side,
.classroom-hint {
    position: absolute;
    z-index: 2;
    background: rgba(14, 18, 28, 0.88);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 45px rgba(0,0,0,0.35);
}
.classroom-topbar {
    top: 18px;
    left: 18px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 8px;
}
.classroom-topbar h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-bright);
}
.classroom-topbar span {
    display: block;
    color: gray;
    font-size: 12px;
}
.classroom-floating-toolbar {
    left: 18px;
    right: 18px;
    top: 92px;
    transform: none;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    max-width: none;
    padding: 10px;
    border-radius: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.classroom-floating-toolbar.is-collapsed {
    display: none;
}
.classroom-toolbar-toggle {
    position: absolute;
    z-index: 3;
    right: 18px;
    top: 92px;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 12px;
    display: none;
    place-items: center;
}
.classroom-toolbar-toggle.is-visible {
    display: grid;
}
.classroom-floating-toolbar button,
.classroom-toolbar-toggle,
.classroom-topbar button {
    padding: 10px 12px;
    font-size: 13px;
    flex: 0 0 auto;
}
.classroom-brush-group,
.classroom-fill-group {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0,0,0,0.16);
    color: var(--primary);
}
.classroom-brush-group i,
.classroom-fill-group i {
    font-size: 18px;
}
.classroom-floating-toolbar input[type="color"] {
    width: 42px;
    height: 42px;
    padding: 4px;
    border-radius: 8px;
    margin: 0;
}
.classroom-floating-toolbar input[type="range"] {
    width: 110px;
    margin: 0;
}
.classroom-toolbar-collapse-btn {
    margin-left: auto;
}
.classroom-floating-toolbar select {
    width: auto;
    min-width: 118px;
    height: 42px;
    margin: 0;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 8px;
}
.classroom-zoom-group {
    display: inline-flex;
    gap: 6px;
    flex: 0 0 auto;
}
.classroom-floating-toolbar .active {
    color: #000;
    background: var(--primary);
    border-color: var(--primary);
}
#classroom-canvas {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    background: #f7f9fb;
    border: 0;
    border-radius: 0;
    touch-action: none;
    cursor: crosshair;
}
.classroom-side {
    top: 170px;
    bottom: 24px;
    width: 280px;
    overflow-y: auto;
    padding: 16px;
    border-radius: 10px;
}
.classroom-side-close {
    position: sticky;
    top: 0;
    float: right;
    z-index: 2;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0 0 6px 8px;
    display: inline-grid;
    place-items: center;
    background: rgba(0, 240, 255, 0.1);
}
.classroom-side.left {
    left: 18px;
}
.classroom-side.right {
    right: 18px;
}
.classroom-side.is-hidden {
    display: none;
}
.classroom-panel-reopen {
    position: absolute;
    z-index: 4;
    top: 170px;
    transform: none;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    background: rgba(14, 18, 28, 0.94);
    color: var(--primary);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.18);
    touch-action: none;
    cursor: grab;
    user-select: none;
}
.classroom-panel-reopen.is-dragging {
    cursor: grabbing;
    opacity: 0.86;
}
.classroom-panel-reopen.left {
    left: 18px;
}
.classroom-panel-reopen.right {
    right: 18px;
}
.classroom-side h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--text-bright);
}
.classroom-panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 6px;
    align-items: center;
    margin: 0 0 10px;
}
.classroom-collapse-title {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    min-height: 32px;
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--text-bright);
    box-shadow: none;
}
.classroom-panel-expand {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.08);
}
.classroom-panel-expand i,
.classroom-side-close i,
.classroom-collapse-title i {
    font-size: 16px;
}
.classroom-collapse-title span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
}
.classroom-collapse-title.is-collapsed i:last-child {
    transform: rotate(180deg);
}
.classroom-panel-block {
    margin-bottom: 14px;
}
.classroom-panel-block.is-collapsed {
    display: none;
}
.classroom-object-editor,
.classroom-note-palette {
    position: absolute;
    z-index: 5;
    width: 280px;
    padding: 12px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: rgba(14, 18, 28, 0.95);
    color: var(--text-bright);
    box-shadow: 0 20px 50px rgba(0,0,0,0.42);
    backdrop-filter: blur(12px);
}
.classroom-note-palette {
    left: 50%;
    top: 150px;
    transform: translateX(-50%);
}
.classroom-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    cursor: move;
    user-select: none;
    touch-action: none;
}
.classroom-editor-head button {
    padding: 6px 8px;
    cursor: pointer;
}
.classroom-object-editor textarea {
    min-height: 88px;
    resize: vertical;
    margin: 0 0 10px;
}
.classroom-size-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px 0 10px;
}
.classroom-size-grid label {
    display: grid;
    gap: 4px;
    margin: 0;
    color: gray;
    font-size: 11px;
}
.classroom-size-grid input[type="range"] {
    width: 100%;
    margin: 0;
}
.classroom-object-editor label {
    margin: 8px 0 5px;
}
.classroom-editor-field {
    display: grid;
    gap: 6px;
    margin: 10px 0;
}
.classroom-editor-field label {
    margin: 0;
}
.classroom-editor-field input[type="range"] {
    width: 100%;
    margin: 0;
}
.classroom-editor-color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.classroom-editor-color-row input[type="color"] {
    width: 54px;
    height: 42px;
    margin: 0;
    padding: 4px;
}
.classroom-editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.classroom-editor-actions button {
    padding: 8px 10px;
}
.classroom-editor-actions button.active {
    color: #000;
    background: var(--primary);
    border-color: var(--primary);
}
.classroom-swatch-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 8px 0 12px;
}
.classroom-swatch-grid button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.35);
}
.classroom-round-choice {
    width: 100%;
    padding: 10px;
}
body.light-mode .classroom-object-editor,
body.light-mode .classroom-note-palette,
body.light-mode .classroom-floating-toolbar,
body.light-mode .classroom-brush-group,
body.light-mode .classroom-fill-group,
body.light-mode .classroom-toolbar-toggle,
body.light-mode .classroom-panel-reopen,
body.light-mode .classroom-side,
body.light-mode .classroom-topbar,
body.light-mode .classroom-panel-overlay {
    background: rgba(255, 255, 255, 0.94);
    border-color: #d9e1ec;
    color: var(--text-bright);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}
.classroom-panel-overlay {
    position: absolute;
    z-index: 6;
    left: 18px;
    right: 18px;
    top: 92px;
    bottom: 18px;
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid var(--primary);
    border-radius: 12px;
    background: rgba(14, 18, 28, 0.96);
    box-shadow: 0 28px 80px rgba(0,0,0,0.48);
    backdrop-filter: blur(14px);
    overflow: hidden;
}
.classroom-panel-overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.classroom-panel-overlay-head b {
    color: var(--text-bright);
    font-size: 18px;
}
.classroom-panel-overlay-body {
    overflow: auto;
    padding: 16px;
}
.classroom-panel-overlay-body .classroom-list-item {
    font-size: 16px;
}
.classroom-material-preview {
    min-height: 100%;
    color: var(--text-bright);
}
.classroom-material-preview img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    margin: 0 auto;
    border-radius: 10px;
    object-fit: contain;
}
.classroom-material-frame {
    width: 100%;
    height: calc(100vh - 190px);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.classroom-material-open-link {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    color: var(--primary);
    font-weight: 800;
}
.classroom-lesson-preview {
    max-width: 980px;
    margin: 0 auto;
    line-height: 1.65;
    font-size: 17px;
}
.classroom-answer-card {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-bright);
    margin-bottom: 10px;
    overflow: hidden;
}
.classroom-answer-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    list-style: none;
}
.classroom-answer-card summary::-webkit-details-marker {
    display: none;
}
.classroom-answer-card[open] summary i {
    transform: rotate(180deg);
}
.classroom-answer-full {
    display: grid;
    gap: 10px;
    padding: 0 10px 10px;
}
.classroom-answer-section {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0,0,0,0.16);
}
.classroom-answer-section b {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
}
.classroom-answer-section p {
    margin: 0;
    white-space: pre-wrap;
}
.classroom-answer-section.reference {
    border-color: rgba(98, 255, 117, 0.35);
    background: rgba(98, 255, 117, 0.08);
}
body.light-mode .classroom-collapse-title {
    color: var(--text-bright);
}
.classroom-hint {
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(255,255,255,0.78);
    font-size: 12px;
    pointer-events: none;
}
.classroom-list-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-bright);
    margin-bottom: 8px;
    text-decoration: none;
}
.classroom-list-item small {
    display: block;
    color: gray;
    margin-top: 3px;
}
.classroom-material-row {
    align-items: center;
    gap: 6px;
}
.classroom-material-row a span,
.classroom-material-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
.classroom-material-row .classroom-preview-material-btn,
.classroom-material-row .classroom-add-material-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0 !important;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
}
.classroom-material-row .classroom-preview-material-btn i,
.classroom-material-row .classroom-add-material-btn i {
    font-size: 18px;
}
.classroom-student-answer-history {
    margin-top: 12px;
}
.classroom-student-answer-history summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(98, 255, 117, 0.35);
    border-radius: 8px;
    background: rgba(98, 255, 117, 0.08);
    color: var(--text-bright);
    cursor: pointer;
    list-style: none;
}
.classroom-student-answer-history summary::-webkit-details-marker {
    display: none;
}
.classroom-student-answer-history[open] summary i {
    transform: rotate(180deg);
}
.classroom-student-answer-history .classroom-answer-section {
    margin-top: 8px;
}
.classroom-test-picker {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    padding: 10px;
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.22);
    border-radius: 8px;
}
.classroom-test-picker label {
    color: gray;
    font-size: 12px;
    margin: 0;
}
.classroom-test-picker select {
    margin: 0;
    width: 100%;
}
.classroom-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,0.62);
    backdrop-filter: blur(10px);
}
.classroom-modal {
    width: min(620px, 100%);
    max-height: min(720px, 90vh);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 25px 80px rgba(0,0,0,0.45);
    color: var(--text-bright);
}
.classroom-student-list {
    display: grid;
    gap: 10px;
}
.classroom-student-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    cursor: pointer;
}
.classroom-student-row input {
    width: 18px;
    height: 18px;
}
.classroom-student-row span {
    display: grid;
    gap: 2px;
}
.classroom-student-row small {
    color: gray;
}

@media (max-width: 1024px) {
    .classroom-start-grid,
    .classroom-template-form {
        grid-template-columns: 1fr;
    }
    .classroom-topbar {
        left: 8px;
        right: 8px;
        top: 8px;
        gap: 8px;
        padding: 8px;
    }
    .classroom-topbar h2 {
        font-size: 15px;
    }
    .classroom-topbar span {
        font-size: 11px;
    }
    .classroom-topbar button {
        padding: 8px 9px;
    }
    .classroom-topbar button:not(:first-child) {
        font-size: 0;
    }
    .classroom-topbar button i {
        font-size: 18px;
    }
    .classroom-floating-toolbar {
        top: 72px;
        left: 8px;
        right: 8px;
        transform: none;
        max-width: none;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 8px;
    }
    .classroom-toolbar-toggle {
        top: 72px;
        right: 8px;
    }
    .classroom-floating-toolbar button,
    .classroom-floating-toolbar input[type="color"],
    .classroom-floating-toolbar select,
    .classroom-brush-group,
    .classroom-fill-group {
        flex: 0 0 auto;
    }
    .classroom-floating-toolbar input[type="range"] {
        flex: 0 0 90px;
    }
    .classroom-side {
        position: absolute;
        top: auto;
        bottom: 10px;
        width: calc(50vw - 14px);
        max-height: 30vh;
        padding: 10px;
    }
    .classroom-side.left { left: 8px; }
    .classroom-side.right { right: 8px; }
    .classroom-panel-reopen {
        top: 128px;
        bottom: auto;
        transform: none;
        padding: 9px 11px;
    }
    .classroom-panel-reopen.left { left: 8px; }
    .classroom-panel-reopen.right { right: 8px; }
    .classroom-hint { display: none; }
}

@media (max-width: 640px) {
    .classroom-side {
        width: calc(100vw - 16px);
        max-height: 24vh;
        left: 8px !important;
        right: 8px !important;
    }
    .classroom-side.left {
        bottom: calc(24vh + 18px);
    }
    .classroom-side.right {
        bottom: 8px;
    }
    .classroom-panel-overlay {
        left: 8px;
        right: 8px;
        top: 64px;
        bottom: 8px;
    }
    .classroom-panel-reopen span {
        display: none;
    }
}
.author-tag { 
    display: inline-flex; align-items: center; gap: 5px; background: transparent; 
    padding: 4px 8px; border-radius: 4px; font-size: 12px; color: gray; 
    margin-bottom: 10px; border: 1px solid var(--border); 
}

/* === АНАЛИТИКА УЧИТЕЛЯ === */
.analytics-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}
.analytics-tab-btn {
    flex: 0 0 auto;
    background: transparent;
    color: gray;
    border-color: transparent;
    box-shadow: none;
    padding: 10px 14px;
}
.analytics-tab-btn.active {
    color: var(--text-bright);
    border-color: var(--primary);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: var(--shadow-glow);
}
.analytics-view { display: none; }
.analytics-view.active { display: block; }
.analytics-toolbar,
.student-progress-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}
.student-progress-toolbar {
    justify-content: space-between;
    margin-bottom: 15px;
}
.analytics-toolbar select {
    flex: 1;
    min-width: 220px;
    margin: 0;
    padding: 15px;
    background: var(--input-bg);
}
.compact-export-button {
    white-space: nowrap;
}
.compact-export-button i {
    font-size: 18px;
}
.analytics-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.analytics-metric-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    min-height: 82px;
}
.analytics-metric-card span {
    display: block;
    color: gray;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.analytics-metric-card b {
    display: block;
    color: var(--text-bright);
    font-size: 30px;
    line-height: 1;
}
.analytics-metric-primary { border-color: rgba(0, 240, 255, 0.5); }
.analytics-metric-primary b { color: var(--primary); }
.analytics-metric-success { border-color: rgba(0, 255, 102, 0.45); }
.analytics-metric-success b { color: var(--success); }
.analytics-metric-warning { border-color: rgba(255, 190, 11, 0.45); }
.analytics-metric-warning b { color: var(--warning); }
.analytics-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.analytics-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 18px;
}
.analytics-panel summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-bright);
    font-weight: 700;
}
.analytics-panel summary::-webkit-details-marker { display: none; }
.analytics-panel summary b {
    color: var(--primary);
    white-space: nowrap;
}
.analytics-panel h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.analytics-panel-note {
    margin: 12px 0 0;
    color: gray;
    font-size: 13px;
    line-height: 1.4;
}
.analytics-trend-explanation {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}
.analytics-trend-explanation .analytics-panel-note {
    margin: 0;
}
.analytics-trend-selection {
    flex: 0 0 auto;
    min-width: 112px;
    padding: 7px 10px;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 7px;
    background: rgba(0, 240, 255, 0.05);
    text-align: right;
}
.analytics-trend-selection span,
.analytics-trend-selection b {
    display: block;
}
.analytics-trend-selection span {
    color: var(--muted);
    font-size: 11px;
}
.analytics-trend-selection b {
    margin-top: 2px;
    color: var(--primary);
    font-size: 12px;
}
.analytics-trend {
    display: grid;
    grid-template-columns: repeat(30, minmax(4px, 1fr));
    align-items: end;
    gap: 4px;
    height: 82px;
    margin-top: 10px;
    padding: 8px 2px 0;
    border-bottom: 1px solid var(--border);
}
.analytics-trend-day {
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 3px 3px 0 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}
.analytics-trend-day > span {
    display: block;
    width: 100%;
    min-height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, var(--success), var(--primary));
    opacity: 0.72;
    transition: opacity 0.15s ease, filter 0.15s ease;
}
.analytics-trend-day:hover > span,
.analytics-trend-day:focus-visible > span,
.analytics-trend-day.active > span {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.7));
}
.analytics-trend-day:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.analytics-trend-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}
.student-activity-trend {
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
}
.student-activity-trend > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-bright);
}
.student-activity-trend > div:first-child span { color: gray; font-size: 12px; }
.student-activity-trend .analytics-trend { height: 110px; margin-top: 8px; }
.analytics-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.analytics-scroll-list {
    max-height: 360px;
    overflow-y: auto;
    padding-top: 14px;
    padding-right: 6px;
    scrollbar-color: var(--primary) var(--input-bg);
    scrollbar-width: thin;
}
.analytics-lesson-row,
.analytics-test-chip,
.analytics-student-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    padding: 12px;
}
.analytics-row-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-bright);
    font-size: 13px;
    margin-bottom: 8px;
}
.analytics-row-main span {
    min-width: 0;
}
.analytics-row-main b {
    color: var(--primary);
    white-space: nowrap;
}
.analytics-mini-bar {
    background: var(--input-bg);
    height: 7px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.analytics-mini-bar div {
    height: 100%;
    background: var(--primary);
    transition: width .5s ease;
}
.analytics-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    padding-top: 14px;
}
.analytics-test-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}
.analytics-test-chip span {
    min-width: 0;
    color: var(--text-bright);
}
.analytics-danger-panel {
    border-color: rgba(255, 0, 85, 0.45);
}
.analytics-hard-question {
    border-left: 3px solid var(--danger);
    background: var(--bg);
    border-radius: 6px;
    padding: 12px;
}
.analytics-hard-question p {
    color: var(--text-bright);
    margin: 0 0 10px;
    line-height: 1.45;
}
.analytics-hard-question div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: gray;
    font-size: 12px;
}
.analytics-hard-question b {
    color: var(--danger);
    white-space: nowrap;
}
.analytics-student-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}
.analytics-student-tools input {
    flex: 1;
    min-width: 180px;
    margin: 0;
}
.analytics-student-tools button {
    padding: 10px 14px;
}
.analytics-student-head {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.analytics-student-name {
    font-weight: 700;
    color: var(--text-bright);
}
.analytics-student-meta {
    color: gray;
    font-size: 12px;
    margin-top: 3px;
}
.analytics-student-percent {
    font-weight: 900;
}
.analytics-student-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin: 12px 0 10px;
}
.analytics-student-stats div {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 9px;
}
.analytics-student-stats b,
.analytics-student-stats span {
    display: block;
}
.analytics-student-stats b {
    color: var(--text-bright);
}
.analytics-student-stats span,
.analytics-muted {
    color: gray;
    font-size: 12px;
}
.analytics-status-line {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: gray;
}

/* === СМАРТ-БАР === */
.smart-bar-wrap { 
    background: rgba(0, 240, 255, 0.05); border: 1px solid rgba(0, 240, 255, 0.2); 
    border-radius: 6px; padding: 10px; margin-bottom: 15px; position: relative; overflow: hidden; 
}
.smart-bar-progress { 
    position: absolute; left: 0; top: 0; height: 100%; 
    background: rgba(0, 240, 255, 0.15); box-shadow: 0 0 10px rgba(0, 240, 255, 0.4); 
    border-right: 2px solid var(--primary); z-index: 1; animation: loadBar 1.5s ease-out forwards; 
}
.smart-bar-text { 
    position: relative; z-index: 2; font-size: 12px; font-weight: bold; 
    color: var(--primary); text-align: center; display: flex; 
    align-items: center; justify-content: center; gap: 5px; 
    text-shadow: 0 0 5px rgba(0,0,0,0.8); 
}
@keyframes loadBar { from { width: 0; } }

/* === ТОСТ === */
#custom-toast { 
    position: fixed; top: -100px; left: 50%; transform: translateX(-50%); 
    background: var(--card-bg); color: var(--text-bright); padding: 15px 25px; 
    border-radius: 8px; border: 1px solid var(--primary); 
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3); z-index: 9999; 
    transition: top 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); 
    display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 14px; 
}
#custom-toast.show { top: 30px; }

/* === УРОК / ЛЕЙАУТ === */
.lock-overlay { 
    position: absolute; top:0; left:0; width:100%; height:100%; 
    background: rgba(0,0,0,0.8); display: flex; flex-direction: column; 
    align-items: center; justify-content: center; z-index: 10; border-radius: 8px; 
    color: #fff; text-align: center; padding: 30px; backdrop-filter: blur(4px); box-sizing: border-box; 
}
.lesson-content { line-height: 1.7; font-size: 16px; color: var(--text); }
.lesson-content img { max-width: 100%; border-radius: 6px; margin: 15px 0; border: 1px solid var(--border); }
.lesson-content img.lesson-image-zoomable { cursor: zoom-in; }
.lesson-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0 24px;
    border: 1px solid rgba(80, 230, 255, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}
.lesson-table-scroll table {
    min-width: 680px;
    margin: 0;
    background: transparent;
}
.lesson-image-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(6px);
}
.lesson-image-viewer-modal img {
    display: block;
    max-width: min(1100px, 96vw);
    max-height: 88vh;
    object-fit: contain;
    border: 1px solid rgba(80, 230, 255, 0.45);
    border-radius: 12px;
    background: #05070d;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.22);
}
.lesson-image-viewer-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    font-size: 30px;
    line-height: 1;
    color: var(--text-bright);
    background: rgba(16, 18, 26, 0.88);
    border: 1px solid var(--border);
}
.lesson-content video,
.lesson-layout-editor video,
#lesson-editor video {
    display: block;
    width: 100%;
    max-width: 960px;
    max-height: 70vh;
    margin: 16px auto 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #000;
}
.lesson-video { margin: 18px 0; }
.lesson-video figcaption { color: gray; font-size: 12px; text-align: center; }
.lesson-video-embed {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    margin: 18px auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #000;
}
.lesson-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.lesson-offline-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--warning);
    border-radius: 6px;
    color: var(--warning);
    background: rgba(255,190,11,0.08);
    font-size: 12px;
    line-height: 1.4;
}
.lesson-content table,
.lesson-layout-editor table,
.lesson-html-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 24px;
    overflow-wrap: anywhere;
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.02);
}
.lesson-content .lesson-table-scroll table {
    margin: 0;
    background: transparent;
    overflow-wrap: normal;
}
.lesson-content th,
.lesson-content td,
.lesson-layout-editor th,
.lesson-layout-editor td,
.lesson-html-preview th,
.lesson-html-preview td {
    border: 1px solid rgba(80, 230, 255, 0.35);
    padding: 10px 12px;
    vertical-align: top;
}
.lesson-content .lesson-table-scroll th,
.lesson-content .lesson-table-scroll td {
    overflow-wrap: normal;
    word-break: normal;
}
.lesson-content th,
.lesson-layout-editor th,
.lesson-html-preview th {
    color: var(--primary);
    background: rgba(0, 240, 255, 0.08);
    font-weight: 800;
}
.lesson-content .lead,
.lesson-layout-editor .lead,
.lesson-html-preview .lead {
    font-size: 1.05rem;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(80, 230, 255, 0.06);
    color: var(--text-bright);
}
.lesson-content .quote,
.lesson-layout-editor .quote,
.lesson-html-preview .quote {
    margin: 18px 0;
    padding: 16px 18px;
    border-left: 4px solid var(--primary);
    background: rgba(0, 240, 255, 0.06);
    border-radius: 10px;
    color: var(--text-bright);
    font-style: italic;
}
.lesson-content .note,
.lesson-layout-editor .note,
.lesson-html-preview .note {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 190, 11, 0.45);
    background: rgba(255, 190, 11, 0.12);
    color: var(--text-bright);
}
.lesson-content .image-placeholder,
.lesson-layout-editor .image-placeholder,
.lesson-html-preview .image-placeholder {
    margin: 18px 0;
    padding: 18px 20px;
    border: 2px dashed rgba(255, 190, 11, 0.75);
    border-radius: 12px;
    background: rgba(255, 190, 11, 0.1);
    color: var(--warning);
    font-weight: 800;
    text-align: center;
}
.lesson-content .image-placeholder small,
.lesson-layout-editor .image-placeholder small,
.lesson-html-preview .image-placeholder small {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-weight: 500;
}
.lesson-content .grid,
.lesson-layout-editor .grid,
.lesson-html-preview .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 16px 0;
}
.lesson-content .card,
.lesson-layout-editor .card,
.lesson-html-preview .card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.035);
}
.lesson-content .timeline,
.lesson-layout-editor .timeline,
.lesson-html-preview .timeline {
    border-left: 3px solid var(--primary);
    padding-left: 18px;
    margin: 16px 0 24px;
}
.lesson-content .timeline .event,
.lesson-layout-editor .timeline .event,
.lesson-html-preview .timeline .event {
    position: relative;
    margin: 0 0 18px;
}
.lesson-content .timeline .event::before,
.lesson-layout-editor .timeline .event::before,
.lesson-html-preview .timeline .event::before {
    content: "";
    position: absolute;
    left: -26px;
    top: .55em;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--primary);
}
.lesson-content .tag,
.lesson-layout-editor .tag,
.lesson-html-preview .tag {
    display: inline-block;
    font-size: .85rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 240, 255, 0.1);
    color: var(--primary);
}
.lesson-content .cols,
.lesson-layout-editor .cols,
.lesson-html-preview .cols {
    columns: 2 280px;
    column-gap: 28px;
}
.lesson-content-frame {
    display: block;
    width: 100%;
    min-height: 260px;
    border: 0;
    border-radius: 10px;
    background: transparent;
}
.lesson-editor-modebar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 10px;
}
.lesson-editor-modebar button {
    padding: 8px 12px;
    font-size: 13px;
}
.lesson-editor-modebar .lesson-code-toggle {
    width: 38px;
    padding: 8px;
}
.lesson-editor-modebar button.active {
    color: #000;
    background: var(--primary);
    border-color: var(--primary);
}
.lesson-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1;
}
.lesson-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lesson-title-row .lesson-title-text {
    min-width: 220px;
}
.lesson-html-source {
    display: none;
    min-height: 420px;
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre;
}
.lesson-layout-toolbar {
    display: none;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12);
}
.lesson-layout-toolbar button {
    width: 38px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-bright);
    box-shadow: none;
}
.lesson-layout-toolbar button:hover {
    color: #000;
    background: var(--primary);
}
.lesson-layout-toolbar button.active {
    color: #000;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.28);
}
.lesson-layout-size-select,
.lesson-layout-heading-select {
    height: 36px;
    width: 52px;
    flex: 0 0 52px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-bright);
    box-shadow: none;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    appearance: none;
    cursor: pointer;
}
.lesson-layout-heading-select {
    width: 42px;
    flex-basis: 42px;
}
.lesson-layout-size-select:hover,
.lesson-layout-heading-select:hover {
    color: #000;
    background: var(--primary);
}
.lesson-layout-heading-select.active {
    color: #000;
    background: var(--primary);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.28);
}
.lesson-layout-size-select:focus,
.lesson-layout-heading-select:focus {
    outline: 2px solid rgba(0, 240, 255, 0.25);
    outline-offset: 2px;
}
.lesson-layout-editor {
    display: none;
    min-height: 520px;
    max-height: 72vh;
    overflow: auto;
    padding: 22px;
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-bright);
    outline: none;
    line-height: 1.65;
}
.lesson-layout-editor:focus {
    box-shadow: inset 0 0 0 1px var(--primary), 0 0 18px rgba(0,240,255,0.12);
}
.lesson-layout-editor img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
}
.lesson-layout-editor img.lesson-layout-image-selected {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(0, 240, 255, 0.14);
}
.lesson-layout-editor figure {
    margin: 18px 0;
}
.lesson-image-delete-btn {
    position: fixed;
    z-index: 10020;
    display: none;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--danger);
    border-radius: 8px;
    background: rgba(255, 47, 108, 0.14);
    color: var(--danger);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.lesson-image-delete-btn:hover {
    background: var(--danger);
    color: #fff;
}
.lesson-html-preview {
    margin: -10px 0 25px;
    padding: 20px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--card-bg);
}
.lesson-viewer-grid {
    min-height: calc(100vh - 170px);
    flex-wrap: nowrap !important;
}
.lesson-nav-panel {
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 0 0 320px !important;
}
.lesson-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}
.lesson-nav-close,
.lesson-mobile-program-btn,
.lesson-mobile-nav-backdrop {
    display: none;
}
.lesson-nav-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-color: var(--primary) var(--input-bg);
    scrollbar-width: thin;
}
.lesson-nav-list::-webkit-scrollbar { width: 8px; }
.lesson-nav-list::-webkit-scrollbar-track { background: var(--input-bg); border-radius: 8px; }
.lesson-nav-list::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 8px; }
.lesson-nav-item.active-lesson-nav {
    transform: translateX(2px);
}
.lesson-reading-toolbar {
    display: none;
}
.student-teacher-card {
    cursor: pointer;
}
.student-teacher-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.student-teacher-card-side {
    display: flex;
    align-items: center;
    gap: 8px;
}
.student-teacher-details {
    display: none;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.student-teacher-details.open {
    display: block;
}
.student-teacher-details-loading,
.student-teacher-details-empty {
    color: gray;
    font-size: 13px;
    line-height: 1.45;
}
.student-teacher-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.student-teacher-summary span {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 12px;
}
.student-teacher-summary b {
    color: var(--primary);
}
.student-teacher-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.student-teacher-course-card {
    position: relative;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
}
.student-teacher-course-cover {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    background: var(--bg);
}
.student-teacher-course-cover.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 28px;
}
.student-teacher-course-status {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 3px 8px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}
.student-teacher-course-card h4 {
    margin: 0 0 7px;
    color: var(--text-bright);
}
.student-teacher-course-card p {
    margin: 0 0 12px;
    color: gray;
    font-size: 13px;
    line-height: 1.45;
}
.question-admin-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 15px;
    position: relative;
    transition: border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}
.question-admin-card.is-draggable {
    padding-left: 50px;
    cursor: grab;
}
.question-admin-card.is-draggable:active {
    cursor: grabbing;
}
.question-admin-card.dragging {
    opacity: 0.55;
    transform: scale(0.995);
}
.question-admin-card.drag-over {
    border-color: var(--primary);
    background: rgba(0, 240, 255, 0.06);
}
.question-drag-handle {
    display: none;
}
.questions-drag-mode .question-drag-handle {
    display: flex;
    position: absolute;
    left: 12px;
    top: 12px;
    width: 28px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--primary);
    background: var(--bg);
    cursor: grab;
}
.questions-drag-mode .question-drag-handle i {
    font-size: 20px;
}

@media (max-width: 760px) {
    body {
        padding: 10px;
        padding-bottom: 90px;
        background-size: 24px 24px;
    }

    .dashboard {
        max-width: 100%;
    }

    #question-editor-form {
        padding: 16px 12px;
    }

    .question-main-editor {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #question-editor-form #q-text {
        min-height: 120px;
    }

    .question-main-tools {
        grid-template-columns: minmax(0, 1fr) 104px;
        align-items: stretch;
    }

    .question-main-image-btn {
        min-width: 0;
    }

    .question-main-tools #q-image-limit-hint,
    .question-main-tools .question-image-preview {
        grid-column: 1 / -1;
    }

    .question-main-tools .question-points-field {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        padding: 8px;
    }

    .question-partial-credit-fields {
        grid-template-columns: 1fr;
        margin-left: 0;
        max-width: none;
    }

    .question-option-row {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr) 48px;
        gap: 8px;
        align-items: center;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: rgba(0, 240, 255, 0.025);
    }

    .question-option-row .q-opt-correct {
        width: 24px !important;
        height: 24px;
        margin: 0;
        justify-self: center;
    }

    .question-option-row .q-opt-text {
        grid-column: 2 / -1;
        min-width: 0;
        margin: 0 !important;
    }

    .question-option-row .question-option-actions {
        grid-column: 1 / -1;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 0;
    }

    .question-option-row .question-option-actions > * {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 8px;
        box-sizing: border-box;
    }

    .question-option-row .question-image-preview,
    .question-option-row > img {
        grid-column: 1 / -1;
        max-width: 100%;
    }

    .header {
        padding: 12px;
        gap: 10px;
        align-items: center;
    }

    .header > div {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .header-brand {
        flex: 1 1 auto;
        flex-wrap: nowrap !important;
        overflow: hidden;
    }

    #mini-logo {
        width: 28px !important;
        height: 28px !important;
        flex: 0 0 auto;
    }

    #user-greeting {
        min-width: 0;
        font-size: 16px !important;
        line-height: 1.15;
        letter-spacing: 0 !important;
        overflow-wrap: anywhere;
    }

    .header-actions {
        flex: 0 0 auto;
        flex-wrap: nowrap !important;
        gap: 8px;
        margin-left: auto;
    }

    .notification-main-btn {
        width: 40px;
        min-width: 40px;
        padding: 0;
    }

    .header-bonus-account {
        min-width: 54px;
        padding: 0 10px;
    }

    .header-bonus-account span { display: none; }

    .bonus-account-card { align-items:stretch;flex-direction:column; }
    .bonus-referral-copy { max-width:none; }
    .bonus-center-modal { padding:0;align-items:stretch; }
    .bonus-center-content { width:100%;max-width:none;max-height:100vh;border-radius:0; }
    .bonus-center-head { padding:24px 20px; }
    .bonus-center-head h2 { font-size:30px; }
    .bonus-center-wallet { width:58px;height:58px;font-size:28px; }
    .bonus-center-section { padding:20px; }
    .bonus-center-link { flex-direction:column; }
    .bonus-spend-grid { grid-template-columns:1fr; }

    .notification-main-btn span:not(.notification-badge) {
        display: none;
    }

    .notification-panel {
        position: fixed;
        top: 76px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: calc(100vh - 110px);
    }

    .header-actions .theme-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        padding: 0 !important;
    }

    .header-logout-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        padding: 0 !important;
        gap: 0;
    }

    .header-logout-btn span {
        display: none;
    }

    button,
    .theme-btn-upload {
        padding: 10px 12px;
        font-size: 13px;
    }

    .test-actions {
        flex-direction: column;
    }

    .test-actions button {
        width: 100%;
    }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="datetime-local"],
    textarea,
    select {
        font-size: 16px;
        padding: 11px;
    }

    .card {
        padding: 15px;
        margin-bottom: 14px;
    }

    .tab-menu {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 6px;
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
        scrollbar-width: thin;
    }

    .teacher-tab-menu {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    #teacher-dashboard {
        padding-bottom: 86px;
    }

    #student-dashboard {
        padding-bottom: 86px;
    }

    #student-dashboard > .tab-menu {
        display: none;
    }

    .teacher-workspace {
        display: block;
    }

    .teacher-sidebar {
        display: none;
    }

    .teacher-main {
        width: 100%;
    }

    .teacher-mobile-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 1500;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 6px;
        background: rgba(20, 22, 28, 0.96);
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(10px);
    }

    .student-mobile-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 1500;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 6px;
        background: rgba(20, 22, 28, 0.96);
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(10px);
    }

    .teacher-workspace > .teacher-more-menu {
        display: block;
    }

    #student-dashboard > .student-more-menu {
        display: block;
    }

    .teacher-mobile-nav .tab-btn,
    .student-mobile-nav .tab-btn {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 3px;
        align-items: center;
        justify-content: center;
        padding: 8px 4px;
        border: 1px solid transparent;
        border-radius: 6px;
        font-size: 11px;
        min-width: 0;
        white-space: normal;
    }

    .teacher-mobile-nav .tab-btn i,
    .student-mobile-nav .tab-btn i {
        font-size: 20px;
    }

    .teacher-mobile-nav .tab-btn.active,
    .student-mobile-nav .tab-btn.active {
        background: rgba(0, 240, 255, 0.1);
        border-color: rgba(0, 240, 255, 0.35);
    }

    .teacher-mobile-nav .nav-badge,
    .student-mobile-nav .nav-badge,
    .teacher-mobile-nav .profile-badge,
    .student-mobile-nav .profile-badge {
        position: absolute;
        top: 3px;
        right: 8px;
        margin: 0;
        padding: 3px 6px;
        font-size: 10px;
    }

    .tab-btn {
        white-space: nowrap;
        font-size: 13px;
        padding: 9px 10px;
    }

    .teacher-more-dropdown {
        position: fixed;
        right: 12px;
        left: 12px;
        bottom: 86px;
        top: auto;
        min-width: 0;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        z-index: 1600;
    }

    body.teacher-more-open .support-btn,
    body.teacher-more-open .quick-scroll-btn {
        display: none;
        pointer-events: none;
    }

    #viewer-course-title {
        font-size: 20px;
        margin-bottom: 14px !important;
        line-height: 1.25;
    }

    .lesson-mobile-program-btn {
        display: flex;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 16px;
        border-color: var(--primary);
        background: var(--card-bg);
        box-shadow: none;
    }

    .lesson-mobile-nav-backdrop.mobile-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.58);
        z-index: 1400;
    }

    .lesson-viewer-grid {
        display: block !important;
        flex-wrap: wrap !important;
    }

    .lesson-nav-panel {
        position: fixed !important;
        left: 0;
        top: 0 !important;
        bottom: 0;
        width: min(86vw, 360px);
        min-width: 0 !important;
        height: 100vh;
        flex-basis: auto !important;
        max-height: none;
        border-radius: 0 10px 10px 0 !important;
        z-index: 1500;
        transform: translateX(-110%);
        transition: transform 0.22s ease;
        overflow: hidden;
        box-shadow: 18px 0 45px rgba(0, 0, 0, 0.45);
        box-sizing: border-box;
    }

    .lesson-nav-panel.mobile-open {
        transform: translateX(0);
    }

    .lesson-nav-close {
        display: inline-flex;
        padding: 7px;
        min-width: 34px;
        box-shadow: none;
        background: transparent;
    }

    .lesson-nav-list {
        max-height: calc(100vh - 74px);
        padding-right: 4px;
    }

    .lesson-reading-toolbar {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(92px + env(safe-area-inset-bottom, 0px));
        z-index: 1320;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 7px;
        padding: 8px;
        border: 1px solid rgba(80, 230, 255, 0.35);
        border-radius: 14px;
        background: rgba(16, 18, 26, 0.94);
        box-shadow: 0 0 24px rgba(0, 240, 255, 0.18);
        backdrop-filter: blur(10px);
    }

    .lesson-reading-toolbar button {
        min-width: 0;
        min-height: 48px;
        padding: 7px 5px;
        border-radius: 10px;
        box-shadow: none;
        font-size: 11px;
        line-height: 1.1;
    }

    .lesson-reading-toolbar button i {
        display: block;
        margin-bottom: 3px;
        font-size: 18px;
    }

    .lesson-reading-toolbar button:disabled {
        opacity: 0.45;
    }

    #single-lesson-container .card {
        border-radius: 7px;
        padding-bottom: 92px;
    }

    #lesson-viewer {
        max-width: none;
        width: 100%;
    }

    #lesson-viewer .lesson-viewer-grid {
        flex-wrap: wrap !important;
    }

    #lesson-viewer .lesson-main-panel {
        width: 100% !important;
        min-width: 0 !important;
    }

    .table-fill-task-wrap {
        margin-left: -4px;
        margin-right: -4px;
        max-width: calc(100vw - 28px);
    }

    .table-fill-task-table {
        min-width: 720px;
        font-size: 14px;
    }

    .table-fill-task-table th,
    .table-fill-task-table td {
        padding: 9px;
        max-width: 260px;
    }

    .table-fill-select {
        min-width: 160px;
        font-size: 14px;
    }

    #single-lesson-container h2 {
        font-size: 20px;
        line-height: 1.25;
    }

    .lesson-content {
        font-size: 15px;
        line-height: 1.65;
    }

    .support-btn {
        right: 12px;
        bottom: 12px;
        padding: 10px 12px;
        font-size: 12px;
    }

    .quick-scroll-btn {
        right: 12px;
        bottom: 66px;
        width: 42px;
        height: 42px;
        min-width: 42px;
    }
}

@media (min-width: 761px) and (max-width: 1024px) {
    #student-dashboard {
        padding-bottom: 96px;
    }

    #student-dashboard > .tab-menu {
        display: none;
    }

    .student-mobile-nav {
        position: fixed;
        left: 50%;
        right: auto;
        bottom: 14px;
        z-index: 1500;
        width: min(720px, calc(100vw - 32px));
        transform: translateX(-50%);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        padding: 8px;
        background: rgba(20, 22, 28, 0.96);
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
        backdrop-filter: blur(10px);
    }

    .student-mobile-nav .tab-btn {
        flex-direction: row;
        min-width: 0;
        white-space: normal;
        padding: 10px 8px;
        border: 1px solid transparent;
        border-radius: 6px;
        font-size: 13px;
    }

    .student-mobile-nav .tab-btn.active {
        background: rgba(0, 240, 255, 0.1);
        border-color: rgba(0, 240, 255, 0.35);
    }

    #student-dashboard > .student-more-menu {
        display: block;
    }
}

/* === QUILL EDITOR === */
.ql-toolbar.ql-snow { border-color: var(--border) !important; background: var(--bg); border-top-left-radius: 4px; border-top-right-radius: 4px; }
.ql-container.ql-snow { border-color: var(--border) !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }
.ql-editor { min-height: 300px; color: var(--text-bright); line-height: 1.7; }
.ql-editor img { max-width: 100%; height: auto; border-radius: 6px; }
.ql-snow .ql-picker { color: var(--text) !important; }
.ql-snow .ql-picker-options { background: var(--card-bg) !important; border-color: var(--border) !important; }
.ql-snow .ql-stroke { stroke: var(--text) !important; }
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill { fill: var(--text) !important; }
body.light-mode .ql-toolbar.ql-snow { background: #f8fafc; }
body.light-mode .ql-editor { color: var(--text-bright); background: #ffffff; }

/* === ПОДДЕРЖКА / ПЛАВАЮЩАЯ КНОПКА === */
.support-btn { 
    position: fixed; bottom: 25px; right: 25px; 
    background: rgba(0, 240, 255, 0.1); color: var(--primary); border: 1px solid var(--primary); 
    padding: 12px 20px; border-radius: 50px; text-decoration: none; font-weight: bold; 
    display: flex; align-items: center; gap: 8px; transition: 0.3s; 
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2); backdrop-filter: blur(5px); z-index: 100; 
}
.quick-scroll-btn {
    position: fixed;
    right: 25px;
    bottom: 88px;
    width: 46px;
    height: 46px;
    min-width: 46px;
    padding: 0 !important;
    border-radius: 999px;
    background: rgba(0, 240, 255, 0.12);
    color: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
    backdrop-filter: blur(8px);
    z-index: 120;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}
.quick-scroll-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.quick-scroll-btn i { font-size: 24px; }

@media (max-width: 760px) {
    .support-btn {
        right: 12px;
        bottom: 96px;
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
        gap: 0;
        font-size: 0;
        z-index: 1400;
    }

    .support-btn i {
        font-size: 20px;
    }

    .support-btn #support-unread-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        margin: 0 !important;
    }

    .quick-scroll-btn {
        display: none;
    }
}

/* === МОДАЛЬНЫЕ ОКНА === */
.modal { 
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.6); backdrop-filter: blur(5px); 
}
.modal-content { 
    background-color: var(--card-bg); margin: 5% auto; padding: 30px; 
    border: 1px solid var(--border); border-radius: 8px; width: 90%; max-width: 600px; 
    max-height: 80vh; overflow-y: auto; color: var(--text); position: relative; 
}
.close-modal { color: gray; float: right; font-size: 28px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.close-modal:hover { color: var(--danger); }

.test-answer-reveal-modal {
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.test-answer-reveal-modal .modal-content {
    width: min(100%, 480px);
    margin: 0;
    padding: 24px;
    border-color: rgba(0, 240, 255, 0.4);
}

.test-answer-reveal-modal h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 42px 10px 0;
    color: var(--text-bright);
}

.test-help-modal-intro,
#test-answer-reveal-modal-description {
    color: var(--muted);
    line-height: 1.55;
}

#test-answer-reveal-modal-title {
    display: block;
    margin-top: 20px;
    color: var(--primary);
}

.test-help-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
    font-size: 24px;
    line-height: 1;
}

.test-help-modal-close:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.inline-help-button,
#lesson-file-limit-hint,
#q-image-limit-hint,
[data-homework-file-limit-hint] {
    width: 28px !important;
    min-width: 28px;
    height: 28px;
    display: inline-grid !important;
    place-items: center;
    margin: 4px 0 8px !important;
    padding: 0 !important;
    border: 1px solid rgba(0, 240, 255, 0.58) !important;
    border-radius: 50% !important;
    background: rgba(0, 240, 255, 0.08) !important;
    color: transparent !important;
    font-size: 0 !important;
    font-weight: 900;
    cursor: pointer;
    box-shadow: none;
}

.inline-help-button::before,
#lesson-file-limit-hint::before,
#q-image-limit-hint::before,
[data-homework-file-limit-hint]::before {
    content: "?";
    color: var(--primary);
    font-size: 14px;
}

.compact-help-modal {
    position: relative;
    max-width: 480px;
}

.compact-help-modal h3 {
    margin: 0 44px 12px 0;
}

.compact-help-modal p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
}

.classroom-template-form input,
.classroom-template-form select,
#classroom-template-notes,
.calendar-field input,
.calendar-field select,
.calendar-field textarea,
.calendar-student-combobox input,
.course-form-visible input:not([type="checkbox"]):not([type="file"]),
.course-form-visible textarea,
.course-form-visible select {
    border-color: rgba(80, 230, 255, 0.52) !important;
    box-shadow: 0 0 0 1px rgba(80, 230, 255, 0.1);
}

.classroom-template-form input:focus,
.classroom-template-form select:focus,
#classroom-template-notes:focus,
.calendar-field input:focus,
.calendar-field select:focus,
.calendar-field textarea:focus,
.calendar-student-combobox input:focus,
.course-form-visible input:focus,
.course-form-visible textarea:focus,
.course-form-visible select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 1px rgba(80, 230, 255, 0.28), 0 0 14px rgba(80, 230, 255, 0.14);
}

.course-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.course-form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 15px;
    color: var(--text-bright);
    font-size: 13px;
    font-weight: 700;
}

.course-form-field input,
.course-form-field select {
    margin-bottom: 0;
}

.course-form-field small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}

.course-sales-card {
    padding: 16px !important;
    border-color: rgba(80, 230, 255, 0.38) !important;
    background: rgba(0, 240, 255, 0.035) !important;
}

.course-sales-heading h4 {
    margin: 0 0 6px;
    color: var(--text-bright);
}

.course-sales-heading p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.course-installment-checkbox {
    display: none !important;
}

#course-installment-fields {
    gap: 12px !important;
    margin-bottom: 12px;
}

@media (max-width: 760px) {
    .course-form-grid {
        grid-template-columns: 1fr;
    }
}

/* === Расписание === */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
    margin-bottom: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.calendar-toolbar h3 {
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.calendar-toolbar p {
    margin: 0;
    color: gray;
    font-size: 13px;
}
.calendar-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.calendar-toolbar-actions button,
.calendar-list-actions button {
    padding: 10px 12px;
}
.calendar-toolbar-actions button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}
.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: visible;
}
.calendar-day {
    min-height: 260px;
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}
.calendar-day.today,
.calendar-month-day.today,
.calendar-month-agenda-day.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.22), 0 0 18px rgba(0, 240, 255, 0.08);
}
.calendar-day-head {
    color: var(--text-bright);
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    text-transform: capitalize;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.calendar-day-head span,
.calendar-month-date span {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}
.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.calendar-event {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    text-align: left;
    border-radius: 6px;
    color: var(--text-bright);
    background: rgba(0, 240, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: none;
}
.calendar-event span,
.calendar-event small {
    color: gray;
    font-size: 11px;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.calendar-event b {
    line-height: 1.25;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.calendar-repeat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    padding: 2px 6px;
    border: 1px solid rgba(0, 240, 255, 0.34);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(0, 240, 255, 0.08);
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    vertical-align: middle;
}
.calendar-event:hover,
.calendar-event:focus-visible {
    transform: none;
    text-shadow: none;
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.58);
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.12);
}
.calendar-event:hover span,
.calendar-event:hover small,
.calendar-event:focus-visible span,
.calendar-event:focus-visible small {
    color: var(--muted);
    text-shadow: none;
}
.calendar-event-selectable {
    position: relative;
    padding-left: 38px;
}
.calendar-event.selected,
.calendar-list-item.selected {
    border-color: var(--danger);
    background: rgba(255, 0, 85, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 0, 85, 0.22), 0 0 18px rgba(255, 0, 85, 0.12);
}
.calendar-select-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    font-style: normal;
    font-size: 22px;
}
.calendar-event .calendar-select-mark {
    position: absolute;
    left: 10px;
    top: 10px;
}
.calendar-event-ongoing,
.calendar-list-item-ongoing {
    position: relative;
    border-color: rgba(0, 240, 255, 0.72);
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.11), rgba(0, 240, 255, 0.035));
    box-shadow: inset 3px 0 0 var(--primary);
}
.calendar-event-ongoing:hover,
.calendar-event-ongoing:focus-visible {
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.16), rgba(0, 240, 255, 0.06));
    box-shadow: inset 3px 0 0 var(--primary), 0 0 0 1px rgba(0, 240, 255, 0.16);
}
.calendar-now-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #001418;
    background: var(--primary);
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 1.4;
    vertical-align: 2px;
    text-shadow: none;
}
.calendar-event-consultation { background: rgba(0, 255, 102, 0.06); border-color: rgba(0, 255, 102, 0.35); }
.calendar-event-homework { background: rgba(255, 190, 11, 0.07); border-color: rgba(255, 190, 11, 0.4); }
.calendar-event-exam { background: rgba(255, 0, 85, 0.07); border-color: rgba(255, 0, 85, 0.4); }
.calendar-event-personal { background: rgba(160, 170, 190, 0.08); border-color: rgba(160, 170, 190, 0.35); }
.calendar-event-completed { border-color: rgba(0, 255, 102, 0.5); }
.calendar-event-missed { border-color: rgba(255, 0, 85, 0.55); background: rgba(255, 0, 85, 0.09); }
.calendar-empty,
.calendar-muted {
    color: gray;
    font-size: 13px;
}
.calendar-list-panel,
.notification-settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 18px;
}
.notification-settings-card.compact {
    padding: 16px;
}
.calendar-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: stretch;
}
.calendar-save-settings {
    margin-top: 12px;
    width: auto;
    min-width: 240px;
}
.calendar-inline-input {
    display: flex;
    align-items: center;
    gap: 8px;
}
.calendar-inline-input input {
    flex: 1;
}
.calendar-inline-input small {
    color: gray;
    font-size: 12px;
}
.calendar-segment {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.calendar-segment button {
    border-color: transparent;
    box-shadow: none;
    padding: 8px 12px;
}
.calendar-segment button.active {
    border-color: var(--primary);
    color: var(--text-bright);
    background: rgba(0, 240, 255, 0.12);
}
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    overflow-x: visible;
    margin-bottom: 18px;
}
.calendar-month-weekday {
    color: gray;
    font-size: 12px;
    text-transform: uppercase;
    padding: 0 8px 4px;
}
.calendar-month-day {
    min-height: 138px;
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.calendar-month-day:hover,
.calendar-month-day:focus-visible,
.calendar-month-agenda-day:hover,
.calendar-month-agenda-day:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.14);
    outline: none;
}
.calendar-month-day.muted {
    opacity: 0.45;
}
.calendar-month-date {
    color: var(--text-bright);
    font-weight: 800;
    margin-bottom: 8px;
}
.calendar-month-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.calendar-month-events .calendar-event {
    padding: 7px;
}
.teacher-tariffs-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.teacher-tariff-section {
    background: rgba(20, 22, 28, 0.52);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
}
.teacher-tariff-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--text-bright);
}
.teacher-tariff-section p {
    margin: -6px 0 16px;
    color: gray;
    font-size: 13px;
}
.teacher-tariff-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.teacher-addon-section {
    border-style: dashed;
    background: rgba(0, 240, 255, 0.035);
}
.calendar-month-agenda {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.calendar-month-agenda-day {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.calendar-audience-row {
    display: grid;
    grid-template-columns: minmax(130px, 180px) 1fr;
    gap: 10px;
}
.calendar-student-combobox {
    position: relative;
    display: flex;
}
.calendar-student-combobox input[type="text"] {
    width: 100%;
}
.calendar-student-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    max-height: 240px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    padding: 6px;
}
.calendar-student-results.open {
    display: block;
}
.calendar-student-results button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 0;
    box-shadow: none;
    background: transparent;
    color: var(--text-bright);
    text-align: left;
}
.calendar-student-results button:hover {
    background: rgba(0, 240, 255, 0.08);
}
.calendar-student-results span,
.calendar-student-results p {
    color: gray;
    margin: 0;
    font-size: 12px;
}
.calendar-options-box {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}
.calendar-options-box h4 {
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.student-calendar-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.student-calendar-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 14px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 8px;
}
.student-calendar-date {
    color: var(--primary);
    font-weight: 900;
    font-size: 14px;
    line-height: 1.25;
}
.student-calendar-body span,
.student-calendar-body small,
.student-calendar-body p {
    display: block;
    color: gray;
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 5px;
}
.student-calendar-body b {
    display: block;
    color: var(--text-bright);
    font-size: 18px;
    line-height: 1.25;
    margin-bottom: 6px;
}
.calendar-list-panel h4,
.notification-settings-card h4 {
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.notification-settings-card p {
    margin: -6px 0 14px;
    color: gray;
    font-size: 13px;
}
.calendar-list-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.calendar-list-item-selectable {
    cursor: pointer;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.calendar-list-item-selectable:hover {
    border-color: rgba(255, 0, 85, 0.45);
    background: rgba(255, 0, 85, 0.08);
}
.calendar-list-item-completed {
    border-left: 3px solid var(--success);
    padding-left: 12px;
}
.calendar-list-item-missed {
    border-left: 3px solid var(--danger);
    padding-left: 12px;
}
.calendar-list-item-ongoing {
    padding-left: 12px;
}
.calendar-list-item:first-of-type {
    border-top: 0;
}
.calendar-list-item b,
.calendar-list-item span,
.calendar-list-item p {
    display: block;
}
.calendar-list-item b {
    color: var(--text-bright);
    margin-bottom: 4px;
}
.calendar-list-item span,
.calendar-list-item p {
    color: gray;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}
.calendar-list-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.calendar-modal-content {
    max-width: 760px;
    max-height: 86vh;
    overflow-y: auto;
}
.calendar-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.calendar-field,
.calendar-toggle {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: gray;
    font-size: 12px;
}
.calendar-field input,
.calendar-field select,
.calendar-field textarea {
    margin-bottom: 0;
}
.calendar-field textarea {
    min-height: 90px;
    resize: vertical;
}
.calendar-field-wide {
    grid-column: 1 / -1;
}
.calendar-toggle {
    flex-direction: row;
    align-items: center;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-bright);
}
.calendar-toggle input {
    width: 18px;
    height: 18px;
}
.calendar-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 18px;
}
.teacher-student-stats-modal {
    max-width: 900px;
}
.student-stats-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-right: 36px;
}
.student-stats-modal-head h3 {
    margin: 0 0 8px;
}
.student-stats-back {
    flex: 0 0 auto;
    padding: 8px 11px;
    color: var(--muted);
    background: transparent;
    border-color: var(--border);
    box-shadow: none;
}
.student-stats-back span {
    font-size: 18px;
    line-height: 1;
}
.student-stats-back em {
    font-style: normal;
}
.student-stats-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 18px 0;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}
.student-stats-tab {
    min-width: 0;
    padding: 10px 8px;
    color: var(--muted);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.student-stats-tab.active {
    color: var(--text-bright);
    border-color: var(--primary);
    background: rgba(0, 240, 255, 0.08);
}
.student-stats-key-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.student-stats-key-metrics > div {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}
.student-stats-key-metrics b,
.student-stats-key-metrics span {
    display: block;
}
.student-stats-key-metrics b {
    color: var(--primary);
    font-size: 25px;
}
.student-stats-key-metrics span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}
.student-stats-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}
.student-stats-alert,
.student-stats-all-good {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
}
.student-stats-alert.warning {
    color: var(--warning);
    border-color: rgba(255, 190, 11, 0.38);
}
.student-stats-alert.danger {
    color: var(--danger);
    border-color: rgba(255, 0, 85, 0.38);
}
.student-stats-all-good {
    margin-top: 12px;
    color: var(--success);
    border-color: rgba(0, 255, 102, 0.35);
}
.student-stats-section-head {
    margin: 20px 0 8px;
}
.student-stats-section-head h4 {
    margin: 0;
}
.student-stats-activity-list {
    display: grid;
    gap: 6px;
}
.student-stats-activity-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}
.student-stats-activity-row > i {
    color: var(--primary);
    font-size: 20px;
}
.student-stats-activity-row b,
.student-stats-activity-row span {
    display: block;
}
.student-stats-activity-row b {
    color: var(--text-bright);
    font-size: 13px;
}
.student-stats-activity-row span,
.student-stats-activity-row time {
    color: var(--muted);
    font-size: 11px;
}
.student-stats-course-list,
.student-stats-homework-list {
    display: grid;
    gap: 9px;
}
.student-stats-course-row,
.student-stats-homework-row {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}
.student-stats-course-row > summary,
.student-stats-homework-row > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px;
    cursor: pointer;
    list-style: none;
}
.student-stats-course-row > summary::-webkit-details-marker,
.student-stats-homework-row > summary::-webkit-details-marker {
    display: none;
}
.student-stats-course-row summary b,
.student-stats-course-row summary span,
.student-stats-homework-row summary b,
.student-stats-homework-row summary span {
    display: block;
}
.student-stats-course-row summary b,
.student-stats-homework-row summary b {
    color: var(--text-bright);
}
.student-stats-course-row summary span,
.student-stats-homework-row summary span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}
.student-stats-course-progress {
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    gap: 9px;
}
.student-stats-course-progress > span {
    width: 38px;
    margin: 0 !important;
    color: var(--primary) !important;
    font-weight: 800;
    text-align: right;
}
.student-stats-course-progress > div {
    flex: 1;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--input-bg);
}
.student-stats-course-progress i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
}
.student-stats-course-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 13px 13px;
}
.student-stats-course-details span {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
}
.student-stats-course-details .warning {
    color: var(--warning);
}
.student-stats-course-details .danger {
    color: var(--danger);
}
.student-stats-homework-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.student-stats-homework-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.student-stats-homework-head h4,
.student-stats-homework-head p {
    margin: 0;
}
.student-stats-homework-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.student-stats-homework-head > span {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 999px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}
.student-stats-homework-summary span {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
}
.student-stats-homework-summary b {
    color: var(--text-bright);
}
.student-stats-homework-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: -2px 0 12px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(0, 240, 255, 0.035);
    font-size: 11px;
    line-height: 1.45;
}
.student-stats-homework-note i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--primary);
    font-size: 16px;
}
.student-stats-homework-row.pending {
    border-left: 3px solid var(--warning);
}
.student-stats-homework-row.approved {
    border-left: 3px solid var(--success);
}
.student-stats-homework-row.rejected {
    border-left: 3px solid var(--danger);
}
.student-stats-homework-row summary strong {
    color: var(--primary);
    font-size: 12px;
    white-space: nowrap;
}
.student-stats-homework-body {
    padding: 0 13px 13px;
}
.student-stats-answer {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--card-bg);
}
.student-stats-answer small,
.student-stats-comment span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
}
.student-stats-answer p {
    margin: 0;
    color: var(--text-bright);
    white-space: pre-wrap;
}
.student-stats-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
    color: var(--primary);
}
.student-stats-comment {
    display: block;
    margin-top: 10px;
}
.student-stats-comment textarea {
    min-height: 70px;
    margin: 0;
}
.student-stats-homework-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 9px;
}
.student-stats-send-result {
    width: 100%;
    margin-top: 9px;
}
.student-feed-filters {
    display: flex;
    gap: 7px;
    margin: 12px 0;
    overflow-x: auto;
}
.student-feed-filters button {
    flex: 0 0 auto;
    padding: 7px 11px;
    color: var(--muted);
    background: transparent;
    border-color: var(--border);
    box-shadow: none;
    font-size: 12px;
}
.student-feed-filters button.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 240, 255, 0.07);
}
.student-feed-filter-help {
    margin: -3px 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.student-feed-list {
    display: grid;
    gap: 6px;
}
.student-feed-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) minmax(160px, .9fr) minmax(130px, auto) 18px;
    align-items: center;
    gap: 14px;
    padding: 12px 13px;
    color: inherit;
    text-align: left;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
}
.student-feed-row:hover {
    border-color: rgba(0, 240, 255, 0.45);
    background: rgba(0, 240, 255, 0.035);
}
.student-feed-identity b,
.student-feed-identity span {
    display: block;
}
.student-feed-identity b {
    color: var(--text-bright);
}
.student-feed-identity span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}
.student-feed-progress {
    display: flex;
    align-items: center;
    gap: 9px;
}
.student-feed-progress > div {
    flex: 1;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--input-bg);
}
.student-feed-progress i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
}
.student-feed-progress strong {
    width: 38px;
    font-size: 13px;
    text-align: right;
}
.student-feed-progress strong.success { color: var(--success); }
.student-feed-progress strong.warning { color: var(--warning); }
.student-feed-progress strong.danger { color: var(--danger); }
.student-feed-alerts {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
}
.student-feed-alert {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
}
.student-feed-alert.warning { color: var(--warning); }
.student-feed-alert.danger { color: var(--danger); }
.student-feed-alert.muted { color: var(--muted); }
.student-feed-ok {
    color: var(--success);
    font-size: 11px;
}
.student-feed-chevron {
    color: var(--muted);
    font-size: 18px;
}
.student-test-report-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.student-test-report-toolbar select {
    max-width: 320px;
    margin: 0;
}
.analytics-student-details-btn {
    padding: 10px 12px;
    font-size: 12px;
}
.analytics-student-details-btn {
    width: 100%;
    margin-top: 12px;
}
.student-test-report-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    margin-bottom: 10px;
    overflow: hidden;
}
.student-test-report-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    cursor: pointer;
    list-style: none;
}
.student-test-report-card > summary::-webkit-details-marker {
    display: none;
}
.student-test-report-card > summary b {
    color: var(--text-bright);
}
.student-test-report-card > summary span,
.student-test-report-score span {
    display: block;
    color: gray;
    font-size: 12px;
    margin-top: 4px;
}
.student-test-report-score {
    text-align: right;
    flex-shrink: 0;
}
.student-test-report-score strong {
    color: var(--primary);
    font-size: 20px;
}
.student-test-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 14px 14px;
}
.student-test-report-meta span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 9px;
    color: gray;
    font-size: 12px;
}
.student-test-report-meta .warning {
    border-color: var(--warning);
    color: var(--warning);
}
.student-test-question-list {
    display: grid;
    gap: 10px;
    padding: 0 14px 14px;
}
.student-test-question {
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: 8px;
    padding: 12px;
    background: var(--card-bg);
}
.student-test-question summary {
    display: block;
    cursor: pointer;
    list-style: none;
}
.student-test-question summary::-webkit-details-marker {
    display: none;
}
.student-test-question.correct {
    border-left-color: var(--success);
}
.student-test-question.wrong {
    border-left-color: var(--danger);
}
.student-test-question.pending {
    border-left-color: var(--warning);
}
.student-test-question-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--text-bright);
}
.student-test-question-head b {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.student-test-question-head span {
    color: gray;
    font-size: 12px;
    white-space: nowrap;
}
.student-test-question-text {
    margin-top: 10px;
    line-height: 1.5;
    color: var(--text-bright);
}
.student-test-question-image {
    max-width: 240px;
    max-height: 160px;
    object-fit: contain;
    display: block;
    margin-top: 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.student-test-answer-block {
    margin-top: 10px;
}
.student-test-answer-block small {
    display: block;
    color: gray;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}
.student-test-answer-block.reference {
    color: var(--success);
}
.student-test-answer-block.comment {
    color: var(--primary);
}
.student-test-answer-text {
    white-space: pre-wrap;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-bright);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .classroom-mode-tabs {
        display: flex;
    }

    .teacher-student-stats-modal {
        width: 100%;
        max-width: none;
        max-height: none;
        height: 100vh;
        min-height: 100vh;
        margin: 0;
        padding: 18px 14px calc(96px + env(safe-area-inset-bottom));
        border-radius: 0;
        box-sizing: border-box;
    }

    .student-stats-modal-head {
        padding-right: 30px;
    }

    .student-stats-back {
        width: 34px;
        min-width: 34px;
        height: 34px;
        padding: 0;
    }

    .student-stats-back em {
        display: none;
    }

    .student-stats-tabs {
        position: sticky;
        top: -18px;
        z-index: 2;
        display: flex;
        width: max-content;
        max-width: 100%;
        overflow-x: auto;
        margin: 14px auto;
        background: var(--card-bg);
        scrollbar-width: none;
    }

    .student-stats-tabs::-webkit-scrollbar {
        display: none;
    }

    .student-stats-tab {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: auto;
        padding: 9px 11px;
        font-size: 12px;
    }

    .student-stats-tab i {
        display: inline-block;
        margin: 0;
        font-size: 16px;
    }

    .student-stats-homework-head {
        align-items: center;
    }

    .student-stats-key-metrics {
        gap: 7px;
    }

    .student-stats-key-metrics > div {
        padding: 11px 9px;
    }

    .student-stats-key-metrics b {
        font-size: 20px;
    }

    .student-stats-activity-row {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .student-stats-activity-row time {
        grid-column: 2;
    }

    .student-stats-course-row > summary,
    .student-stats-homework-row > summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .student-stats-course-progress {
        width: 100%;
        flex-basis: auto;
    }

    .student-stats-homework-actions {
        grid-template-columns: 1fr;
    }

    .student-feed-row {
        grid-template-columns: minmax(0, 1fr) auto 16px;
        gap: 8px;
        padding: 11px;
    }

    .student-feed-progress {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    .student-feed-alerts {
        grid-column: 2;
        grid-row: 1;
    }

    .student-feed-chevron {
        grid-column: 3;
        grid-row: 1 / 3;
    }

    .analytics-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 8px;
        margin-bottom: 18px;
    }

    .analytics-toolbar select {
        width: 100%;
        min-width: 0;
        padding: 12px 10px;
    }

    .compact-export-button {
        width: 44px;
        min-width: 44px;
        height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .compact-export-button span {
        display: none;
    }

    .student-progress-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        align-items: start;
    }

    .analytics-panel {
        padding: 14px;
    }

    .analytics-panel summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .analytics-panel summary b {
        white-space: normal;
        font-size: 13px;
    }

    .analytics-trend-explanation {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .analytics-trend-selection {
        width: 100%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .analytics-trend-selection b {
        margin: 0;
    }

    .analytics-trend {
        gap: 3px;
        height: 72px;
    }

    .calendar-toolbar {
        flex-direction: column;
        padding: 14px;
        gap: 12px;
    }
    .calendar-toolbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        gap: 8px;
        justify-content: stretch;
    }
    .calendar-toolbar-actions button {
        min-width: 0;
        width: 100%;
        justify-content: center;
        padding: 10px 8px;
    }
    .calendar-toolbar-actions .calendar-segment,
    .calendar-toolbar-actions .btn-success {
        grid-column: 1 / -1;
    }
    .calendar-segment {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    .calendar-week-grid {
        display: flex;
        flex-direction: column;
        overflow-x: visible;
    }
    .calendar-day {
        min-height: 0;
    }
    .calendar-month-grid {
        display: none;
    }
    .calendar-form-grid {
        grid-template-columns: 1fr;
    }
    .calendar-audience-row {
        grid-template-columns: 1fr;
    }
    .calendar-student-results {
        position: static;
        margin-top: 8px;
        max-height: 220px;
    }
    .calendar-list-item {
        flex-direction: column;
    }
    .calendar-list-actions {
        width: 100%;
    }
    .calendar-list-actions button {
        flex: 1;
    }
    .calendar-modal-content {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        padding: 18px 16px 0;
    }
    .calendar-modal-actions {
        position: sticky;
        bottom: 0;
        margin: 18px -16px 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--card-bg);
        border-top: 1px solid var(--border);
        justify-content: stretch;
    }
    .calendar-modal-actions button {
        flex: 1 1 100%;
    }
    .calendar-save-settings {
        width: 100%;
        min-width: 0;
    }
    .student-calendar-card {
        grid-template-columns: 1fr;
    }
    .student-stats-head {
        flex-direction: column;
    }
    .student-stats-grid,
    .student-learning-columns {
        grid-template-columns: 1fr;
    }
    .student-course-row,
    .learning-list-item {
        grid-template-columns: 1fr;
    }
    .learning-list-item {
        flex-direction: column;
    }
    .learning-list-meta {
        align-items: flex-start;
        white-space: normal;
    }
    .discount-form-grid {
        grid-template-columns: 1fr !important;
    }
    .discount-form-grid button {
        width: 100%;
    }
    .trainer-catalog-toggle {
        grid-template-columns: 1fr 24px;
    }
    .trainer-catalog-toggle small {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .public-course-hero,
    .public-course-info {
        grid-template-columns: 1fr;
    }
}
.exam-page-heading,
.exam-section-heading,
.exam-card-title-row,
.exam-review-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.exam-page-heading {
    margin-bottom: 24px;
}

.exam-page-heading h2,
.exam-section-heading h3,
.exam-review-heading h2 {
    margin: 0;
    color: var(--text-bright);
}

.exam-page-heading h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exam-page-heading h2 i {
    color: var(--primary);
}

.exam-page-heading p,
.exam-section-heading p {
    margin: 7px 0 0;
    color: gray;
}

.exam-assignment-form {
    margin-bottom: 24px;
    border-color: rgba(0, 240, 255, 0.38);
}

.exam-form-grid,
.exam-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.exam-form-grid label,
.exam-wide-field,
.exam-dependent-setting {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.exam-form-grid label > span,
.exam-wide-field > span,
.exam-dependent-setting > span,
.exam-score-editor label > span {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.exam-field-note {
    color: gray;
    font-size: 11px;
    line-height: 1.4;
}

.exam-form-grid input,
.exam-form-grid select,
.exam-wide-field textarea,
.exam-dependent-setting input {
    margin: 0;
    border-color: rgba(0, 240, 255, 0.35);
    background: var(--input-bg);
}

.exam-date-input {
    position: relative;
}

.exam-date-input input {
    width: 100%;
}

.exam-date-input > span {
    position: absolute;
    top: 50%;
    left: 16px;
    color: gray;
    pointer-events: none;
    transform: translateY(-50%);
}

.exam-date-input:focus-within > span,
.exam-date-input.has-value > span {
    display: none;
}

.exam-wide-field {
    margin-top: 16px;
}

.exam-wide-field textarea {
    min-height: 92px;
}

.exam-setting-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 84px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    cursor: pointer;
}

.exam-setting-card input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.exam-setting-card span {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.exam-setting-card b {
    color: var(--text-bright);
}

.exam-setting-card small {
    color: gray;
    line-height: 1.4;
}

.exam-dependent-setting {
    display: none;
    justify-content: center;
    padding: 14px 16px;
    border: 1px dashed rgba(0, 240, 255, 0.4);
    border-radius: 10px;
}

.exam-dependent-setting.visible {
    display: flex;
}

.exam-score-explanation {
    color: gray;
    font-size: 12px;
    line-height: 1.45;
}

.exam-submit-assignment {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
}

.exam-filter-bar {
    display: flex;
    gap: 8px;
    padding: 6px;
    margin-bottom: 18px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
}

.exam-filter-bar button {
    min-width: max-content;
    padding: 10px 15px;
    border: 0;
    box-shadow: none;
    background: transparent;
    color: gray;
}

.exam-filter-bar button.active {
    color: var(--text-bright);
    background: rgba(0, 240, 255, 0.12);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.exam-card-list {
    display: grid;
    gap: 14px;
}

.exam-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    background: var(--card-bg);
}

.exam-card.warning {
    border-left-color: var(--warning);
}

.exam-card.success {
    border-left-color: var(--success);
}

.exam-card.danger {
    border-left-color: var(--danger);
}

.exam-card-main {
    min-width: 0;
    flex: 1;
}

.exam-card-title-row {
    align-items: center;
}

.exam-card-title-row h3 {
    margin: 0;
    color: var(--text-bright);
    overflow-wrap: anywhere;
}

.exam-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.exam-status.warning {
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 50%, transparent);
}

.exam-status.success {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 50%, transparent);
}

.exam-status.danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 50%, transparent);
}

.exam-card-person,
.exam-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
    color: gray;
    font-size: 13px;
}

.exam-card-person i,
.exam-card-meta i {
    margin-right: 5px;
    color: var(--primary);
}

.exam-card-score {
    margin-top: 12px;
    color: var(--success);
    font-size: 16px;
    font-weight: 900;
}

.exam-card-instructions {
    max-width: 900px;
    margin: 12px 0 0;
    color: var(--text);
    line-height: 1.5;
}

.exam-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    flex: 0 0 auto;
}

.exam-card-actions button {
    white-space: nowrap;
}

.exam-empty,
.exam-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 180px;
    color: gray;
    text-align: center;
}

.exam-empty i,
.exam-loading i {
    color: var(--primary);
    font-size: 34px;
}

.exam-empty b {
    color: var(--text-bright);
    font-size: 18px;
}

.exam-stats-grid,
.exam-review-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.exam-stats-grid > div,
.exam-review-summary > div {
    min-height: 92px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
}

.exam-trend-card {
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}

.exam-trend-card .exam-section-heading {
    margin-bottom: 10px;
}

.exam-trend-chart {
    width: 100%;
    height: 180px;
    overflow: visible;
}

.exam-trend-chart line {
    stroke: var(--border);
    stroke-width: 0.7;
}

.exam-trend-chart polyline {
    fill: none;
    stroke: var(--primary);
    stroke-width: 1.8;
    vector-effect: non-scaling-stroke;
}

.exam-trend-chart circle {
    fill: var(--success);
    stroke: var(--card-bg);
    stroke-width: 0.8;
    vector-effect: non-scaling-stroke;
}

.exam-trend-legend {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.exam-trend-legend button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    box-shadow: none;
    color: gray;
    white-space: nowrap;
}

.exam-trend-legend b {
    color: var(--primary);
}

.exam-stats-grid span,
.exam-review-summary span {
    display: block;
    color: gray;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.exam-stats-grid b,
.exam-review-summary b {
    display: block;
    margin-top: 8px;
    color: var(--primary);
    font-size: 25px;
}

.exam-attempt-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-bottom-color: var(--primary);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-bg) 94%, transparent);
    backdrop-filter: blur(14px);
}

.exam-attempt-header > button {
    background: transparent;
    box-shadow: none;
}

.exam-attempt-header span,
.exam-countdown-wrap span {
    color: gray;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.exam-attempt-header h2 {
    margin: 3px 0 0;
}

.exam-countdown-wrap {
    min-width: 112px;
    text-align: right;
}

.exam-countdown-wrap b {
    display: block;
    margin-top: 3px;
    color: var(--primary);
    font-size: 25px;
    font-variant-numeric: tabular-nums;
}

.exam-countdown-wrap b.danger {
    color: var(--danger);
}

.exam-instructions {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.06);
    color: var(--text);
    line-height: 1.5;
}

.exam-instructions i {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 20px;
}

.exam-question {
    padding: 22px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}

.exam-question-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.exam-question-heading h3 {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    color: var(--text-bright);
    line-height: 1.45;
}

.exam-question-heading h3 > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
}

.exam-question-heading > b {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(0, 240, 255, 0.09);
    color: var(--primary);
    font-size: 12px;
}

.exam-question-controls textarea,
.exam-question-controls input[type="text"],
.exam-question-controls select {
    margin: 0;
    color: var(--text-bright);
    border-color: rgba(0, 240, 255, 0.38);
    background: var(--input-bg);
}

.exam-question-controls textarea {
    width: 100%;
    min-height: 130px;
}

.exam-choice-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px;
    margin-bottom: 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    cursor: pointer;
}

.exam-choice-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(0, 240, 255, 0.08);
}

.exam-choice-option input {
    width: 19px;
    height: 19px;
    margin: 1px 0 0;
    flex: 0 0 auto;
}

.exam-choice-option img,
.exam-match-row img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
}

.exam-match-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
    gap: 14px;
    align-items: center;
    padding: 13px;
    margin-bottom: 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
}

.exam-match-row > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exam-order-box {
    display: grid;
    gap: 9px;
}

.exam-order-box .order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px;
    margin: 0;
    border: 1px solid var(--border);
    background: var(--input-bg);
    box-shadow: none;
    color: var(--text-bright);
    text-align: left;
}

.exam-order-box .order-item.selected-order {
    border-color: var(--primary);
    opacity: 0.72;
}

.exam-order-box .order-item b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 999px;
    background: var(--primary);
    color: #001014;
}

.exam-reset-order {
    justify-self: start;
    background: transparent;
    box-shadow: none;
    color: gray;
}

.exam-attempt-actions {
    position: sticky;
    z-index: 9;
    bottom: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-bg) 94%, transparent);
    backdrop-filter: blur(14px);
}

.exam-overlay {
    position: fixed;
    z-index: 10020;
    inset: 0;
    display: none;
    padding: 24px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.78);
}

.exam-overlay.open {
    display: block;
}

.exam-overlay-dialog {
    width: min(900px, 100%);
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--primary);
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

.exam-review-heading > div > span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.exam-review-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
}

.exam-review-question {
    padding: 20px;
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}

.exam-review-release {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-top: 14px;
    border: 1px solid rgba(0, 255, 128, 0.35);
    border-radius: 10px;
    background: rgba(0, 255, 128, 0.06);
}

.exam-review-release > i {
    color: var(--success);
    font-size: 28px;
}

.exam-review-release > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exam-review-release span {
    color: gray;
    line-height: 1.4;
}

.exam-review-question-title,
.exam-score-editor label > div,
.exam-result-question > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.exam-review-question-title h3,
.exam-result-question h3 {
    margin: 0;
    color: var(--text-bright);
}

.exam-review-question-title > span {
    flex: 0 0 auto;
    color: var(--primary);
    font-weight: 900;
}

.exam-answer-panel,
.exam-reference-panel {
    padding: 14px;
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
}

.exam-answer-panel > span,
.exam-reference-panel > span {
    color: gray;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.exam-answer-panel p,
.exam-reference-panel p {
    margin: 8px 0 0;
    color: var(--text-bright);
    line-height: 1.55;
}

.exam-score-editor {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 14px;
    margin-top: 15px;
}

.exam-score-editor label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.exam-score-editor input,
.exam-score-editor textarea {
    margin: 0;
    border-color: rgba(0, 240, 255, 0.38);
}

.exam-score-editor input {
    width: 90px;
}

.exam-score-editor input.invalid {
    border-color: var(--danger);
}

.exam-score-editor label > div {
    align-items: center;
    justify-content: flex-start;
}

.exam-review-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
}

.exam-review-footer p {
    margin: 0;
    color: gray;
    font-size: 13px;
}

.exam-result-hero {
    padding: 26px;
    margin-top: 20px;
    border: 1px solid rgba(0, 255, 153, 0.45);
    border-radius: 12px;
    background: rgba(0, 255, 153, 0.07);
    text-align: center;
}

.exam-result-hero span,
.exam-result-hero small {
    display: block;
    color: gray;
}

.exam-result-hero b {
    display: block;
    margin: 8px 0;
    color: var(--success);
    font-size: clamp(24px, 5vw, 40px);
}

.exam-result-question {
    padding: 16px;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--danger);
    border-radius: 9px;
    background: var(--bg);
}

.exam-result-question.success {
    border-left-color: var(--success);
}

.exam-result-question.warning {
    border-left-color: var(--warning);
}

.exam-result-question > div > b {
    flex: 0 0 auto;
    color: var(--primary);
}

.exam-result-question p {
    color: var(--text);
    line-height: 1.5;
}

.exam-result-question p span {
    color: gray;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

@media (max-width: 720px) {
    .exam-page-heading,
    .exam-card,
    .exam-review-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .exam-page-heading > button,
    .exam-card-actions button,
    .exam-review-footer button {
        width: 100%;
    }

    .exam-form-grid,
    .exam-option-grid,
    .exam-score-editor {
        grid-template-columns: 1fr;
    }

    .exam-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .exam-card-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .exam-card-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .exam-attempt-header {
        grid-template-columns: auto 1fr;
        padding: 12px;
    }

    .exam-attempt-header > button {
        width: 42px;
        overflow: hidden;
        white-space: nowrap;
    }

    .exam-attempt-header > button i {
        margin-right: 20px;
    }

    .exam-countdown-wrap {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-width: 0;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        text-align: left;
    }

    .exam-countdown-wrap b {
        margin: 0;
        font-size: 22px;
    }

    .exam-question {
        padding: 15px;
    }

    .exam-question-heading {
        flex-direction: column;
    }

    .exam-match-row {
        grid-template-columns: 1fr;
    }

    .exam-attempt-actions {
        bottom: 84px;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .exam-attempt-actions > button:first-child {
        overflow: hidden;
        white-space: nowrap;
        color: transparent;
    }

    .exam-attempt-actions > button:first-child i {
        color: var(--primary);
        margin-right: 20px;
    }

    .exam-overlay {
        padding: 8px;
    }

    .exam-overlay-dialog {
        padding: 16px;
    }

    .exam-review-summary {
        grid-template-columns: 1fr 1fr;
    }

    .exam-review-question {
        padding: 14px;
    }
}
