/* LOKAL Student App — ClassPoint-style Professional UI */

/* ===== JOIN SCREEN ===== */
.tab-monitor-notice { margin: 0 0 16px; padding: 11px 14px; border: 1px solid #b8d8d0; border-radius: 10px; background: #eff9f6; color: #165b50; font-size: 14px; line-height: 1.4; }
.student-app.dark-theme .tab-monitor-notice { background: #19302b; border-color: #385f54; color: #d4f3e9; }

.join-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.join-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: #f3f3f3;
}

.join-bg::before,
.join-bg::after {
    content: '';
    display: block;
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(170deg, #000 37%, #fff 45%),linear-gradient(46deg, #000 82%, #fff 97%),linear-gradient(134deg, #000 91%, #fff 109%),linear-gradient(108deg, #000 88%, #fff 98%),linear-gradient(120deg, #000 2%, #fff 8%),linear-gradient(164deg, #000 44%, #fff 62%),linear-gradient(136deg, #000 57%, #fff 72%),linear-gradient(85deg, #000 64%, #fff 65%),linear-gradient(40deg, #000 63%, #fff 77%),linear-gradient(153deg, #000 2%, #fff 13%),linear-gradient(100deg, #000 25%, #fff 35%),linear-gradient(33deg, #000 59%, #fff 65%),linear-gradient(102deg, #000 24%, #fff 41%),linear-gradient(115deg, #000 76%, #fff 91%),linear-gradient(130deg, #000 45%, #fff 53%),linear-gradient(74deg, #000 11%, #fff 14%),linear-gradient(37deg, #000 61%, #fff 73%),linear-gradient(49deg, #000 83%, #fff 92%),linear-gradient(126deg, #000 71%, #fff 79%),linear-gradient(152deg, #000 94%, #fff 95%),linear-gradient(153deg, #000 43%, #fff 59%),linear-gradient(155deg, #000 60%, #fff 80%),linear-gradient(160deg, #000 13%, #fff 18%),linear-gradient(54deg, #000 4%, #fff 24%),linear-gradient(155deg, #000 73%, #fff 89%),linear-gradient(136deg, #000 69%, #fff 83%),linear-gradient(107deg, #000 35%, #fff 42%),linear-gradient(93deg, #000 2%, #fff 8%),linear-gradient(87deg, #000 56%, #fff 57%),linear-gradient(159deg, #000 41%, #fff 56%),linear-gradient(92deg, #000 40%, #fff 56%),linear-gradient(100deg, #000 45%, #fff 56%),linear-gradient(117deg, #000 17%, #fff 37%),linear-gradient(139deg, #000 64%, #fff 66%),linear-gradient(57deg, #000 46%, #fff 52%),linear-gradient(115deg, #000 3%, #fff 23%),linear-gradient(115deg, #000 69%, #fff 75%),linear-gradient(161deg, #000 95%, #fff 110%),linear-gradient(132deg, #000 96%, #fff 116%),linear-gradient(177deg, #000 49%, #fff 57%);
    background-blend-mode: difference;
    filter: grayscale(1);
    opacity: 1;
}

.join-bg::after {
    filter: grayscale(1) invert(1);
    opacity: 0.5;
    top: 1px;
}

.join-bg-overlay {
    /* Explicit neutral overlay shared with the teacher sign-in page. */
    background: transparent;
    mix-blend-mode: normal;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    z-index: 1;
}

.join-card {
    position: relative;
    z-index: 10;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: fadeInUp 0.5s ease;
}

.join-step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.join-logo {
    margin-bottom: 32px;
}

.join-logo-icon {
    width: 72px;
    height: 72px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 12px;
    box-shadow: 0 8px 24px var(--brand-shadow);
}

.join-logo h1 {
    color: #111111;
    font-size: var(--font-2xl);
    font-weight: 700;
    letter-spacing: 1px;
}

.join-class-info {
    margin-bottom: 28px;
}

.join-code-label {
    display: block;
    color: #555555;
    font-size: var(--font-sm);
    margin-bottom: 4px;
}

.join-code-value {
    color: #111111;
    font-size: var(--font-xl);
    font-weight: 700;
    letter-spacing: 2px;
}

.join-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

.join-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    cursor: pointer;
}

.join-avatar-edit-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #4b5563;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.avatar-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.avatar-modal-content {
    background: #2b2b2b;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    overflow: hidden;
    color: white;
}

.avatar-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #3a3a3a;
}

.avatar-modal-header span {
    flex: 1;
    margin-left: 10px;
    font-weight: 600;
}

.avatar-modal-header .close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.avatar-crop-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #111;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    pointer-events: none;
}
.crop-overlay::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
}

.avatar-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    background: #2b2b2b;
}

.avatar-zoom-controls input[type="range"] {
    flex: 1;
    max-width: 200px;
}

.avatar-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: #2b2b2b;
}

.avatar-modal-footer .btn-text {
    background: none;
    border: none;
    color: #a0a0a0;
    font-weight: 600;
    cursor: pointer;
}

.avatar-modal-footer .btn-primary {
    background: var(--primary);
    border: none;
    color: white;
    padding: 8px 24px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

.avatar-modal-footer .btn-text.danger {
    color: #ef4444;
}

.join-input-group {
    width: 100%;
    margin-bottom: 24px;
}

.join-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #aaaaaa;
    color: #111111;
    font-size: var(--font-lg);
    text-align: center;
    padding: 12px 0;
    outline: none;
    font-weight: 500;
    letter-spacing: 1px;
    transition: border-color var(--transition-base);
}

.join-input::placeholder {
    color: #888888;
    letter-spacing: 0;
    font-weight: 400;
}

.join-input:focus {
    border-bottom-color: #111111;
}

.input-error {
    color: #ef4444; /* Red color */
    font-size: var(--font-sm);
    text-align: center;
    margin-top: 4px;
    display: none;
    animation: fadeInUp 0.3s ease;
}

.join-submit-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 16px var(--brand-shadow);
}

.join-submit-btn:hover {
    transform: scale(1.08);
    background: var(--primary-hover);
}

.join-go-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 48px;
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 16px rgba(18, 84, 75, 0.3);
}

.join-go-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--brand-shadow);
}

.join-footer {
    color: #888888;
    font-size: var(--font-xs);
    margin-top: 40px;
}

/* ===== STUDENT DASHBOARD ===== */
#student-dashboard {
    min-height: 100vh;
    background: #f4f4f5; /* Subtle premium gray */
    color: #18181b;
    display: flex;
    flex-direction: column;
}

.student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e4e4e7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.student-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.student-logo-text {
    color: var(--brand-500);
    font-weight: 700;
    font-size: var(--font-base);
}

.student-header-center {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555555;
    font-size: var(--font-sm);
}

.code-badges {
    display: flex;
    gap: 4px;
}

.code-badge {
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-sm);
    color: #0f172a;
}

.student-menu-btn {
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: var(--radius-md);
    color: #18181b;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.student-menu-btn:hover {
    background: #e4e4e7;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    z-index: 100;
    border: 1px solid #e4e4e7;
    overflow: hidden;
    animation: fadeInUp 0.2s ease;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 14px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ef4444; /* Red for logout */
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background-color: #fef2f2;
}

/* Body layout */
.student-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.student-slide-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.slide-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.slide-footer {
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.teacher-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.teacher-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.student-sidebar {
    width: 380px;
    background: #ffffff;
    border-left: 1px solid #e4e4e7;
    box-shadow: -4px 0 24px rgba(0,0,0,0.03);
    overflow-y: auto;
    padding: 28px;
    display: flex;
    flex-direction: column;
}

/* Waiting state */
.waiting-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #333333;
}

.waiting-state h3 {
    font-size: var(--font-lg);
    font-weight: 600;
}

.waiting-subtitle {
    font-size: var(--font-sm);
    color: #666666;
}

.hourglass-icon {
    font-size: 64px;
    animation: hourglassRotate 2s ease-in-out infinite;
}

@keyframes hourglassRotate {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(180deg); }
}

/* Student profile sidebar */
.student-profile {
    text-align: center;
}

.student-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: #e0e0e0;
    color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    font-weight: 700;
    margin: 0 auto 8px;
}

.student-profile-name {
    color: #111111;
    font-weight: 700;
    font-size: var(--font-base);
    margin-bottom: 16px;
}

.student-stars-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
}

.student-stars-value {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--warning);
}

/* ===== MULTIPLE CHOICE ANSWER UI ===== */
.mc-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: activityPanelIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes activityPanelIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: var(--font-base);
}

.activity-header-icon {
    font-size: 18px;
}

.activity-instruction {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    font-size: var(--font-sm);
    color: #555555;
    line-height: 1.6;
}

.instruction-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-full);
    background: #dddddd;
    color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    font-weight: 700;
}

.activity-instruction .highlight {
    background: var(--warning);
    color: #1a1a2e;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: var(--font-xs);
    letter-spacing: 0.5px;
    display: inline-block;
    vertical-align: middle;
}

/* Answer Grid — ClassPoint Style (solid colored buttons) */
.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    flex: 1;
}

.answer-grid-8 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.answer-btn {
    background: var(--btn-color, #E8705A);
    border: 3px solid transparent;
    border-radius: 12px;
    color: white;
    padding: 0;
    min-height: 72px;
    font-size: var(--font-lg);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.answer-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.answer-btn:active {
    transform: scale(0.97);
}

.answer-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,.28), transparent 60%);
    opacity: 0;
    transform: scale(.55);
    transition: opacity .22s ease, transform .22s ease;
}

.answer-btn.selected::after {
    opacity: 1;
    transform: scale(1.25);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.answer-btn.selected {
    opacity: 1;
    border-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.answer-btn.selected .answer-letter {
    transform: scale(1.15);
}

.answer-letter {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0;
    transition: transform 0.2s ease;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.answer-letter.poll-label { font-size: clamp(.82rem, 2.6vw, 1.1rem); line-height: 1.18; padding: 8px; text-align: center; overflow-wrap: anywhere; }

.quick-poll-container .activity-header > span:last-child {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.quick-poll-container .activity-header small {
    color: #64748b;
    font-size: .72rem;
    font-weight: 600;
}

.quick-poll-grid .answer-btn {
    min-height: 82px;
    border-radius: 14px;
    opacity: .94;
}

.quick-poll-true_false .choice-A,
.quick-poll-yes_no_unsure .choice-A { --btn-color: #159a74; }
.quick-poll-true_false .choice-B,
.quick-poll-yes_no_unsure .choice-B { --btn-color: #dc5b5b; }
.quick-poll-yes_no_unsure .choice-C { --btn-color: #d4932f; }
.quick-poll-feedback .choice-A { --btn-color: #c94f55; }
.quick-poll-feedback .choice-B { --btn-color: #dc7a45; }
.quick-poll-feedback .choice-C { --btn-color: #c69a2f; }
.quick-poll-feedback .choice-D { --btn-color: #5c9d85; }
.quick-poll-feedback .choice-E { --btn-color: #177e68; }
.quick-poll-custom .choice-A { --btn-color: #147d6c; }
.quick-poll-custom .choice-B { --btn-color: #3972c5; }
.quick-poll-custom .choice-C { --btn-color: #c46b3c; }
.quick-poll-custom .choice-D { --btn-color: #8466b3; }
.quick-poll-custom .choice-E { --btn-color: #278d9b; }
.quick-poll-custom .choice-F { --btn-color: #a85a83; }

/* Submit Button */
.submit-answer-btn {
    width: 100%;
    padding: 16px;
    background: #f8fafc;
    color: #94a3b8;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: var(--font-base);
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    flex-shrink: 0;
}

.submit-answer-btn .submit-btn-icon {
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.submit-answer-btn.ready {
    background: linear-gradient(135deg, var(--brand-500), var(--primary-hover));
    color: white;
    border-color: transparent;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--brand-shadow);
}

.submit-answer-btn.ready .submit-btn-icon {
    opacity: 1;
}

.submit-answer-btn.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(18, 84, 75, 0.38);
}

.submit-answer-btn.ready:hover .submit-btn-icon {
    transform: translateX(3px);
}

.submit-answer-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Submitted Confirmation */
.submitted-state {
    text-align: center;
    padding: 24px 0;
    animation: fadeInUp 0.4s ease;
}

.submitted-check {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
	color: #fff;
	font-size: 48px;
	line-height: 1;
}

.submitted-answers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.submitted-answer-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: var(--font-lg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.submitted-message {
    font-size: var(--font-base);
    color: #334155;
    line-height: 1.5;
    font-weight: 500;
    margin-bottom: 8px;
}

.submitted-time {
    font-size: var(--font-sm);
    color: #94a3b8;
}

/* ===== WORD CLOUD + FILL IN THE BLANKS ===== */
.response-activity-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    animation: activityPanelIn .42s cubic-bezier(.2,.8,.2,1);
}

.word-cloud-entry-list,
.fill-blank-entry-list {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    overflow-y: auto;
    padding-right: 3px;
}

.response-text-field {
    position: relative;
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: .78rem;
    font-weight: 700;
}

.response-text-field > span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.response-text-field > span i {
    display: inline-grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    color: white;
    background: var(--primary);
    font-size: .7rem;
    font-style: normal;
}

.response-text-field > div {
    position: relative;
    display: flex;
}

.response-text-field input {
    width: 100%;
    min-width: 0;
    padding: 13px 42px 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    outline: none;
    color: #0f172a;
    background: white;
    font: 500 .92rem var(--font-family);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.response-text-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11,31,28,.12);
}

.response-text-field > div > button {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 28px;
    height: 28px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    color: #64748b;
    background: #eef2f6;
    font-size: 20px;
    cursor: pointer;
}

.response-text-field small {
    justify-self: end;
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 500;
}

.response-text-field small b { font-weight: 700; }

.response-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 16px;
    color: #94a3b8;
    font-size: .75rem;
}

.response-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    color: var(--primary);
    background: white;
    font: 700 .76rem var(--font-family);
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.response-add-button:hover { border-color: var(--primary); background: #f1f5f9; transform: translateY(-1px); }
.response-add-button:focus-visible { outline: 3px solid rgba(11,111,98,.18); outline-offset: 2px; }
.response-add-button svg { flex: 0 0 auto; }
.response-add-button[hidden] { display: none; }

.submitted-response-container .submitted-answers {
    flex-wrap: wrap;
}

.submitted-answer-chip {
    max-width: 100%;
    padding: 9px 12px;
    overflow-wrap: anywhere;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    color: white;
    background: rgba(255,255,255,.1);
    font-size: .8rem;
    font-weight: 700;
}

.submitted-blank-list {
    display: grid;
    width: 100%;
    gap: 8px;
    text-align: left;
}

.submitted-blank-list > div {
    display: grid;
    grid-template-columns: 28px minmax(0,1fr);
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    color: white;
    background: rgba(255,255,255,.08);
}

.submitted-blank-list i {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    font-size: .7rem;
    font-style: normal;
    font-weight: 800;
}

.submitted-blank-list span { min-width: 0; overflow-wrap: anywhere; }

.revealed-results { width: 100%; display: grid; gap: 8px; margin-top: 14px; }
.revealed-results h3 { margin: 0 0 4px; color: #fff; font-size: 1rem; }
.revealed-blank-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; text-align: left; background: rgba(255,255,255,.12); }
.revealed-blank-row.correct { border: 1px solid rgba(134,239,172,.72); }
.revealed-blank-row.incorrect { border: 1px solid rgba(253,164,175,.72); }
.revealed-result-icon { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.94); color: var(--primary); font-weight: 800; }
.revealed-blank-row.incorrect .revealed-result-icon { color: #be123c; }
.revealed-blank-row strong, .revealed-blank-row small { display: block; overflow-wrap: anywhere; }
.revealed-blank-row small { margin-top: 3px; color: rgba(255,255,255,.8); }
.revealed-answer-summary { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 14px; border-radius: 14px; text-align: left; background: rgba(255,255,255,.12); }
.revealed-answer-summary.correct { border: 1px solid rgba(134,239,172,.72); }
.revealed-answer-summary.incorrect { border: 1px solid rgba(253,164,175,.72); }
.revealed-answer-summary.incorrect .revealed-result-icon { color: #be123c; }
.revealed-answer-summary h3 { margin: 0 0 6px; }
.revealed-answer-summary p { margin: 3px 0; color: rgba(255,255,255,.9); line-height: 1.4; overflow-wrap: anywhere; }
.submitted-closed-note { margin: 10px 0 0; padding: 9px 12px; border-radius: 999px; color: rgba(255,255,255,.9); background: rgba(255,255,255,.12); font-size: .78rem; font-weight: 700; text-align: center; }
.activity-closed-card .revealed-results { color: var(--text-primary); }
.activity-closed-card .revealed-answer-summary { background: #f1f5f9; }
.activity-closed-card .revealed-answer-summary p { color: var(--text-secondary); }
.activity-closed-card .revealed-results h3 { color: var(--text-primary); }
.activity-closed-card .revealed-blank-row { background: #f1f5f9; color: var(--text-primary); }
.activity-closed-card .revealed-blank-row small { color: var(--text-secondary); }

/* Slide preview */
.slide-preview {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-primary);
    box-shadow: var(--shadow-xl);
}

.slide-preview h2 {
    font-size: var(--font-2xl);
    margin-bottom: 20px;
}

.slide-options {
    text-align: left;
    font-size: var(--font-lg);
    line-height: 2;
}

.slide-activity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 500;
    margin-top: 16px;
}

.slide-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 700;
    margin-top: 16px;
    margin-left: 8px;
    transition: background 0.3s;
}

.slide-timer-badge.danger {
    background: #e11d48;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.activity-answering .cp-slide-area { padding-bottom: 14px; }
.activity-answering .cp-student-strip { display: none !important; }

.student-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.student-identity-name {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 750;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.student-progress-caption {
    margin-top: 3px;
    color: rgba(255,255,255,.52);
    font-size: .78rem;
}

.student-progress-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(82px, 104px));
    gap: 10px;
}

.student-progress-card {
    min-height: 72px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.075);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.student-progress-card > span {
    color: rgba(255,255,255,.58);
    font-size: .72rem;
    font-weight: 650;
}

.student-progress-card > div {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #fff;
}

.student-progress-card strong { font-size: 1.04rem; }
.recent-plus { color: #2dd36f; font-size: 1rem; }
.lokal-star-svg { flex: 0 0 auto; color: #fbbf24; filter: drop-shadow(0 3px 5px rgba(245,158,11,.18)); line-height: 1; }

.student-level-badge {
    width: 56px;
    height: 53px;
    margin-top: 2px;
    display: block;
    background-image: url('/assets/level-badges.png?v=19');
    background-size: 1120px 53px;
    background-position: calc(var(--level-index) * -56px) center;
    background-repeat: no-repeat;
}

.student-level-milestone {
    position: fixed;
    z-index: 10020;
    inset: 0;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    display: grid;
    place-items: center;
    background: rgba(8, 29, 26, .46);
    color: #fff;
    pointer-events: none;
    text-align: center;
    animation: lokal-milestone-enter .28s ease-out both;
}
.milestone-content { display: grid; justify-items: center; gap: 12px; width: min(360px, 100%); box-sizing: border-box; padding: 24px 20px 28px; background: transparent; text-shadow: 0 3px 14px #061b18, 0 1px 3px #061b18; }
.milestone-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .2em; color: #bbfff0; }
.milestone-content strong { font-size: clamp(1.5rem, 6vw, 2.1rem); line-height: 1.2; }
.milestone-caption { font-size: .95rem; line-height: 1.45; color: #e3fff7; max-width: 28ch; }
.milestone-badge { position: relative; isolation: isolate; width: clamp(132px, 34vw, 190px); height: clamp(132px, 34vw, 190px); margin: 6px 0; }
.milestone-badge::before { content: ''; position: absolute; z-index: -1; inset: -25%; border-radius: 50%; background: radial-gradient(circle, #c4ffeb80, #76ebca30 40%, transparent 70%); animation: lokal-milestone-glow 1.6s ease-out 2; }
.milestone-badge svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 12px 20px #001e2466); animation: lokal-level-unlock 1.1s cubic-bezier(.2,.8,.2,1) both; transform-origin: center; }
.milestone-unlocked { animation: lokal-level-unlock 1.1s ease-in-out; }
.student-level-milestone.milestone-leaving { animation: lokal-milestone-exit .3s ease-in both; }
@keyframes lokal-level-unlock {
    0% { transform: scale(.45) rotate(-14deg); opacity: 0; }
    50% { transform: scale(1.12) rotate(4deg); opacity: 1; }
    75% { transform: scale(.97) rotate(-2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes lokal-milestone-glow { 0% { transform: scale(.7); opacity: .2; } 55% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: .6; } }
@keyframes lokal-milestone-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes lokal-milestone-exit { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .student-level-milestone, .student-level-milestone.milestone-leaving,
    .milestone-badge svg, .milestone-badge::before, .milestone-unlocked { animation: none; }
}

@media (max-width: 720px) {
    .student-progress-cards { grid-template-columns: repeat(3, 1fr); }
}

.activity-closed-card {
    margin: auto;
    padding: 34px 22px;
    text-align: center;
    color: #fff;
    animation: activityPanelIn .35s ease;
}

.activity-closed-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 34px;
    font-weight: 800;
    background: linear-gradient(135deg, #22c55e, #14b8a6);
    box-shadow: 0 12px 30px rgba(34,197,94,.25);
}

.activity-closed-card p { color: rgba(255,255,255,.65); }

.activity-timeout-card .timeout-lottie {
    display: block;
    width: clamp(150px, 45vw, 230px);
    height: clamp(150px, 45vw, 230px);
    margin: 0 auto 8px;
}

.star-reward-float {
    position: fixed;
    left: 50%;
    top: 44%;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.35);
    contain: layout paint;
    will-change: transform, opacity;
}

.star-reward-float.playing {
    animation: starRewardFloat 1.45s cubic-bezier(.18,.78,.25,1) both;
}

.star-reward-float.leaving {
    animation: starRewardOut .26s ease-in forwards;
}

.star-reward-icon {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 16px 22px rgba(255, 174, 0, .32));
}

.star-reward-count {
    padding: 8px 16px;
    border-radius: 999px;
    color: #5c3b00;
    background: rgba(255, 250, 229, .96);
    box-shadow: 0 10px 26px rgba(81, 54, 0, .18);
    font-size: 1rem;
    font-weight: 800;
}

@keyframes starRewardFloat {
    0% { opacity: 0; transform: translate(-50%, -22%) rotate(-14deg) scale(.35); }
    22% { opacity: 1; transform: translate(-50%, -50%) rotate(7deg) scale(1.14); }
    42% { transform: translate(-50%, -50%) rotate(-3deg) scale(.98); }
    72% { opacity: 1; transform: translate(-50%, -57%) rotate(0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -82%) rotate(3deg) scale(.86); }
}

@keyframes starRewardOut {
    to { opacity: 0; transform: translate(-50%, -78%) scale(.82); }
}

@media (prefers-reduced-motion: reduce) {
    .star-reward-float.playing {
        animation: starRewardReduced 1.45s ease both;
    }

    @keyframes starRewardReduced {
        0%, 100% { opacity: 0; }
        15%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    }
}

/* Student theme control and the restored default presentation theme. */
.student-app .theme-toggle-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: var(--student-ink);
    cursor: pointer;
}

.student-app .dropdown-divider {
    height: 1px;
    margin: 5px 7px;
    background: var(--student-border);
}

.student-app .theme-switch {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #ced8d5;
    transition: background .18s ease;
}

.student-app .theme-switch > span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform .18s ease;
}

.student-app .theme-toggle-item[aria-pressed="true"] .theme-switch {
    background: var(--student-primary);
}

.student-app .theme-toggle-item[aria-pressed="true"] .theme-switch > span {
    transform: translateX(16px);
}

/* Keep the primary action reachable when short browser windows make the
   response list scroll. The surrounding panel remains the scroll container. */
.student-app .submit-answer-btn {
    position: sticky;
    bottom: 0;
    z-index: 6;
    margin-top: 16px;
    box-shadow: 0 -12px 22px 3px rgba(255, 255, 255, .94);
}

.student-app .submit-answer-btn.ready {
    box-shadow: 0 -12px 22px 3px rgba(255, 255, 255, .94), 0 7px 18px rgba(11,111,98,.2);
}

.student-app.dark-theme {
    --student-primary-soft: #173b34;
    --student-primary-strong: #86e4cf;
    --student-ink: #f4f7f6;
    --student-muted: #aab5b1;
    --student-border: #39413e;
    --student-surface: #202422;
    --student-canvas: #171a19;
    color: #f4f7f6;
    background: #171a19 !important;
}

.student-app.dark-theme .cp-header {
    border-bottom-color: #303633;
    color: #f4f7f6;
    background: #191d1b;
    box-shadow: 0 1px 10px rgba(0,0,0,.28);
}

.student-app.dark-theme .cp-brand-name,
.student-app.dark-theme .cp-code-label { color: #e9efec; }
.student-app.dark-theme .cp-code-label { color: #9da8a4; }

.student-app.dark-theme .cp-code-badges .code-badge {
    border-color: #3b4945;
    color: #e8f7f3;
    background: #29312e;
}

.student-app.dark-theme .cp-menu-btn {
    border-color: #3a433f;
    color: #eef4f2;
    background: #242a27;
}

.student-app.dark-theme .cp-menu-btn:hover { background: #303733; }

.student-app.dark-theme .dropdown-content {
    border-color: #3a433f;
    color: #f4f7f6;
    background: #252b28;
    box-shadow: 0 20px 48px rgba(0,0,0,.38);
}

.student-app.dark-theme .dropdown-divider { background: #3b4440; }
.student-app.dark-theme .theme-toggle-item { color: #edf3f1; }
.student-app.dark-theme .theme-toggle-item:hover { background: #303733; }
.student-app.dark-theme .dropdown-item:not(.theme-toggle-item) { color: #ffaaaa; }
.student-app.dark-theme .dropdown-item:not(.theme-toggle-item):hover { background: #3b2929; }

.student-app.dark-theme .cp-body { background: #171a19; }
.student-app.dark-theme .cp-slide-area { background: #181c1b; }

.student-app.dark-theme .cp-slide-wrapper {
    border-color: #343c39;
    background: #242927;
    box-shadow: 0 14px 38px rgba(0,0,0,.3);
}

.student-app.dark-theme .cp-slide-container { background: #f7f8f8; }

.student-app.dark-theme .slide-text-fallback {
    border-color: #dfe5e3;
    color: #17231f;
    background: white;
}

.student-app.dark-theme .slide-text-fallback h2 { color: #17231f; }
.student-app.dark-theme .slide-text-fallback > p { color: #62706c; }

.student-app.dark-theme .cp-teacher-strip {
    border-top-color: #363e3b;
    color: #f4f7f6;
    background: #252a28;
}

.student-app.dark-theme .teacher-avatar-fallback {
    color: #9fe0d2;
    background: #173b34;
}

.student-app.dark-theme .teacher-name { color: #f4f7f6; }
.student-app.dark-theme .teacher-role { color: #aab5b1; }
.student-app.dark-theme .fullscreen-btn {
    border-color: #3c4541;
    color: #dce5e2;
    background: #2d3431;
}

.student-app.dark-theme .cp-student-strip {
    border-color: #373f3c;
    color: #f4f7f6;
    background: #232825;
    box-shadow: 0 9px 26px rgba(0,0,0,.24);
}

.student-app.dark-theme .student-identity-name { color: #f5f8f7; }
.student-app.dark-theme .student-progress-caption { color: #9fa9a6; }
.student-app.dark-theme .student-avatar-image { border-color: #41645b; }
.student-app.dark-theme .student-avatar-fallback { background: #0b806f; }

.student-app.dark-theme .student-progress-card {
    border-color: #3c4541;
    color: #f4f7f6;
    background: #2d3431;
}

.student-app.dark-theme .student-progress-card > span { color: #aeb8b4; }
.student-app.dark-theme .student-progress-card strong { color: #fff; }
.student-app.dark-theme .student-progress-card .lokal-star-svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.28));
}

.student-app.dark-theme .cp-sidebar {
    border-left-color: #111412;
    color: #f4f7f6;
    background: #202422;
}

.student-app.dark-theme .mc-container,
.student-app.dark-theme .response-activity-container { color: #f4f7f6; }

.student-app.dark-theme .activity-header {
    border-bottom-color: #3b433f;
    color: #f4f7f6;
    background: #202422;
}

.student-app.dark-theme .submitted-response-container,
.student-app.dark-theme .submitted-response-container .activity-header {
    background: #202422;
}

.student-app.dark-theme .activity-header-icon {
    color: #71d6c3;
    background: #183a33;
}

.student-app.dark-theme .activity-heading-copy small { color: #71d6c3; }
.student-app.dark-theme .activity-heading-copy strong { color: #f5f8f7; }

.student-app.dark-theme .activity-instruction {
    border-color: #3a433f;
    color: #d7dfdc;
    background: #292f2c;
}

.student-app.dark-theme .instruction-avatar {
    color: white;
    background: #0b806f;
}

.student-app.dark-theme .instruction-detail { color: #9fa9a6; }

.student-app.dark-theme .answer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 0 0 auto;
}

.student-app.dark-theme .answer-btn,
.student-app.dark-theme .quick-poll-grid .answer-btn {
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    min-height: 78px;
    border: 1px solid #414a46;
    color: #f6f8f7;
    background: #2a302d;
}

.student-app.dark-theme .answer-btn:hover {
    border-color: #586660;
    background: #323936;
    box-shadow: 0 7px 18px rgba(0,0,0,.2);
}

.student-app.dark-theme .answer-choice-marker {
    width: 48px;
    height: 48px;
    border: 0;
    color: color-mix(in srgb, var(--choice-color) 70%, white);
    background: transparent;
    font-size: 1.45rem;
}

.student-app.dark-theme .answer-letter,
.student-app.dark-theme .answer-btn.selected .answer-letter {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.student-app.dark-theme .answer-selection-icon {
    position: absolute;
    top: 9px;
    right: 9px;
    border-color: #56605c;
    background: #242927;
}

.student-app.dark-theme .answer-btn.selected {
    border-color: #38bba2;
    background: #163d35;
    box-shadow: 0 0 0 2px rgba(56,187,162,.13);
}

.student-app.dark-theme .answer-btn.selected .answer-selection-icon {
    border-color: #35b79e;
    background: #168672;
}

.student-app.dark-theme .submit-answer-btn {
    border: 1px solid #414946;
    color: #8f9995;
    background: #303633;
    box-shadow: 0 -13px 22px 4px rgba(32, 36, 34, .97);
}

.student-app.dark-theme .submit-answer-btn.ready {
    border-color: transparent;
    color: white;
    background: #0b806f;
    box-shadow: 0 -13px 22px 4px rgba(32, 36, 34, .97), 0 8px 20px rgba(0,0,0,.25);
}

.student-app.dark-theme .submit-answer-btn.ready:hover { background: #0a6c5e; }

.student-app.dark-theme .response-text-field { color: #e6ece9; }
.student-app.dark-theme .response-text-field input {
    border-color: #444d49;
    color: #f7f9f8;
    background: #2b312e;
}
.student-app.dark-theme .response-text-field input::placeholder { color: #87918d; }
.student-app.dark-theme .response-add-button {
    border-color: #444d49;
    color: #bceadd;
    background: #2b312e;
}

.student-app.dark-theme .submitted-state,
.student-app.dark-theme .activity-closed-card {
    border-color: #3a433f;
    color: #f4f7f6;
    background: #272d2a;
}

.student-app.dark-theme .submitted-title,
.student-app.dark-theme .activity-closed-card h3 { color: #f4f7f6; }
.student-app.dark-theme .submitted-message,
.student-app.dark-theme .activity-closed-card p,
.student-app.dark-theme .submitted-time { color: #aab5b1; }

.student-app.dark-theme .submitted-answer-badge,
.student-app.dark-theme .submitted-answer-chip {
    border-color: #397d70;
    color: #c6f1e7;
    background: #173a33;
}

.student-app.dark-theme .change-answer-btn {
    border-color: #46534e;
    color: #bceadd;
    background: #2e3532;
}

.student-app.dark-theme .waiting-state {
    border-color: #3a433f;
    color: #f4f7f6;
    background: #252b28;
}
.student-app.dark-theme .waiting-state h3 { color: #f4f7f6; }
.student-app.dark-theme .waiting-subtitle { color: #aab5b1; }
.student-app.dark-theme .waiting-icon { color: #75dac7; background: #173a33; }

@media (max-width: 760px) {
    .student-app.dark-theme .cp-sidebar {
        border-top-color: #111412;
        border-left: 0;
    }
    .student-app.dark-theme .cp-slide-area { background: #181c1b; }
    .student-app .submit-answer-btn,
    .student-app.dark-theme .submit-answer-btn,
    .student-app.dark-theme .submit-answer-btn.ready {
        position: static;
        box-shadow: none;
    }
}

@media (max-width: 460px) {
    .student-app.dark-theme .answer-grid,
    .student-app.dark-theme .quick-poll-grid { grid-template-columns: minmax(0, 1fr); }
    .student-app.dark-theme .answer-btn,
    .student-app.dark-theme .quick-poll-grid .answer-btn { min-height: 60px; }
    .student-app.dark-theme .answer-choice-marker { width: 38px; height: 38px; font-size: 1.2rem; }
}

/* Live star podium: stable between presentation broadcasts. */
.student-app .live-leaderboard-overlay {
    position: fixed; inset: 0; z-index: 1450; display: flex; box-sizing: border-box;
    height: 100dvh; min-height: 0; padding: max(16px, env(safe-area-inset-top)) 20px max(16px, calc(env(safe-area-inset-bottom) + var(--student-browser-bottom, 0px)));
    padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right));
    align-items: center; flex-direction: column; overflow: hidden; color: #17302a; background: #eef7f4;
}
.student-app .live-leaderboard-overlay [hidden] { display: none !important; }
.student-app.dark-theme .live-leaderboard-overlay { color: #f3faf7; background: #101a17; }
.student-app .live-leaderboard-content {
    position: relative; z-index: 1; flex: 1 1 0; width: 100%; min-height: 0; min-width: 0; box-sizing: border-box;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 8px 20px;
}
.student-app .live-leaderboard-content:focus-visible { outline: 2px solid #3DAF94; outline-offset: -3px; border-radius: 8px; }
.student-app .live-leaderboard-footer { position: relative; z-index: 1; flex: 0 0 auto; width: 100%; padding-top: 12px; }
.student-app .live-leaderboard-confetti { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.student-app .live-leaderboard-brand {
    position: absolute; top: max(18px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); z-index: 2;
    width: clamp(30px, 4vw, 42px); height: clamp(30px, 4vw, 42px); object-fit: contain;
}
.student-app .live-leaderboard-heading { position: relative; z-index: 1; margin: clamp(36px, 7vh, 72px) 0 28px; text-align: center; }
.student-app .live-leaderboard-kicker { color: #0b8b73; font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.student-app.dark-theme .live-leaderboard-kicker { color: #69d6bd; }
.student-app .live-leaderboard-heading h2 { margin: 7px 0 6px; color: inherit; font-size: clamp(25px, 5vw, 42px); line-height: 1.08; }
.student-app .live-leaderboard-heading p { margin: 0; color: inherit; font-size: clamp(12px, 2.2vw, 15px); opacity: .68; }
.student-app .live-podium {
    position: relative; z-index: 1; display: grid; width: min(100%, 780px);
    grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: clamp(10px, 2vw, 22px);
    margin: 0 auto;
}
.student-app .live-podium[data-count="2"] { width: min(100%, 530px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.student-app .live-podium[data-count="1"] { width: min(68%, 260px); grid-template-columns: minmax(0, 1fr); }
.student-app .live-podium-place {
    --podium-height: 216px; --podium-trim: #F4D77B; --podium-side: #9A6D2A; --podium-label: #53360D;
    --podium-face-light: #FFF1B5; --podium-face-mid: #E3B23C; --podium-face-dark: #BA821E;
    display: flex; min-width: 0; flex-direction: column;
    text-align: center;
}
.student-app .live-podium-rank-1 { order: 2; }
.student-app .live-podium-rank-2 {
    order: 1; --podium-height: 176px; --podium-trim: #DDE6EE; --podium-side: #687888; --podium-label: #293746;
    --podium-face-light: #F4F6FA; --podium-face-mid: #BFCAD4; --podium-face-dark: #91A0B0;
}
.student-app .live-podium-rank-3 {
    order: 3; --podium-height: 144px; --podium-trim: #E4AE83; --podium-side: #7C472C; --podium-label: #4D260F;
    --podium-face-light: #F0C29C; --podium-face-mid: #CC8953; --podium-face-dark: #A46238;
}
.student-app .live-podium-identity { display: flex; min-width: 0; align-items: center; flex-direction: column; padding-top: 34px; }
.student-app .live-podium-avatar-stack { position: relative; max-width: 100%; margin-bottom: 3px; }
.student-app .live-podium-profiles { display: flex; align-items: center; justify-content: center; }
.student-app .live-podium-avatar {
    position: relative; display: grid; flex: 0 0 clamp(42px, 6vw, 66px);
    width: clamp(42px, 6vw, 66px); height: clamp(42px, 6vw, 66px);
    box-sizing: border-box; place-items: center; overflow: hidden; border: 2px solid #fff; border-radius: 50%;
    color: #fff; background: #217d6b; box-shadow: 0 4px 12px rgba(14,52,43,.15); font-size: 20px; font-weight: 850;
}
.student-app .live-podium-avatar + .live-podium-avatar { margin-left: -18px; }
.student-app .live-podium-crown {
    position: absolute; top: -31px; left: 50%; z-index: 5; width: 44px; height: auto;
    object-fit: contain; transform: translateX(-50%) rotate(-3deg); filter: drop-shadow(0 3px 2px rgba(81,52,0,.2));
}
.student-app .live-podium-avatar .live-avatar-fallback,
.student-app .live-podium-avatar .live-avatar-image { grid-area: 1 / 1; }
.student-app .live-podium-avatar img { z-index: 1; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.student-app .live-podium-avatar.avatar-load-failed img { display: none; }
.student-app .live-podium-more {
    flex: 0 0 auto; color: inherit; font-size: inherit; font-weight: 850; white-space: nowrap;
}
.student-app .live-podium-caption {
    display: flex; width: 100%; min-width: 0; min-height: 2.6em; margin: 8px 0 6px;
    align-items: center; justify-content: center; gap: 6px; font-size: clamp(12px, 1.7vw, 15px); line-height: 1.3;
}
.student-app .live-podium-name {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0;
    overflow: hidden; color: inherit; font-size: inherit; font-weight: 800; overflow-wrap: anywhere;
}
.student-app .live-podium-score { display: inline-flex; margin-bottom: 14px; align-items: center; gap: 5px; color: #926100; font-size: 18px; font-weight: 850; }
.student-app.dark-theme .live-podium-score { color: #ffd66c; }
.student-app .live-podium-block {
    position: relative; display: flex; min-width: 0; height: var(--podium-height); box-sizing: border-box;
    align-items: center; justify-content: space-between; flex-direction: column; gap: 12px;
    padding: 14px 8px 12px; border: 2px solid var(--podium-trim); border-radius: 14px 14px 5px 5px;
    color: var(--podium-label); background: linear-gradient(145deg, var(--podium-face-light), var(--podium-face-mid) 48%, var(--podium-face-dark));
    box-shadow: inset 0 5px 0 #ffffff25, inset 0 -5px 0 #00000030, 0 6px 0 var(--podium-side), 0 10px 14px #0C1B1720;
}
.student-app .live-podium-block::after {
    content: ''; position: absolute; top: 7px; right: -7px; bottom: -6px; width: 6px;
    background: var(--podium-side); clip-path: polygon(0 0,100% 5px,100% 100%,0 calc(100% - 6px));
}
.student-app .live-podium-medal { position: relative; z-index: 1; margin-block: auto; color: var(--podium-label); font-size: clamp(32px, 5vw, 52px); font-weight: 950; line-height: 1; }
.student-app .live-podium-level-pill {
    display: flex; flex: 0 0 auto; min-width: 0; max-width: 100%; min-height: 45px; box-sizing: border-box; padding: 5px 8px;
    align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 6px; border-radius: 14px;
    color: #17302a; background: #ffffffeb;
}
.student-app.dark-theme .live-podium-level-pill { color: #F3FAF7; background: #23352E; }
.student-app .live-podium-level-artworks { display: flex; align-items: center; justify-content: center; gap: 2px; }
.student-app .live-podium-level-art, .student-app .live-podium-level-art svg { display: block; width: 34px; height: 34px; flex: 0 0 34px; }
.student-app .live-podium-level-art .student-level-badge { width: 34px; height: 34px; margin: 0; background-size: 680px 34px; background-position: calc(var(--level-index) * -34px) center; }
.student-app .live-podium-level-label { font-size: 14px; font-weight: 850; line-height: 1.2; white-space: nowrap; }
.student-app .live-leaderboard-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.student-app .live-own-standing { position: relative; z-index: 1; display: grid; box-sizing: border-box; width: min(100%, 620px); margin: 0 auto; padding: 12px 16px; grid-template-columns: auto 42px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 2px solid #48a28e; border-radius: 15px; color: inherit; background: rgba(255,255,255,.86); box-shadow: 0 10px 26px rgba(17,55,46,.1); }
.student-app.dark-theme .live-own-standing { background: #1b2a26; }
.student-app .live-own-rank { color: #0a725f; font-size: 18px; font-weight: 900; }
.student-app.dark-theme .live-own-rank { color: #74d8c1; }
.student-app .live-own-avatar { display: grid; width: 42px; height: 42px; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: #267c6b; font-weight: 800; }
.student-app .live-own-avatar .live-avatar-fallback,
.student-app .live-own-avatar .live-avatar-image { grid-area: 1 / 1; }
.student-app .live-own-avatar img { z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.student-app .live-own-avatar.avatar-load-failed img { display: none; }
.student-app .live-own-standing div { min-width: 0; }
.student-app .live-own-standing small, .student-app .live-own-standing strong { display: block; overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
.student-app .live-own-standing small { font-size: 10px; font-weight: 800; letter-spacing: .08em; opacity: .62; text-transform: uppercase; }
.student-app .live-own-score { display: inline-flex; align-items: center; gap: 5px; color: #a46c00; font-weight: 850; }
.student-app .live-leaderboard-empty { margin: 10vh auto auto; text-align: center; }
.student-app .live-leaderboard-empty h3 { margin: 12px 0 4px; color: inherit; }
.student-app .live-leaderboard-empty p { margin: 0; color: inherit; opacity: .7; }
@media (max-width: 560px) {
    .student-app .live-leaderboard-overlay { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
    .student-app .live-leaderboard-content { padding-inline: 8px; }
    .student-app .live-leaderboard-brand { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 30px; height: 30px; }
    .student-app .live-leaderboard-heading { margin-top: clamp(32px, 6vh, 60px); margin-bottom: 24px; }
    .student-app .live-podium { gap: 8px; }
    .student-app .live-podium-place { --podium-height: 164px; }
    .student-app .live-podium-rank-2 { --podium-height: 132px; }
    .student-app .live-podium-rank-3 { --podium-height: 112px; }
    .student-app .live-podium-avatar { flex-basis: 32px; width: 32px; height: 32px; font-size: 13px; }
    .student-app .live-podium-avatar + .live-podium-avatar { margin-left: -12px; }
    .student-app .live-podium-caption { margin-top: 7px; gap: 4px; font-size: 11.5px; }
    .student-app .live-podium-score { font-size: 16px; margin-bottom: 12px; }
    .student-app .live-podium-medal { font-size: 32px; }
    .student-app .live-podium-crown { top: -26px; width: 34px; }
    .student-app .live-podium-block { padding: 10px 5px 8px; border-radius: 12px 12px 4px 4px; }
    .student-app .live-podium-level-pill { min-height: 36px; padding: 4px; gap: 4px; border-radius: 10px; }
    .student-app .live-podium-level-art, .student-app .live-podium-level-art svg { width: 26px; height: 26px; flex-basis: 26px; }
    .student-app .live-podium-level-art .student-level-badge { width: 26px; height: 26px; background-size: 520px 26px; background-position: calc(var(--level-index) * -26px) center; }
    .student-app .live-podium-level-label { font-size: 11px; }
    .student-app .live-podium[data-count="1"] .live-podium-place { --podium-height: 178px; }
    .student-app .live-podium[data-count="1"] .live-podium-avatar { flex-basis: 44px; width: 44px; height: 44px; font-size: 18px; }
    .student-app .live-podium[data-count="1"] .live-podium-caption { font-size: 14px; }
    .student-app .live-own-standing { grid-template-columns: auto 36px minmax(0,1fr) auto; padding: 10px; }
    .student-app .live-own-avatar { width: 36px; height: 36px; }
}
@media (max-height: 500px) {
    .student-app .live-leaderboard-heading { margin-top: 28px; margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .student-app .live-leaderboard-confetti { display: none; }
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    margin-bottom: 8px;
    animation: fadeInUp 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-weight: 500;
}

.toast.success { background: #16a34a; }
.toast.error { background: var(--danger); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    60% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .student-sidebar {
        width: 300px;
    }
    .answer-btn {
        min-height: 64px;
    }
}

@media (max-width: 768px) {
    .student-body {
        flex-direction: column;
    }
    .student-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding: 16px;
        flex: 1;
    }
    .student-slide-area {
        flex: none;
        max-height: 35vh;
    }
    .slide-content {
        padding: 12px;
    }
    .slide-preview {
        padding: 20px;
        aspect-ratio: auto;
    }
    .slide-preview h2 {
        font-size: var(--font-lg);
    }
    .join-card {
        padding: 36px 24px;
    }
    .answer-grid {
        gap: 8px;
    }
    .answer-btn {
        min-height: 60px;
        border-radius: 10px;
    }
    .answer-grid-8 {
        grid-template-columns: 1fr 1fr;
    }
    .submit-answer-btn {
        padding: 14px;
    }
    .student-header-center span {
        display: none;
    }
}

@media (max-width: 480px) {
    .student-sidebar {
        padding: 12px;
    }
    .answer-btn {
        min-height: 56px;
    }
    .answer-letter {
        font-size: 1.25rem;
    }
    .activity-instruction {
        font-size: var(--font-xs);
    }
}

/* ===== CLASSPOINT DARK THEME (Student UI) ===== */
.dark-theme {
    background: #111111 !important;
    color: #ffffff;
}

.dark-theme .cp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #212121;
    border-bottom: 1px solid #333333;
    height: 60px;
}

.dark-theme .cp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dark-theme .cp-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--primary); /* LOKAL primary color */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.dark-theme .cp-logo-text {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.dark-theme .cp-header-center {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.9rem;
}

.dark-theme .cp-code-badges {
    display: flex;
    gap: 4px;
}

.dark-theme .cp-code-badges .code-badge {
    background: #333333;
    border: none;
    color: #ffffff;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 0.85rem;
}

.dark-theme .cp-menu-btn {
    background: transparent;
    border: none;
    color: #ffffff;
}

.dark-theme .cp-menu-btn:hover {
    background: #333333;
}

.dark-theme .cp-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 60px);
}

.dark-theme .cp-slide-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    position: relative;
    padding: 24px;
}

.dark-theme .cp-slide-wrapper {
    background: #2b2b2b;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.dark-theme .cp-slide-container {
    flex: 1;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.cp-slide-container {
    position: relative;
}

.save-slide-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(18, 84, 75, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 6px 20px rgba(31, 42, 68, .14);
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: transform .16s ease, box-shadow .16s ease;
}

.save-slide-btn[hidden] {
    display: none;
}

.save-slide-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(31, 42, 68, .2);
}

.dark-theme .save-slide-btn {
    background: rgba(44, 44, 48, .92);
    border-color: rgba(27, 122, 108, .35);
}

@media (max-width: 720px) {
    .save-slide-btn {
        right: 10px;
        bottom: 10px;
    }

    .save-slide-btn span {
        display: none;
    }
}

.dark-theme .cp-slide-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111111; /* Slide content is dark text on white */
}

.dark-theme .slide-preview {
    background: transparent;
    box-shadow: none;
}

.dark-theme .cp-teacher-strip {
    background: #333333;
}

.dark-theme .cp-student-strip {
    background: #2b2b2b;
}

.dark-theme .student-profile-strip {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dark-theme .student-profile-strip .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dark-theme .student-profile-strip .name {
    color: #ffffff;
    font-weight: 500;
}

.dark-theme .cp-sidebar {
    background: #2a2a2a;
    border-left: 1px solid #111111;
}

.dark-theme .activity-header {
    color: #ffffff;
    border-bottom: 1px solid #444444;
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.dark-theme .activity-instruction {
    color: #dddddd;
}

.dark-theme .activity-instruction .highlight {
    background: #facc15;
    color: #111111;
}

.dark-theme .response-text-field { color: #f1f5f9; }
.dark-theme .response-text-field input {
    color: #ffffff;
    background: #333333;
    border-color: #555555;
}
.dark-theme .response-text-field input::placeholder { color: #a3a3a3; }
.dark-theme .response-text-field small,
.dark-theme .response-form-actions { color: #b8c0c8; }
.dark-theme .response-add-button {
    color: #ffffff;
    background: #333333;
    border-color: #555555;
}
.dark-theme .response-add-button:hover { background: #444444; }
.dark-theme .response-text-field > div > button { color: #f1f5f9; background: #4a4a4a; }

.dark-theme .answer-btn {
    background: #333333;
    border: 2px solid #444444;
    border-radius: 8px;
}

.dark-theme .answer-btn:hover {
    background: #444444;
}

.dark-theme .answer-btn.selected {
    border-color: var(--primary);
    background: #3b3b3b;
}

/* Specific choice colors based on Image 2 */
.dark-theme .choice-A .answer-letter { color: #10b981; } /* Green */
.dark-theme .choice-B .answer-letter { color: #ef4444; } /* Red */
.dark-theme .choice-C .answer-letter { color: #3b82f6; } /* Blue */
.dark-theme .choice-D .answer-letter { color: #f59e0b; } /* Yellow */
.dark-theme .choice-E .answer-letter { color: #06b6d4; } /* Cyan */
.dark-theme .choice-F .answer-letter { color: #ec4899; } /* Pink */

/* Quick Poll color meanings must stay consistent in dark mode. */
.dark-theme .quick-poll-true_false .choice-A .answer-letter,
.dark-theme .quick-poll-yes_no_unsure .choice-A .answer-letter { color: #34d399; }
.dark-theme .quick-poll-true_false .choice-B .answer-letter,
.dark-theme .quick-poll-yes_no_unsure .choice-B .answer-letter { color: #fb7185; }
.dark-theme .quick-poll-yes_no_unsure .choice-C .answer-letter { color: #fbbf24; }
.dark-theme .quick-poll-feedback .choice-A .answer-letter { color: #fb7185; }
.dark-theme .quick-poll-feedback .choice-B .answer-letter { color: #fb923c; }
.dark-theme .quick-poll-feedback .choice-C .answer-letter { color: #facc15; }
.dark-theme .quick-poll-feedback .choice-D .answer-letter { color: #5eead4; }
.dark-theme .quick-poll-feedback .choice-E .answer-letter { color: #34d399; }
.dark-theme .quick-poll-grid .answer-btn.selected {
    background: #173c35;
    border-color: #5eead4;
    box-shadow: 0 0 0 2px rgba(94, 234, 212, .16);
}

.dark-theme .submit-answer-btn.ready {
    background: linear-gradient(90deg, var(--brand-500), var(--primary));
    border: none;
}

/* CP Mobile Responsive */
@media (max-width: 768px) {
    .dark-theme .cp-sidebar {
        border-top: 1px solid #111111;
    }
}

.lightbox-mode {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    z-index: 9999;
    box-shadow: 0 0 0 100vmax rgba(0,0,0,0.9);
}
.lightbox-mode img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: pointer; }
/* Avatar Cropper Modal */
.avatar-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.avatar-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 320px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: #333;
}

.avatar-modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.avatar-modal-header .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
}

.avatar-crop-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
}

.avatar-crop-container:active {
    cursor: grabbing;
}

.crop-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    box-shadow: 0 0 0 200px rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 250px;
    height: 250px;
}

.avatar-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.2rem;
    color: #555;
}

.avatar-zoom-controls input[type=range] {
    flex: 1;
}

.avatar-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.avatar-modal-footer .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.avatar-modal-footer .btn-text {
    background: none;
    border: none;
    padding: 8px 12px;
    color: #555;
    cursor: pointer;
    font-weight: 500;
}

.avatar-modal-footer .btn-text.danger {
    color: #e53e3e;
}

/* ==========================================================================
   STUDENT CLASSROOM — MODERN LIGHT EXPERIENCE
   The rules below intentionally live after the legacy theme so every quiz
   state shares one restrained, responsive visual system.
   ========================================================================== */

.student-app {
    --student-primary: #0b6f62;
    --student-primary-strong: #07584f;
    --student-primary-soft: #e8f5f2;
    --student-ink: #17231f;
    --student-muted: #63716c;
    --student-border: #dbe4e1;
    --student-surface: #ffffff;
    --student-canvas: #f3f7f5;
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: var(--student-ink);
    background: var(--student-canvas);
    font-family: var(--font-family, "Segoe UI", Arial, sans-serif);
}

.student-app *,
.student-app *::before,
.student-app *::after { box-sizing: border-box; }

.student-app button,
.student-app input { font: inherit; }

.student-app button:focus-visible,
.student-app input:focus-visible {
    outline: 3px solid rgba(11, 111, 98, .22);
    outline-offset: 2px;
}

.student-app .cp-header {
    position: relative;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    align-items: center;
    flex: 0 0 68px;
    min-height: 68px;
    padding: 0 22px;
    border-bottom: 1px solid var(--student-border);
    color: var(--student-ink);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 1px 8px rgba(19, 45, 38, .04);
}

.student-app .cp-header-left,
.student-app .cp-header-center,
.student-app .cp-header-right {
    display: flex;
    align-items: center;
}

.student-app .cp-header-left { gap: 10px; }
.student-app .cp-header-center {
    justify-content: center;
    gap: 10px;
    min-width: 0;
}
.student-app .cp-header-right { justify-content: flex-end; }

.student-app .cp-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(11, 111, 98, .16);
}

.student-app .cp-brand-name {
    font-size: .94rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.student-app .cp-code-label {
    color: var(--student-muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.student-app .cp-code-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--student-primary-strong);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.student-app .cp-code-badges .code-badge {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 32px;
    padding: 0 7px;
    border: 1px solid #cce2dc;
    border-radius: 8px;
    color: var(--student-primary-strong);
    background: var(--student-primary-soft);
}

.student-app .cp-menu-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--student-border);
    border-radius: 10px;
    color: var(--student-ink);
    background: white;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.student-app .cp-menu-btn:hover {
    border-color: #b9ccc6;
    background: #f7faf9;
}

.student-app .dropdown-content {
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    padding: 7px;
    border: 1px solid var(--student-border);
    border-radius: 12px;
    background: white;
    box-shadow: 0 18px 44px rgba(19, 45, 38, .14);
}

.student-app .dropdown-item {
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    color: #9a3535;
    background: transparent;
    text-align: left;
}

.student-app .dropdown-item:hover { background: #fff3f2; }

.student-app .cp-body {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--student-canvas);
}

.student-app .cp-slide-area {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    gap: 16px;
    padding: 20px;
    overflow: auto;
    background: #edf3f0;
}

.student-app .cp-slide-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 360px;
    overflow: hidden;
    border: 1px solid var(--student-border);
    border-radius: 18px;
    background: white;
    box-shadow: 0 12px 32px rgba(20, 48, 40, .08);
}

.student-app .cp-slide-container {
    position: relative;
    display: grid;
    place-items: center;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #fbfcfc;
}

.student-app .cp-slide-content,
.student-app .slide-preview {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.student-app .slide-preview {
    position: relative;
    display: grid;
    place-items: center;
}

.student-app .activity-slide-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border: 0;
    object-fit: contain;
    background: white;
}

.student-app .slide-text-fallback {
    width: min(540px, calc(100% - 40px));
    padding: 36px;
    border: 1px solid var(--student-border);
    border-radius: 16px;
    background: white;
    text-align: center;
    box-shadow: 0 10px 28px rgba(20, 48, 40, .06);
}

.student-app .slide-text-fallback h2 {
    margin: 0;
    color: var(--student-ink);
    font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.student-app .slide-text-fallback > p {
    margin: 8px 0 20px;
    color: var(--student-muted);
    line-height: 1.55;
}

.student-app .slide-fallback-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.student-app .slide-activity-badge,
.student-app .slide-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--student-border);
    border-radius: 999px;
    color: var(--student-primary-strong);
    background: var(--student-primary-soft);
    font-size: .78rem;
    font-weight: 750;
}

.student-app .slide-timer-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    margin: 0;
    color: #7c5016;
    background: #fff7e6;
    border-color: #f1dfbc;
    font-variant-numeric: tabular-nums;
}

.student-app .slide-timer-badge.danger {
    color: #a43232;
    border-color: #f0cccc;
    background: #fff0ef;
}

.student-app .save-slide-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--student-border);
    border-radius: 10px;
    color: var(--student-ink);
    background: rgba(255,255,255,.96);
    box-shadow: 0 6px 20px rgba(20, 48, 40, .1);
    cursor: pointer;
}

.student-app .save-slide-btn[hidden] { display: none; }

.student-app .cp-teacher-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 68px;
    min-height: 68px;
    padding: 0 18px;
    border-top: 1px solid var(--student-border);
    color: var(--student-ink);
    background: white;
}

.student-app .teacher-identity,
.student-app .teacher-identity-copy {
    display: flex;
    align-items: center;
}

.student-app .teacher-identity { gap: 11px; }
.student-app .teacher-identity-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
}

.student-app .teacher-avatar-fallback,
.student-app .student-avatar-fallback,
.student-app .student-avatar-image {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.student-app .teacher-avatar-fallback {
    width: 38px;
    height: 38px;
    color: var(--student-primary-strong);
    background: var(--student-primary-soft);
    font-size: .9rem;
    font-weight: 800;
}

.student-app .teacher-name {
    color: var(--student-ink);
    font-size: .92rem;
    font-weight: 750;
}

.student-app .teacher-role {
    color: var(--student-muted);
    font-size: .72rem;
}

.student-app .fullscreen-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--student-border);
    border-radius: 9px;
    color: var(--student-muted);
    background: white;
    cursor: pointer;
}

.student-app .cp-student-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    min-height: 88px;
    padding: 13px 16px;
    border: 1px solid var(--student-border);
    border-radius: 16px;
    background: white;
    box-shadow: 0 8px 24px rgba(20, 48, 40, .06);
}

.student-app .student-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.student-app .student-avatar-fallback,
.student-app .student-avatar-image {
    width: 48px;
    height: 48px;
}

.student-app .student-avatar-fallback {
    color: white;
    background: var(--student-primary);
    font-size: 1rem;
    font-weight: 800;
}

.student-app .student-avatar-image { border: 2px solid #d9ebe6; }

.student-app .student-identity-name {
    overflow: hidden;
    color: var(--student-ink);
    font-size: .95rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-app .student-progress-caption {
    margin-top: 3px;
    color: var(--student-muted);
    font-size: .72rem;
}

.student-app .student-group-badge {
	display:inline-flex;
	max-width:190px;
	margin-top:4px;
	align-items:center;
	gap:5px;
	padding:3px 8px;
	overflow:hidden;
	border:1px solid color-mix(in srgb, var(--student-group-color) 42%, transparent);
	border-radius:999px;
	color:var(--student-group-color);
	background:color-mix(in srgb, var(--student-group-color) 10%, white);
	font-size:.68rem;
	font-weight:800;
	text-overflow:ellipsis;
	white-space:nowrap;
}
.student-app.dark-theme .student-group-badge { background:color-mix(in srgb, var(--student-group-color) 20%, #17231f); color:#d9fff7; }

.student-app .student-progress-cards {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.student-app .student-progress-card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-width: 76px;
    min-height: 58px;
    padding: 7px 10px;
    border: 1px solid var(--student-border);
    border-radius: 11px;
    color: var(--student-ink);
    background: #fafcfc;
}

.student-app .student-progress-card > span {
    color: var(--student-muted);
    font-size: .64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.student-app .student-progress-card > div {
    display: flex;
    align-items: center;
    gap: 3px;
}

.student-app .student-progress-card strong { font-size: .95rem; }
.student-app .student-progress-card .lokal-star-svg { width: 21px; height: 21px; }
.student-app .recent-plus { color: var(--student-primary); font-size: .8rem; }

.student-app .cp-sidebar {
    flex: 0 0 min(410px, 36vw);
    width: min(410px, 36vw);
    min-width: 340px;
    min-height: 0;
    overflow-y: auto;
    border-left: 1px solid var(--student-border);
    color: var(--student-ink);
    background: var(--student-surface);
}

.student-app .cp-sidebar-content {
    min-height: 100%;
    padding: 28px;
}

.student-app .mc-container,
.student-app .response-activity-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    color: var(--student-ink);
}

.student-app .activity-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    padding: 0 0 17px;
    border-bottom: 1px solid var(--student-border);
    color: var(--student-ink);
    font-size: 1.05rem;
    font-weight: 800;
}

.student-app .activity-header-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    color: var(--student-primary);
    background: var(--student-primary-soft);
}

.student-app .activity-heading-copy {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.student-app .activity-heading-copy small {
    color: var(--student-primary);
    font-size: .63rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .11em;
}

.student-app .activity-heading-copy strong {
    color: var(--student-ink);
    font-size: 1rem;
    line-height: 1.25;
}

.student-app .activity-instruction {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 22px;
    padding: 14px;
    border: 1px solid #dce8e4;
    border-radius: 12px;
    color: #384640;
    background: #f7faf9;
    font-size: .84rem;
    line-height: 1.45;
}

.student-app .instruction-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: white;
    background: var(--student-primary);
    font-size: .78rem;
    font-weight: 800;
}

.student-app .instruction-detail {
    display: block;
    margin-top: 3px;
    color: var(--student-muted);
    font-size: .76rem;
}

.student-app .activity-instruction .highlight {
    color: var(--student-primary-strong);
    background: transparent;
}

.student-app .answer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.student-app .quick-poll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.student-app .answer-btn {
    --choice-color: #0b6f62;
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 26px;
    align-items: center;
    min-height: 62px;
    padding: 10px 12px;
    overflow: hidden;
    border: 1px solid var(--student-border);
    border-radius: 12px;
    color: var(--student-ink);
    background: white;
    box-shadow: none;
    text-align: left;
    cursor: pointer;
    opacity: 1;
    transform: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.student-app .answer-btn::after { display: none; }
.student-app .answer-btn:hover {
    border-color: #a9c9c0;
    background: #fbfdfc;
    box-shadow: 0 5px 16px rgba(20, 48, 40, .07);
    transform: translateY(-1px);
}

.student-app .answer-btn:active { transform: translateY(0); }

.student-app .choice-A { --choice-color: #0b806b; }
.student-app .choice-B { --choice-color: #b94955; }
.student-app .choice-C { --choice-color: #3278b8; }
.student-app .choice-D { --choice-color: #b87517; }
.student-app .choice-E { --choice-color: #6f5cad; }
.student-app .choice-F { --choice-color: #a74f7e; }

.student-app .answer-choice-marker {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid color-mix(in srgb, var(--choice-color) 28%, white);
    border-radius: 9px;
    color: var(--choice-color);
    background: color-mix(in srgb, var(--choice-color) 8%, white);
    font-size: .78rem;
    font-weight: 850;
}

.student-app .answer-letter,
.student-app .answer-btn.selected .answer-letter {
    min-width: 0;
    padding: 0 9px;
    color: var(--student-ink);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.student-app .answer-selection-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid #cbd8d4;
    border-radius: 50%;
    color: transparent;
    background: white;
}

.student-app .answer-selection-icon > .bi,
.student-app .answer-selection-icon > .bi::before {
    display: block;
    width: 1em;
    height: 1em;
    margin: 0;
    line-height: 1;
    text-align: center;
    vertical-align: 0;
}

.student-app .answer-btn.selected {
    border-color: var(--student-primary);
    color: var(--student-ink);
    background: #f0f8f6;
    box-shadow: 0 0 0 2px rgba(11, 111, 98, .1);
    transform: none;
}

.student-app .answer-btn.selected .answer-selection-icon {
    border-color: var(--student-primary);
    color: white;
    background: var(--student-primary);
}

.student-app .quick-poll-grid .answer-btn {
    grid-template-columns: 34px minmax(0, 1fr) 22px;
    min-height: 76px;
    padding: 9px;
}

.student-app .answer-letter.poll-label {
    padding: 4px 6px;
    font-size: .82rem;
    text-align: left;
}

.student-app .submit-answer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: auto;
    padding: 0 20px;
    border: 0;
    border-radius: 11px;
    color: #89928f;
    background: #e8edeb;
    box-shadow: none;
    font-size: .9rem;
    font-weight: 800;
    cursor: not-allowed;
    opacity: 1;
}

.student-app .submit-answer-btn.ready {
    color: white;
    background: var(--student-primary);
    cursor: pointer;
}

.student-app .submit-answer-btn.ready:hover { background: var(--student-primary-strong); }

.student-app .response-text-field { color: #394741; }
.student-app .response-text-field input {
    border-color: var(--student-border);
    color: var(--student-ink);
    background: white;
}
.student-app .response-text-field input:focus {
    border-color: var(--student-primary);
    box-shadow: 0 0 0 3px rgba(11, 111, 98, .12);
}
.student-app .response-text-field > span i { background: var(--student-primary); }
.student-app .response-add-button {
    border-color: var(--student-border);
    color: var(--student-primary-strong);
    background: white;
}
.student-app .response-form-actions,
.student-app .response-text-field small { color: var(--student-muted); }

.student-app .submitted-state,
.student-app .activity-closed-card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 330px;
    padding: 26px 20px;
    border: 1px solid var(--student-border);
    border-radius: 15px;
    color: var(--student-ink);
    background: #fbfdfc;
    text-align: center;
}

.student-app .submitted-check,
.student-app .activity-closed-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 16px;
    border-radius: 50%;
    color: white;
    background: var(--student-primary) !important;
    box-shadow: 0 7px 18px rgba(11, 111, 98, .18);
}

.student-app .submitted-title,
.student-app .activity-closed-card h3 {
    margin: 0 0 7px;
    color: var(--student-ink);
    font-size: 1.1rem;
}

.student-app .submitted-message,
.student-app .activity-closed-card p {
    max-width: 300px;
    margin: 0;
    color: var(--student-muted);
    font-size: .82rem;
    line-height: 1.5;
}

.student-app .submitted-answers {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 15px;
}

.student-app .submitted-answer-badge,
.student-app .submitted-answer-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid #bcd9d2;
    border-radius: 999px;
    color: var(--student-primary-strong);
    background: var(--student-primary-soft);
    font-size: .77rem;
    font-weight: 800;
}

.student-app .submitted-answer-badge {
    min-width: 34px;
    border-radius: 9px;
}

.student-app .submitted-time {
    margin: 0;
    color: var(--student-muted);
    font-size: .84rem;
    line-height: 1.4;
}

.student-app .submitted-pace-card {
    width: min(100%, 360px);
    margin: 14px auto 0;
    padding: 12px 14px;
    border: 1px solid var(--student-border);
    border-radius: 12px;
    background: var(--student-primary-soft);
    overflow-wrap: anywhere;
}

.student-app .submitted-time strong {
    color: var(--student-primary-strong);
    font-size: 1rem;
    white-space: nowrap;
}

.student-app .submitted-pace:not([hidden]) {
    margin: 5px 0 0;
    color: var(--student-primary-strong);
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.45;
}

.student-app.dark-theme .submitted-pace-card {
    border-color: #31574e;
    background: #17312b;
}

.student-app.dark-theme .submitted-time strong,
.student-app.dark-theme .submitted-pace { color: #8be3cf; }

@media (max-width: 480px) {
    .student-app .submitted-pace-card { padding: 11px 12px; }
}

.student-app .submitted-closed-note {
    width: min(100%, 380px);
    margin: 14px 0 0;
    padding: 10px 14px;
    border: 1px solid #c5ddd5;
    border-radius: 999px;
    color: #31534b;
    background: #e8f3ef;
    font-size: .78rem;
    font-weight: 750;
    line-height: 1.4;
    text-align: center;
}

.student-app.dark-theme .submitted-closed-note {
    color: #d3ddd8;
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
}

.student-app .change-answer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    margin-top: 18px;
    padding: 0 15px;
    border: 1px solid #b9cec8;
    border-radius: 10px;
    color: var(--student-primary-strong);
    background: white;
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
}

.student-app .submitted-blank-list {
    display: grid;
    width: 100%;
    gap: 7px;
}

.student-app .submitted-blank-list > div {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid var(--student-border);
    border-radius: 9px;
    color: var(--student-ink);
    background: white;
    text-align: left;
}

.student-app .submitted-blank-list i {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    color: white;
    background: var(--student-primary);
    font-size: .68rem;
    font-style: normal;
}

/* These overrides intentionally follow the shared submitted-state rules above.
   They keep every quiz receipt dark instead of allowing a late white card rule
   to win the cascade (most visible on Fill in the Blanks). */
.student-app.dark-theme .submitted-response-container,
.student-app.dark-theme .submitted-response-container .activity-header,
.student-app.dark-theme .submitted-state,
.student-app.dark-theme .activity-closed-card {
    background: #202522;
    color: #f3f7f5;
    border-color: rgba(148, 163, 184, .28);
}

.student-app.dark-theme .submitted-blank-list > div,
.student-app.dark-theme .submitted-answer-badge,
.student-app.dark-theme .submitted-answer-chip,
.student-app.dark-theme .revealed-answer-summary,
.student-app.dark-theme .revealed-blank-row {
    background: #16231f;
    color: #f3f7f5;
    border-color: rgba(45, 212, 191, .38);
}

.student-app.dark-theme .submitted-state p,
.student-app.dark-theme .activity-closed-card p,
.student-app.dark-theme .submitted-blank-list span {
    color: #d3ddd8;
}

.student-app .revealed-results {
    width: 100%;
    margin: 18px 0 0;
    color: var(--student-ink);
}

.student-app .revealed-answer-summary,
.student-app .revealed-blank-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--student-border);
    border-radius: 11px;
    color: var(--student-ink);
    background: white;
    text-align: left;
}

.student-app .revealed-answer-summary.correct,
.student-app .revealed-blank-row.correct { border-color: #add9c9; background: #f0faf6; }
.student-app .revealed-answer-summary.incorrect,
.student-app .revealed-blank-row.incorrect { border-color: #ebc5c5; background: #fff6f5; }
.student-app .revealed-result-icon {
    display: grid;
    place-items: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    color: white;
    background: var(--student-primary);
    font-size: .75rem;
    font-weight: 800;
}
.student-app .incorrect .revealed-result-icon { background: #b44747; }
.student-app .revealed-results h3 { margin: 0 0 5px; font-size: .88rem; }
.student-app .revealed-results p,
.student-app .revealed-results small { color: var(--student-muted); font-size: .72rem; line-height: 1.45; }

.student-app .waiting-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: min(520px, calc(100% - 40px));
    min-height: 260px;
    padding: 38px;
    border: 1px solid var(--student-border);
    border-radius: 16px;
    color: var(--student-ink);
    background: white;
    text-align: center;
}

.student-app .waiting-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 17px;
    border-radius: 14px;
    color: var(--student-primary);
    background: var(--student-primary-soft);
    animation: none;
}

.student-app .waiting-state h3 {
    margin: 0 0 7px;
    color: var(--student-ink);
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
}

.student-app .waiting-subtitle {
    margin: 0;
    color: var(--student-muted);
    font-size: .88rem;
    line-height: 1.5;
}

.student-app .activity-muted-copy {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--student-border);
    border-radius: 11px;
    color: var(--student-muted);
    background: #f8faf9;
    font-size: .84rem;
    line-height: 1.5;
}

.toast-container { z-index: 11000; }
.student-app ~ .toast-container .toast {
    min-width: 250px;
    padding: 12px 14px;
    border: 1px solid var(--student-border);
    border-radius: 11px;
    color: var(--student-ink);
    background: white;
    box-shadow: 0 15px 36px rgba(20, 48, 40, .16);
}
.student-app.dark-theme ~ .toast-container .toast {
    color: #f3f7f5;
    border-color: #416159;
    background: #24312c;
}

@media (max-width: 980px) {
    .student-app .cp-sidebar {
        flex-basis: 360px;
        width: 360px;
        min-width: 320px;
    }
    .student-app .cp-sidebar-content { padding: 22px; }
    .student-app .cp-slide-area { padding: 16px; }
    .student-app .student-progress-card { min-width: 68px; }
}

@media (max-width: 760px) {
    .student-app { position: fixed; overflow: auto; }
    .student-app .cp-header {
        position: sticky;
        top: 0;
        grid-template-columns: auto 1fr auto;
        flex-basis: 62px;
        min-height: 62px;
        padding: 0 13px;
    }
    .student-app .cp-brand-name { display: none; }
    .student-app .cp-brand-mark { width: 34px; height: 34px; }
    .student-app .cp-header-center { gap: 7px; }
    .student-app .cp-code-label { display: none; }
    .student-app .cp-code-badges .code-badge {
        min-width: 24px;
        height: 29px;
        padding: 0 5px;
        border-radius: 7px;
    }
    .student-app .cp-body {
        display: block;
        flex: none;
        min-height: calc(100dvh - 62px);
        overflow: visible;
    }
    .student-app .cp-slide-area {
        min-height: auto;
        gap: 12px;
        padding: 12px;
        overflow: visible;
    }
    .student-app .cp-slide-wrapper {
        flex: none;
        min-height: 0;
        border-radius: 14px;
    }
    .student-app .cp-slide-container {
        aspect-ratio: 16 / 9;
        min-height: 220px;
    }
    .student-app .cp-teacher-strip {
        flex-basis: 60px;
        min-height: 60px;
        padding: 0 13px;
    }
    .student-app .cp-student-strip {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 13px;
        border-radius: 14px;
    }
    .student-app .student-progress-cards { width: 100%; }
    .student-app .student-progress-card { flex: 1 1 0; min-width: 0; }
    .student-app .cp-sidebar {
        width: 100%;
        min-width: 0;
        max-height: none;
        overflow: visible;
        border-top: 1px solid var(--student-border);
        border-left: 0;
    }
    .student-app .cp-sidebar:empty { display: none; }
    .student-app .cp-sidebar-content { min-height: auto; padding: 22px 16px 30px; }
    .student-app .mc-container,
    .student-app .response-activity-container { min-height: 0; }
    .student-app .submitted-state,
    .student-app .activity-closed-card { min-height: 300px; }
    .student-app .submit-answer-btn { margin-top: 6px; }
    .student-app .slide-text-fallback { width: calc(100% - 24px); padding: 22px 16px; }
}

@media (max-width: 460px) {
    .student-app .cp-code-badges { gap: 3px; font-size: .86rem; }
    .student-app .cp-code-badges .code-badge { min-width: 21px; height: 27px; padding: 0 4px; }
    .student-app .cp-slide-container { min-height: 190px; }
    .student-app .teacher-role,
    .student-app .student-progress-caption { display: none; }
    .student-app .student-progress-card { padding-inline: 6px; }
    .student-app .cp-sidebar-content { padding: 18px 13px 26px; }
    .student-app .activity-header { margin-bottom: 16px; padding-bottom: 14px; }
    .student-app .activity-instruction { margin-bottom: 17px; padding: 12px; }
    .student-app .quick-poll-grid { grid-template-columns: minmax(0, 1fr); }
    .student-app .answer-btn,
    .student-app .quick-poll-grid .answer-btn {
        grid-template-columns: 36px minmax(0, 1fr) 24px;
        min-height: 58px;
    }
    .student-app .waiting-state { width: calc(100% - 24px); min-height: 220px; padding: 26px 18px; }
}

/* ===== VISIBLE-VIEWPORT QUIZ SAFETY =====
   Mobile browser toolbars and virtual keyboards can reduce the usable viewport
   without changing 100vh consistently. JavaScript keeps these custom properties
   synchronized with VisualViewport so the response action never sits underneath
   browser chrome. */
.student-app {
    height: var(--student-visual-height, 100dvh);
    max-height: var(--student-visual-height, 100dvh);
}

@media (max-width: 760px) {
    .student-app {
        overflow: hidden;
    }

    .student-app .cp-header {
        position: relative;
        flex-shrink: 0;
    }

    .student-app .cp-body {
        display: block;
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        scroll-padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    .student-app .cp-sidebar-content {
        padding-bottom: calc(102px + env(safe-area-inset-bottom, 0px));
    }

    .student-app.activity-answering .submit-answer-btn {
        position: fixed !important;
        right: 12px;
        bottom: calc(var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px) + 8px);
        left: 12px;
        z-index: 120;
        width: auto;
        min-height: 52px;
        margin: 0;
        border: 1px solid rgba(11, 111, 98, .12);
        box-shadow: 0 12px 30px rgba(20, 48, 40, .2), 0 -10px 24px rgba(255, 255, 255, .94);
    }

    .student-app.dark-theme.activity-answering .submit-answer-btn {
        border-color: #414946;
        box-shadow: 0 12px 30px rgba(0, 0, 0, .35), 0 -12px 24px rgba(23, 26, 25, .96);
    }

    .student-app.dark-theme .answer-grid,
    .student-app.dark-theme .quick-poll-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .student-app.dark-theme .answer-btn,
    .student-app.dark-theme .quick-poll-grid .answer-btn {
        grid-template-columns: 42px minmax(0, 1fr) 24px;
        place-items: center stretch;
        min-height: 62px;
        padding: 9px 11px;
        text-align: left;
    }

    .student-app.dark-theme .answer-choice-marker {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }

    .student-app.dark-theme .answer-letter,
    .student-app.dark-theme .answer-btn.selected .answer-letter {
        position: static;
        width: auto;
        height: auto;
        padding: 0 8px;
        overflow: visible;
        clip: auto;
        clip-path: none;
        white-space: normal;
        color: #f6f8f7;
        font-size: .9rem;
        line-height: 1.35;
    }

    .student-app.dark-theme .answer-selection-icon {
        position: static;
    }

    /* Keep progress readable without allowing it to consume most of a phone
       viewport. Identity and all three metrics share one compact row. */
    .student-app .cp-student-strip {
        display: grid;
        grid-template-columns: minmax(92px, .9fr) minmax(190px, 1.7fr);
        align-items: center;
        gap: 7px;
        min-height: 62px;
        padding: 7px 8px;
    }

    .student-app .student-identity { gap: 6px; }
    .student-app .student-identity-copy { min-width: 0; }
    .student-app .student-avatar-fallback,
    .student-app .student-avatar-image {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        font-size: .75rem;
    }
    .student-app .student-identity-name { font-size: .72rem; }
    .student-app .student-progress-caption {
        display: block;
        margin-top: 1px;
        overflow: hidden;
        font-size: .52rem;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .student-app .student-progress-cards {
        width: 100%;
        gap: 4px;
    }
    .student-app .student-progress-card {
        min-width: 0;
        min-height: 46px;
        padding: 3px 4px;
        border-radius: 8px;
    }
    .student-app .student-progress-card > span {
        font-size: .47rem;
        letter-spacing: .03em;
    }
    .student-app .student-progress-card strong { font-size: .72rem; }
    .student-app .student-progress-card .lokal-star-svg {
        width: 16px;
        height: 16px;
    }
    .student-app .recent-plus { font-size: .62rem; }
    .student-app .student-level-badge {
        width: 31px;
        height: 31px;
        background-size: 620px 31px;
        background-position-x: calc(var(--level-index) * -31px);
    }

    /* Submitted confirmation is a short state, not another full-height page.
       Remove answer-button safety padding after submission so browser chrome
       cannot leave only the message section scrollable. */
    .student-app.activity-submitted .cp-body {
        scroll-padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
    .student-app.activity-submitted .cp-sidebar-content {
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    }
    .student-app.activity-submitted .submitted-state {
        min-height: 0;
        padding: 18px 14px;
    }
    .student-app.activity-submitted .submitted-check {
        width: 44px;
        height: 44px;
        margin-bottom: 11px;
    }
	.student-app.activity-submitted .submitted-check i {
		font-size: 32px;
	}
}

@media (min-width: 761px) and (max-height: 650px) {
    .student-app .cp-sidebar-content {
        padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .student-app *,
    .student-app *::before,
    .student-app *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
/* Quick Poll is a focused dialog, independent of the quiz sidebar's scrolling.
   All controls remain in normal dialog flow, including the safe-area footer. */
.student-app .quick-poll-overlay {
    position: fixed; inset: 0; z-index: 1500; box-sizing: border-box;
    display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    background: rgba(12, 20, 25, .66); backdrop-filter: blur(3px);
    height: 100%; height: 100dvh; overscroll-behavior: contain;
}
.student-app .quick-poll-overlay[hidden] { display: none; }
.student-app .quick-poll-dialog {
    --poll-surface: #fff; --poll-tile: #f2f4f7; --poll-ink: #27313a; --poll-line: #e6ebed;
    box-sizing: border-box; width: min(100%, 820px); max-height: 100%; overflow-y: auto;
    color: var(--poll-ink); background: var(--poll-surface); border: 1px solid var(--poll-line);
    border-radius: 24px; box-shadow: 0 24px 80px #0003; padding: 28px 32px;
    animation: quick-poll-in .18s ease-out; scrollbar-gutter: stable;
}
.student-app.dark-theme .quick-poll-dialog {
    --poll-surface: #242a2b; --poll-tile: #303738; --poll-ink: #f2f6f5; --poll-line: #414b4c;
}
.student-app .quick-poll-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--poll-line); padding-bottom: 18px; }
.student-app .quick-poll-heading h2 { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 650; margin: 0; color: inherit; }
.student-app .poll-close { width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; font: 28px/1 Arial,sans-serif; cursor: pointer; }
.student-app .poll-close:hover { background: var(--poll-tile); }
.student-app .quick-poll-instruction { margin: 18px 0; font-size: 14px; color: inherit; opacity: .78; }
.student-app .quick-poll-options { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
.student-app .quick-poll-dialog .answer-btn.poll-choice {
    position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center;
    box-sizing: border-box; gap: 18px; min-width: 0; width: 100%; min-height: 174px; height: auto;
    padding: 22px 10px; margin: 0; border: 2px solid transparent; border-radius: 18px;
    background: var(--poll-tile); color: var(--poll-ink); box-shadow: none; text-shadow: none;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.student-app .quick-poll-dialog .answer-btn.poll-choice:hover { border-color: #79b9a9; filter: none; }
.student-app .quick-poll-dialog .answer-btn.poll-choice.selected { border-color: #13ad90; background: #e5f5f0; color: #123a30; }
.student-app.dark-theme .quick-poll-dialog .answer-btn.poll-choice.selected { background: #173f35; color: #f1fff9; }
.student-app .poll-choice-art { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; flex: 0 0 auto; border-radius: 50%; color: #fff; font-size: 25px; line-height: 1; }
.student-app .poll-choice-label { display: block; font-size: 15px; line-height: 1.4; font-weight: 550; text-align: center; overflow-wrap: anywhere; }
.student-app .poll-choice-selected { display: none; position: absolute; top: 7px; right: 7px; color: #07866e; }
.student-app .poll-choice.selected .poll-choice-selected { display: block; }
.student-app .quick-poll-footer { display: flex; justify-content: center; padding-top: 24px; }
.student-app .quick-poll-dialog .submit-answer-btn {
    position: static; inset: auto; flex: 0 1 360px; width: min(100%, 360px); min-height: 48px; height: auto;
    box-sizing: border-box; margin: 0; padding: 14px 24px; border: 0; border-radius: 999px;
    background: #086b5c; color: #fff; font-size: 16px; font-weight: 650; box-shadow: none; transform: none;
}
.student-app .quick-poll-dialog .submit-answer-btn:disabled { background: #dae3e0; color: #647570; cursor: not-allowed; opacity: 1; }
.student-app.dark-theme .quick-poll-dialog .submit-answer-btn:disabled { background: #414c48; color: #b1bdb8; }
.student-app .quick-poll-dialog button:focus-visible { outline: 3px solid #18bca1; outline-offset: 3px; }
.student-app .poll-reopen-card { padding: 24px; text-align: center; }
@keyframes quick-poll-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
    .student-app .quick-poll-dialog { border-radius: 20px; padding: 18px; }
    .student-app .quick-poll-options { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .student-app .quick-poll-dialog .answer-btn.poll-choice { min-height: 112px; padding: 12px 8px; gap: 8px; border-radius: 14px; }
    .student-app .poll-choice-art { width: 42px; height: 42px; }
    .student-app .poll-choice-label { font-size: 14px; }
    .student-app .quick-poll-options[data-count="5"] .poll-choice:last-child { grid-column: 1 / -1; }
    .student-app .quick-poll-heading { padding-bottom: 10px; }
    .student-app .quick-poll-footer { padding-top: 18px; }
}
@media (max-height: 480px) and (min-width: 601px) {
    .student-app .quick-poll-dialog { padding: 12px 20px; }
    .student-app .quick-poll-dialog .answer-btn.poll-choice { min-height: 106px; padding: 10px 6px; gap: 8px; }
    .student-app .poll-choice-art { width: 38px; height: 38px; }
    .student-app .quick-poll-instruction { margin: 10px 0; }
    .student-app .quick-poll-footer { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .student-app .quick-poll-dialog { animation: none; }
    .student-app .quick-poll-dialog .answer-btn.poll-choice { transition: none; }
}

/* ===== Student presentation polish ===== */
.student-app .cp-code-badges {
    min-width: 0;
    padding: 0;
    border: 0;
    color: var(--student-ink);
    background: transparent;
    font-size: clamp(.95rem, 2vw, 1.14rem);
    font-weight: 800;
    letter-spacing: .18em;
    font-variant-numeric: tabular-nums;
}
.student-app .cp-menu-btn,
.student-app.dark-theme .cp-menu-btn {
    border: 0;
    border-radius: 8px;
    color: var(--student-ink);
    background: transparent;
    box-shadow: none;
}
.student-app .cp-menu-btn:hover,
.student-app.dark-theme .cp-menu-btn:hover { background: rgba(82, 120, 110, .1); }

.student-app .teacher-avatar-image {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 2px solid #d9ebe6;
    border-radius: 50%;
    object-fit: cover;
}
.student-app.dark-theme .teacher-avatar-image { border-color: #41645b; }
.student-app .student-identity-name { font-size: 1.02rem; }
.student-app .student-progress-caption { font-size: .75rem; }
.student-app .student-next-level {
    margin-top: 2px;
    color: var(--student-primary-strong);
    font-size: .68rem;
    font-weight: 750;
    line-height: 1.25;
}
.student-app.dark-theme .student-next-level { color: #78d7c4; }
.student-app .student-progress-card .lokal-star-svg {
    width: auto;
    height: auto;
    color: #f4b000;
    font-size: 19px !important;
    line-height: 1;
}

/* Metric values need an explicit light-theme ink color. Some mobile browsers
   retain the dark-theme inherited foreground while repainting the card white. */
.student-app:not(.dark-theme) .student-progress-card strong,
.student-app:not(.dark-theme) #student-total-stars,
.student-app:not(.dark-theme) #student-recent-stars {
    color: #17231f;
}

.student-app .revealed-answer-summary,
.student-app .revealed-blank-row { color: #17231f; background: #f7faf9; }
.student-app .revealed-answer-summary.correct,
.student-app .revealed-blank-row.correct { background: #edf9f4; }
.student-app .revealed-answer-summary.incorrect,
.student-app .revealed-blank-row.incorrect { background: #fff3f2; }
.student-app .revealed-results h3,
.student-app .revealed-results p,
.student-app .revealed-results strong,
.student-app .revealed-results small { color: #17231f; }

.student-app.dark-theme .cp-slide-wrapper,
.student-app.dark-theme .cp-slide-container,
.student-app.dark-theme .cp-slide-content,
.student-app.dark-theme .slide-preview,
.student-app.dark-theme .activity-slide-image { background: #050706; }
.student-app.dark-theme .revealed-answer-summary,
.student-app.dark-theme .revealed-blank-row,
.student-app.dark-theme .revealed-answer-summary.correct,
.student-app.dark-theme .revealed-blank-row.correct {
    border-color: #34695c;
    color: #f1f7f4;
    background: #17342d;
}
.student-app.dark-theme .revealed-answer-summary.incorrect,
.student-app.dark-theme .revealed-blank-row.incorrect {
    border-color: #764849;
    color: #fff3f3;
    background: #3b2526;
}
.student-app.dark-theme .revealed-results h3,
.student-app.dark-theme .revealed-results p,
.student-app.dark-theme .revealed-results strong,
.student-app.dark-theme .revealed-results small { color: #f1f7f4; }

.student-app .waiting-icon { animation: lokal-hourglass-turn 2.2s ease-in-out infinite; }
@keyframes lokal-hourglass-turn {
    0%, 38% { transform: rotate(0deg); }
    55%, 88% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .student-app .waiting-icon { animation: none; }
}
@media (max-width: 760px) {
    .student-app.activity-answering .cp-student-strip { display: none !important; }
    .student-app .student-identity-name { font-size: .84rem; }
    .student-app .student-progress-caption { font-size: .58rem; }
    .student-app .student-next-level { font-size: .56rem; }
    .student-app .student-progress-card .lokal-star-svg { font-size: 15px !important; }
    .student-app .student-progress-card > span { font-size: .52rem; }
    .student-app .student-progress-card strong { font-size: .82rem; }

    /* Leave a real scroll runway above Safari/Chrome's dynamic bottom chrome.
       The submit action is fixed to the same inset, so choices, confirmations,
       and their final lines can all be scrolled completely into view. */
    .student-app .cp-body {
        scroll-padding-bottom: calc(112px + var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
        padding-bottom: calc(96px + var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    }
    .student-app .cp-sidebar-content {
        padding-bottom: calc(112px + var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    }
    .student-app.activity-submitted .cp-body {
        scroll-padding-bottom: calc(48px + var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
        padding-bottom: calc(40px + var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    }
    .student-app.activity-submitted .cp-sidebar-content {
        padding-bottom: calc(48px + var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    }
}
@media (max-width: 460px) {
    /* Keep the instructor's organization visible during every quiz state. */
    .student-app .teacher-role {
        display: block;
        max-width: min(58vw, 250px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ==========================================================================
   STUDENT CLASSROOM — QUIETER, HUMAN-CENTERED COMPOSITION
   Reduce nested card-on-card styling and let typography, spacing, and a few
   necessary controls establish hierarchy. Keep this final so it wins over the
   compatibility layers above.
   ========================================================================== */
.student-app .cp-slide-area {
    align-items: center;
    gap: 0;
    padding: clamp(16px, 2vw, 30px);
}

.student-app .cp-slide-wrapper,
.student-app .cp-student-strip {
    width: min(100%, 1280px);
}

.student-app .cp-slide-wrapper {
    margin: 0;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(20, 48, 40, .07);
}

.student-app .cp-slide-content,
.student-app .slide-preview {
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-app .activity-slide-image {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    object-fit: contain;
    object-position: center center;
}

.student-app .cp-student-strip {
    min-height: 72px;
    margin: 0;
    padding: 14px 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.student-app .student-progress-cards { gap: 0; }

.student-app .student-progress-card {
    min-width: 82px;
    min-height: 46px;
    padding: 2px 14px;
    border: 0;
    border-left: 1px solid var(--student-border);
    border-radius: 0;
    background: transparent;
}

.student-app .student-progress-card:first-child { border-left: 0; }
.student-app .cp-sidebar-content { padding: clamp(22px, 2vw, 34px); }

.student-app .activity-header-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.student-app .activity-instruction {
    padding: 0;
    border: 0;
    background: transparent;
}

.student-app .submitted-state,
.student-app .activity-closed-card {
    min-height: 300px;
    padding: 24px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.student-app .submitted-check,
.student-app .activity-closed-icon { box-shadow: none; }

.student-app .slide-timer-badge.is-finished {
    min-width: 104px;
    justify-content: center;
}

.student-thesis-credit {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 16px;
    border-top: 1px solid var(--student-border);
    color: var(--student-muted);
    background: var(--student-surface);
    font-size: .66rem;
    line-height: 1.35;
    text-align: center;
    letter-spacing: .015em;
}

.student-app.dark-theme .cp-student-strip,
.student-app.dark-theme .student-progress-card,
.student-app.dark-theme .submitted-state,
.student-app.dark-theme .activity-closed-card,
.student-app.dark-theme .activity-instruction { background: transparent; }

.student-app.dark-theme .student-thesis-credit {
    border-color: #333a38;
    color: #9ba7a2;
    background: #171a19;
}

@media (min-width: 1500px) {
    .student-app .cp-slide-wrapper,
    .student-app .cp-student-strip { width: min(100%, 1360px); }
}

@media (max-width: 760px) {
    .student-app .cp-body { height: auto; }

    .student-app .cp-slide-area {
        align-items: stretch;
        padding: 10px;
    }

    .student-app .cp-slide-wrapper,
    .student-app .cp-student-strip { width: 100%; }

    .student-app .cp-slide-wrapper {
        border-radius: 9px;
        box-shadow: none;
    }

    .student-app .cp-student-strip {
        min-height: 58px;
        padding: 8px 2px 0;
    }

    /* Keep the instructor identity rhythm identical in light and dark mode.
       These values intentionally override older theme-specific mobile rules. */
    .student-app .cp-teacher-strip,
    .student-app.dark-theme .cp-teacher-strip {
        flex: 0 0 62px;
        min-height: 62px;
        padding: 8px 13px;
    }

    .student-app .teacher-identity,
    .student-app.dark-theme .teacher-identity { gap: 10px; }

    .student-app .teacher-identity-copy,
    .student-app.dark-theme .teacher-identity-copy {
        justify-content: center;
        gap: 3px;
        min-width: 0;
    }

    .student-app .teacher-name,
    .student-app.dark-theme .teacher-name { line-height: 1.2; }

    .student-app .teacher-role,
    .student-app.dark-theme .teacher-role { line-height: 1.25; }

    .student-app .answer-btn,
    .student-app.dark-theme .answer-btn,
    .student-app .quick-poll-grid .answer-btn,
    .student-app.dark-theme .quick-poll-grid .answer-btn {
        grid-template-columns: 38px minmax(0, 1fr) 26px;
        min-height: 62px;
        padding: 9px 11px;
    }

    .student-app .answer-choice-marker,
    .student-app.dark-theme .answer-choice-marker {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .student-app .answer-selection-icon,
    .student-app.dark-theme .answer-selection-icon {
        position: static;
        justify-self: center;
        align-self: center;
        width: 24px;
        height: 24px;
        padding: 0;
    }

    .student-app .student-progress-card {
        min-width: 0;
        min-height: 42px;
        padding-inline: 6px;
        border-radius: 0;
    }

    .student-app .cp-sidebar-content { padding-inline: 16px; }

    .student-app.activity-answering .submit-answer-btn {
        bottom: calc(var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px) + 42px);
    }

    .student-thesis-credit {
        position: fixed;
        right: 0;
        bottom: calc(var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
        left: 0;
        z-index: 115;
        min-height: 30px;
        padding: 5px 12px;
        font-size: clamp(.49rem, 2vw, .58rem);
        line-height: 1.2;
        white-space: normal;
    }

    .student-app .cp-body {
        padding-bottom: calc(126px + var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    }

    .student-app.activity-submitted .cp-body {
        padding-bottom: calc(42px + var(--student-browser-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    }
}

/* Open-response activities share the current LOKAL sidebar rather than a
   separate full-screen theme. Keep controls usable above mobile browser bars. */
.student-app .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.student-app .response-text-field textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 104px;
    padding: 13px 14px;
    resize: vertical;
    border: 1px solid var(--student-border);
    border-radius: 11px;
    outline: none;
    color: var(--student-ink);
    background: var(--student-surface);
    font: 500 .9rem/1.5 var(--font-family);
}

.student-app .response-text-field textarea:focus {
    border-color: var(--student-primary);
    box-shadow: 0 0 0 3px rgba(11, 111, 98, .12);
}

.student-app .response-form-error {
    margin: 3px 0 14px;
    color: #b42336;
    font-size: .78rem;
    line-height: 1.4;
}

.student-app .response-form-error[hidden] { display: none; }
.student-app .short-answer-field,
.student-app .image-upload-caption { margin-bottom: 14px; }
.student-app .short-answer-history {
    display: grid;
    gap: 8px;
    max-height: 210px;
    margin-bottom: 18px;
    overflow: auto;
}
.student-app .short-answer-history > strong {
    color: var(--student-muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.student-app .short-answer-history > div,
.student-app .submitted-short-list > div {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--student-border);
    border-radius: 10px;
    color: var(--student-ink);
    background: var(--student-surface);
    text-align: left;
}
.student-app .short-answer-history > div > span,
.student-app .submitted-short-list i {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--student-primary-strong);
    background: var(--student-primary-soft);
    font-size: .72rem;
    font-style: normal;
    font-weight: 800;
}
.student-app .short-answer-history p,
.student-app .submitted-short-list span {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-size: .8rem;
    line-height: 1.45;
}
.student-app .submitted-short-list {
    display: grid;
    width: 100%;
    gap: 8px;
    max-height: 210px;
    overflow: auto;
}

.student-app .submitted-short-list > div.removable {
    grid-template-columns: 24px minmax(0, 1fr) auto;
}
.student-app .short-answer-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    gap: 5px;
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid var(--student-border);
    border-radius: 8px;
    background: var(--student-surface);
    color: var(--student-primary-strong);
    font: 700 .72rem/1.2 var(--font-family);
    cursor: pointer;
}
.student-app .short-answer-remove:hover,
.student-app .short-answer-remove:focus-visible {
    border-color: var(--student-primary);
    background: var(--student-primary-soft);
}
.student-app .short-answer-remove:disabled {
    opacity: .55;
    cursor: wait;
}
.student-app .short-answer-awarded {
    display: inline-flex;
    align-items: center;
    align-self: start;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 8px;
    background: var(--student-primary-soft);
    color: var(--student-primary-strong);
    font: 700 .72rem/1.2 var(--font-family);
}
.student-app .submitted-short-list + .response-form-error[hidden] { display: none; }

@media (max-width: 420px) {
    .student-app .submitted-short-list > div.removable {
        grid-template-columns: 24px minmax(0, 1fr);
    }
    .student-app .short-answer-remove,
    .student-app .short-answer-awarded {
        grid-column: 2;
        justify-self: end;
    }
}

.student-app .image-upload-preview {
    display: grid;
    place-items: center;
    min-height: 175px;
    margin-bottom: 12px;
    padding: 12px;
    overflow: hidden;
    border: 1px dashed #9bbdb4;
    border-radius: 14px;
    background: var(--student-primary-soft);
    text-align: center;
}
.student-app .image-upload-preview.has-image { border-style: solid; }
.student-app .image-upload-preview img {
    max-width: 100%;
    max-height: min(280px, 35vh);
    border-radius: 8px;
    object-fit: contain;
}
.student-app .image-upload-preview > strong {
    max-width: 100%;
    margin-top: 8px;
    overflow-wrap: anywhere;
    color: var(--student-ink);
    font-size: .76rem;
}
.student-app .image-upload-placeholder { display: grid; justify-items: center; gap: 6px; color: var(--student-primary-strong); }
.student-app .image-upload-placeholder strong { font-size: .88rem; }
.student-app .image-upload-placeholder span { color: var(--student-muted); font-size: .75rem; }
.student-app .image-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}
.student-app .image-upload-actions .response-add-button { flex: 1 1 120px; }
.student-app .image-upload-actions .response-add-button {
    box-sizing: border-box;
    flex: 1 1 0;
    min-width: 0;
    min-height: 46px;
    padding: 9px 10px;
    white-space: nowrap;
}
.student-app .image-upload-caption textarea { min-height: 80px; }
.student-app .submitted-image-answer {
    display: grid;
    justify-items: center;
    width: 100%;
    gap: 8px;
}
.student-app .submitted-image-answer img {
    max-width: 100%;
    max-height: min(260px, 35vh);
    border-radius: 10px;
    object-fit: contain;
}
.student-app .submitted-image-answer p {
    max-width: 100%;
    margin: 0;
    color: var(--student-ink);
    font-size: .8rem;
    overflow-wrap: anywhere;
}
.student-app .open-response-reveal { margin-top: 15px; color: var(--student-muted); font-size: .78rem; }

.student-app.dark-theme .response-text-field textarea {
    color: var(--student-ink);
    background: var(--student-surface);
    border-color: var(--student-border);
}
.student-app.dark-theme .short-answer-history > div,
.student-app.dark-theme .submitted-short-list > div,
.student-app.dark-theme .image-upload-preview {
    border-color: var(--student-border);
    background: #17312b;
    color: #f3f7f5;
}
.student-app.dark-theme .submitted-short-list > div > span,
.student-app.dark-theme .short-answer-history > div > p { color: #f3f7f5; }
.student-app.dark-theme .change-answer-btn,
.student-app.dark-theme .response-add-button { background: #26332e; color: #ecf8f4; border-color: #486258; }

/* Keep every app-owned surface dark; the slide bitmap itself retains its
   teacher-authored colors so questions remain legible. */
.student-app.dark-theme .slide-text-fallback,
.student-app.dark-theme .activity-muted-copy,
.student-app.dark-theme .student-identity-name,
.student-app.dark-theme .response-text-field input {
    color: #f3f7f5;
    border-color: #394b44;
    background: #24312c;
}
.student-app.dark-theme .slide-text-fallback h2 { color: #f3f7f5; }
.student-app.dark-theme .slide-text-fallback > p { color: #b9cbc4; }
.student-app.dark-theme .response-text-field input::placeholder,
.student-app.dark-theme .response-text-field textarea::placeholder { color: #a7b9b1; }
body.student-dark-theme .avatar-modal-content {
    color: #f3f7f5;
    border: 1px solid #496158;
    background: #24312c;
}
body.student-dark-theme .avatar-modal-header .close-btn,
body.student-dark-theme .avatar-zoom-controls { color: #f3f7f5; }
body.student-dark-theme .avatar-crop-container { background: #17231f; }

/* The timeout art has generous built-in whitespace. Give it a compact viewport
   so the illustration and the message read as one clear state on phones. */
.student-app .activity-timeout-card .timeout-lottie {
    width: 148px;
    height: 120px;
    margin: 0 auto 2px;
}
.student-app .activity-timeout-card h3 { margin-top: 0; }

/* Avatar editor lives outside .student-app, so it uses its own consistent
   surface instead of inheriting the old light dialog / dark toolbar mixture. */
.avatar-modal { padding: 16px; background: rgba(0, 0, 0, .46); backdrop-filter: blur(2px); }

.student-confirm-overlay { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 20px; background: rgba(2, 13, 11, .60); backdrop-filter: blur(3px); }
.student-confirm-dialog { width: min(100%, 420px); padding: 28px; border: 1px solid #37544b; border-radius: 20px; background: #17251f; color: #f4faf7; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.student-confirm-icon { color: #ffb7a9; margin-bottom: 12px; }
.student-confirm-dialog h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.25; }
.student-confirm-dialog p { margin: 0; color: #c1d4cb; font-size: 15px; line-height: 1.5; }
.student-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.student-confirm-actions button { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #557067; background: #273c34; color: #f4faf7; font: inherit; font-weight: 700; cursor: pointer; }
.student-confirm-actions button[data-confirm="yes"] { background: #b9443d; border-color: #b9443d; color: #fff; }
.student-confirm-actions button:focus-visible { outline: 3px solid #9be9d2; outline-offset: 3px; }
@media (max-width: 420px) { .student-confirm-actions { flex-direction: column-reverse; } .student-confirm-actions button { width: 100%; } }
.avatar-modal-content {
    width: min(100%, 420px);
    max-width: none;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 20px;
    gap: 16px;
    border: 1px solid #40594f;
    border-radius: 22px;
    color: #f4faf7;
    background: #17241f;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .45);
    font-family: "Segoe UI", Arial, sans-serif;
}
.avatar-modal-header { padding: 0 0 14px; border-bottom: 1px solid #385047; }
.avatar-modal-heading { display: flex; align-items: center; flex: 1 1 auto; gap: 12px; min-width: 0; }
.avatar-modal-icon {
    display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px;
    margin-left: 0; border-radius: 12px; color: #aaf0da; background: #244b3e; font-size: 19px;
}
.avatar-modal-heading h2 { margin: 0; color: #f4faf7; font-size: 19px; line-height: 1.2; }
.avatar-modal-heading p { margin: 3px 0 0; color: #b6cbc2; font-size: 12px; line-height: 1.35; }
.avatar-modal-header .close-btn {
    display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px;
    margin-left: auto; border: 1px solid #456157; border-radius: 10px;
    color: #dcece5; background: #24392f; font-size: 15px;
}
.avatar-modal-header .close-btn:hover, .avatar-modal-header .close-btn:focus-visible {
    color: white; background: #355245; outline: 2px solid #8bdec2; outline-offset: 2px;
}
.avatar-crop-container {
    width: min(100%, 300px); height: auto; aspect-ratio: 1; margin: 0 auto;
    border: 1px solid #527266; border-radius: 16px; background: #0f1915;
    touch-action: none;
}
.avatar-crop-container canvas {
    position: absolute; top: 7%; left: 7%; display: block;
    width: 86%; height: 86%; border-radius: 12px;
}
.avatar-crop-container .crop-overlay {
    top: 7%; left: 7%; width: 86%; height: 86%;
    border: 2px solid rgba(255, 255, 255, .95); border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(4, 15, 11, .45);
}
.avatar-crop-container .crop-overlay::after { content: none; }
.avatar-zoom-controls {
    justify-content: stretch; gap: 10px; padding: 4px 2px;
    color: #dfede6; background: transparent; font-size: 17px;
}
.avatar-zoom-controls label { margin-right: auto; color: #dcebe4; font-size: 13px; font-weight: 700; }
.avatar-zoom-controls input[type=range] { width: 40%; max-width: none; accent-color: #4bceaa; }
.avatar-modal-error { margin: -8px 0 0; color: #ffb1a9; font-size: 12px; }
.avatar-modal-error:empty { display: none; }
.avatar-modal-footer {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    justify-content: stretch; margin: 0; padding: 0; background: transparent;
}
.avatar-modal-footer .btn-text, .avatar-modal-footer .btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 42px; padding: 9px 12px; border-radius: 10px;
    font: 700 13px/1.25 "Segoe UI", Arial, sans-serif;
}
.avatar-modal-footer .btn-text {
    border: 1px solid #486458; color: #f0f8f4; background: #24392f;
}
.avatar-modal-footer .btn-text.danger { border-color: #7a514d; color: #ffbbb4; background: #3a2827; }
.avatar-modal-footer .btn-primary {
    grid-column: 1 / -1; border: 1px solid #2ac199; color: #06261d;
    background: #69dfb7; font-size: 14px;
}
.avatar-modal-footer button:hover { filter: brightness(1.1); }
.avatar-modal-footer button:focus-visible { outline: 2px solid #b8f5df; outline-offset: 2px; }
@media (max-width: 360px) {
    .avatar-modal-content { padding: 16px; gap: 12px; }
    .avatar-modal-footer { grid-template-columns: 1fr; }
    .avatar-modal-footer .btn-primary { grid-column: auto; }
}

@media (max-width: 760px) {
    .student-app .image-upload-preview { min-height: 140px; }
    .student-app .image-upload-preview img { max-height: 180px; }
    .student-app .short-answer-history,
    .student-app .submitted-short-list { max-height: 150px; }
}

/* On phones, answering uses the browser's page scroll rather than a scrollable
   panel inside a viewport-locked app. iOS otherwise rubber-bands the final
   input; keeping Submit in the page flow leaves its count/help text visible. */
@media (max-width: 760px) {
    .student-app.activity-answering {
        position: relative;
        inset: auto;
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
    }

    .student-app.activity-answering .cp-header {
        position: sticky;
        top: 0;
    }

    .student-app.activity-answering .cp-body {
        flex: 1 0 auto;
        min-height: 0;
        overflow: visible;
        padding-bottom: 0;
    }

    .student-app.activity-answering .cp-slide-area,
    .student-app.activity-answering .cp-sidebar {
        overflow: visible;
    }

    .student-app.activity-answering .cp-sidebar-content {
        padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    }

    .student-app.activity-answering .submit-answer-btn {
        position: static !important;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        margin-top: 18px;
    }

    .student-app.activity-answering .student-thesis-credit {
        position: static;
    }
}

/* One document scroll for every mobile activity state. Footer and actions stay
   in flow, so iOS browser chrome cannot cover Change answer or Submit. */
@media (max-width: 760px) {
    .student-app,
    .student-app.activity-answering,
    .student-app.activity-submitted {
        position: relative;
        inset: auto;
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
    }
    .student-app .cp-body,
    .student-app.activity-answering .cp-body,
    .student-app.activity-submitted .cp-body {
        flex: 1 0 auto;
        height: auto;
        min-height: 0;
        overflow: visible;
        padding-bottom: 0;
    }
    .student-app .cp-slide-area,
    .student-app .cp-sidebar,
    .student-app .cp-sidebar-content { overflow: visible; }
    .student-app .cp-sidebar-content,
    .student-app.activity-answering .cp-sidebar-content {
        padding-bottom: 32px;
    }
    .student-app .submit-answer-btn,
    .student-app.dark-theme .submit-answer-btn,
    .student-app.activity-answering .cp-sidebar-content .submit-answer-btn {
        position: static !important;
        inset: auto;
        z-index: auto;
        display: block;
        width: 100%;
        min-height: 52px;
        margin: 18px 0 0;
        box-shadow: none;
    }
    .student-app .quick-poll-dialog .submit-answer-btn {
        display: inline-block;
        flex: 0 1 360px;
        width: min(100%, 360px);
        min-height: 48px;
        margin: 0;
    }
    .student-app .student-thesis-credit,
    .student-app.activity-answering .student-thesis-credit {
        position: static;
        inset: auto;
        z-index: auto;
        flex: 0 0 auto;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .student-app .change-answer-btn { max-width: 100%; white-space: normal; }
}

/* Compact answers use two readable columns in either theme. Longer labels
   deliberately keep a full-width row so mobile students can read them. */
@media (max-width: 760px) {
    .student-app .answer-grid.answer-grid-compact,
    .student-app.dark-theme .answer-grid.answer-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .student-app .answer-grid:not(.answer-grid-compact),
    .student-app.dark-theme .answer-grid:not(.answer-grid-compact) {
        grid-template-columns: minmax(0, 1fr);
    }
    .student-app .answer-grid-compact .answer-btn.selected {
        border: 2px solid var(--choice-color);
        background: color-mix(in srgb, var(--choice-color) 13%, white);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--choice-color) 21%, transparent);
    }
    .student-app.dark-theme .answer-grid-compact .answer-btn.selected {
        background: color-mix(in srgb, var(--choice-color) 25%, #15231f);
    }
    .student-app .answer-grid-compact .answer-btn:focus-visible {
        outline: 3px solid var(--choice-color);
        outline-offset: 2px;
    }
}
