/* ═══════════════════════════════════════════════════════════
   BKKO — Design System
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-gradient: radial-gradient(circle at 50% -20%, #2c2c2e, #000000);
    --card-bg: rgba(28, 28, 30, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #aeaeb2;
    --accent: #0a84ff;
    --accent-hover: #007aff;
    --danger: #ff453a;
    --danger-hover: #ff3b30;
    --success: #32d74b;
    --success-hover: #34c759;
    --warning: #ffd60a;
    --warning-hover: #ffcc00;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 30px 40px -10px rgba(0, 0, 0, 0.6), 0 15px 15px -10px rgba(0, 0, 0, 0.4);
    --glass-blur: blur(36px);
    --radius-lg: 32px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Hide Alpine-managed elements until Alpine initializes */
[x-cloak] {
    display: none !important;
}

/* ── Scrollbar Utility ── */
.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ═══════════════════════════════════════════════════════════
   Keyframes
   ═══════════════════════════════════════════════════════════ */

@keyframes rotation {
    to { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 100%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, 100%);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px var(--success);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 20px var(--success), 0 0 40px rgba(50, 215, 75, 0.3);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(3deg); }
    75% { transform: translateY(10px) rotate(-2deg); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes swipeOutLeft {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-140%) rotate(-12deg);
        opacity: 0;
    }
}

@keyframes swipeOutRight {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(140%) rotate(12deg);
        opacity: 0;
    }
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes spinnerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ═══════════════════════════════════════════════════════════
   Global Styles
   ═══════════════════════════════════════════════════════════ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    background-color: #000000;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.5;
    overflow: hidden;
    position: relative;
}

/* Floating background glow orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(100px);
}

body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.08) 0%, transparent 70%);
    top: -15%;
    right: -10%;
    animation: float 20s ease-in-out infinite;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(50, 215, 75, 0.06) 0%, transparent 70%);
    bottom: -10%;
    left: -10%;
    animation: float 25s ease-in-out infinite reverse;
}

/* ═══════════════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════════════ */

#app {
    width: 100%;
    max-width: 860px;
    height: 100vh;
    height: 100dvh;
    position: relative;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   Screen System — shared base + transitions
   ═══════════════════════════════════════════════════════════ */

.screen {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    transition:
        opacity 0.45s var(--transition-smooth),
        visibility 0.45s,
        transform 0.45s var(--transition-smooth);
    transform: translateY(8px);
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    z-index: 10;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   Startup Screen
   ═══════════════════════════════════════════════════════════ */

#startup-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 48px 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    animation: fadeInUp 0.7s var(--transition-spring) both;
}

.glass-panel h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.glass-panel p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

.icon-container {
    color: var(--accent);
    margin-bottom: 24px;
    animation: fadeIn 0.8s ease 0.2s both;
}

.icon-container svg {
    filter: drop-shadow(0 0 12px rgba(10, 132, 255, 0.4));
}

/* ═══════════════════════════════════════════════════════════
   Login Form
   ═══════════════════════════════════════════════════════════ */

.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.login-form .input-group {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.input-text {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-text:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
}

.input-text::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.w-100 {
    width: 100%;
    max-width: 280px;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════
   Student Selection Screen
   ═══════════════════════════════════════════════════════════ */

#student-screen {
    justify-content: center;
    align-items: center;
}

.student-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: min(700px, 85vh);
    padding: 32px;
}

.student-panel-header {
    flex-shrink: 0;
    margin-bottom: 16px;
}

.student-panel-header h2 {
    text-align: left;
    margin-bottom: 4px;
}

.student-panel-header p {
    text-align: left;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.25s ease;
}

.search-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
}

.student-list-container {
    flex: 1;
    overflow-y: auto;
    margin-right: -10px;
    padding-right: 10px;
}

.student-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Staggered appear animation for student items */
.student-list li {
    animation: fadeInUp 0.4s var(--transition-spring) both;
}

.student-list li:nth-child(1) { animation-delay: 0.03s; }
.student-list li:nth-child(2) { animation-delay: 0.06s; }
.student-list li:nth-child(3) { animation-delay: 0.09s; }
.student-list li:nth-child(4) { animation-delay: 0.12s; }
.student-list li:nth-child(5) { animation-delay: 0.15s; }
.student-list li:nth-child(6) { animation-delay: 0.18s; }
.student-list li:nth-child(7) { animation-delay: 0.21s; }
.student-list li:nth-child(8) { animation-delay: 0.24s; }
.student-list li:nth-child(n+9) { animation-delay: 0.27s; }

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.student-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: var(--text-primary);
    text-align: left;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.student-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.06) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.student-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.student-item:hover::after {
    opacity: 1;
}

.student-item:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.1s;
}

.student-item svg {
    transition: transform 0.25s var(--transition-spring);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.student-item:hover svg {
    transform: translateX(4px);
}

.student-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.student-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

#btn-skip-student {
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════
   Main / Evaluation Screen
   ═══════════════════════════════════════════════════════════ */

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding-bottom: 16px;
    min-height: 0;
}

/* ── Card System ── */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    max-height: 100%;
    min-height: 0;
    animation: cardEnter 0.5s var(--transition-spring) both;
}

.card-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(28, 28, 30, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.card-loader.active {
    opacity: 1;
    pointer-events: all;
}

.card-loader p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 16px;
}

.loader-lg {
    width: 56px;
    height: 56px;
    border: 4px solid var(--card-border);
    border-bottom-color: var(--accent);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s cubic-bezier(0.5, 0, 0.5, 1) infinite,
               spinnerPulse 2s ease-in-out infinite;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: opacity 0.4s ease, filter 0.4s ease;
    opacity: 1;
    filter: blur(0);
}

.card-content.hidden {
    opacity: 0.3;
    filter: blur(4px);
    pointer-events: none;
}

/* ── Meta Info ── */
.meta-info {
    padding: 20px 28px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.meta-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    animation: pulse 2.5s ease-in-out infinite;
}

#student-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#school-name {
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Book row */
.book-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.book-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    flex-shrink: 0;
}

#book-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* ── Summary Area ── */
.summary-container {
    padding: 20px 28px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.summary-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 800;
}

.summary-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 14px;
    margin-right: -6px;
}

#summary-text {
    font-size: 16px;
    line-height: 1.75;
    color: #cbd5e1;
    font-weight: 400;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: fadeIn 0.5s ease both;
}

/* ── Bottom Action Bar ── */
.action-bar {
    border-top: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.015);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.action-inputs-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.mini-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-input-group label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.mini-input-group input,
.mini-input-group select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.mini-input-group input {
    width: 80px;
    text-align: center;
}

.mini-input-group select {
    width: 155px;
    cursor: pointer;
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aeaeb2' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.mini-input-group select option {
    background: #2c2c2e;
    color: #fff;
}

.mini-input-group input:focus,
.mini-input-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.09);
}

.action-spacer {
    flex: 1;
}

.action-buttons-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════ */

.btn {
    border: none;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.25s var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.02em;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

/* Ripple effect for all buttons */
.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
}

.btn:active::after {
    animation: ripple 0.5s ease-out;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 16px 32px;
    width: 100%;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.45);
}

.btn-action {
    padding: 11px 20px;
    font-size: 14px;
}

.btn-reject {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-reject:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.btn-approve {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-approve:hover {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

.btn-skip-sm {
    background: rgba(245, 158, 11, 0.08);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.18);
    padding: 9px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-skip-sm:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-ghost-warning {
    background: transparent;
    color: #fbbf24;
    border: 1px dashed rgba(245, 158, 11, 0.3);
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 10px;
    white-space: nowrap;
}

.btn-ghost-warning:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.6);
}

.btn:active {
    transform: scale(0.97) translateY(0);
    box-shadow: none;
    transition-duration: 0.1s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ═══════════════════════════════════════════════════════════
   Swipe Animations
   ═══════════════════════════════════════════════════════════ */

.swipe-left {
    animation: swipeOutLeft 0.5s var(--transition-smooth) forwards;
}

.swipe-right {
    animation: swipeOutRight 0.5s var(--transition-smooth) forwards;
}

/* ═══════════════════════════════════════════════════════════
   Toast
   ═══════════════════════════════════════════════════════════ */

.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(28, 28, 30, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    color: #fff;
    padding: 14px 28px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 15px;
    font-weight: 600;
    z-index: 100;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast.show {
    animation: slideInUp 0.45s var(--transition-spring) both;
}

.toast:not(.show) {
    animation: slideOutDown 0.35s var(--transition-smooth) both;
}

/* ═══════════════════════════════════════════════════════════
   Helpers
   ═══════════════════════════════════════════════════════════ */

.mb-4 { margin-bottom: 16px; }
.mt-6 { margin-top: 24px; }

.hidden {
    display: none !important;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-bottom-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 0.8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════
   Image / Zoom Elements
   ═══════════════════════════════════════════════════════════ */

#summary-image-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    position: relative;
    cursor: grab;
    touch-action: none;
}

#summary-image-container:active {
    cursor: grabbing;
}

#summary-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: 50% 50%;
    -webkit-user-drag: none;
    user-select: none;
}

.zoom-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(40, 40, 45, 0.85);
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 5;
}

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon:active {
    transform: scale(0.9);
}

/* ═══════════════════════════════════════════════════════════
   Responsive — Tablet (≤768px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    #app {
        padding: 0;
        max-width: 100%;
    }

    .screen {
        padding: 16px;
    }

    .card,
    .glass-panel {
        border-radius: var(--radius-md);
        border: 1px solid var(--card-border);
    }

    .glass-panel {
        padding: 32px 24px;
    }

    .meta-info {
        padding: 16px 20px 12px;
    }

    .summary-container {
        padding: 16px 20px 8px;
    }

    .action-bar {
        padding: 12px 16px;
        gap: 10px;
    }

    .action-inputs-row {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════════════════════════
   Responsive — Mobile (≤520px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 520px) {
    .screen {
        padding: 12px 8px;
        padding-top: env(safe-area-inset-top, 12px);
    }

    .glass-panel {
        padding: 28px 20px;
        border-radius: var(--radius-md);
    }

    .glass-panel h2 {
        font-size: 24px;
    }

    .glass-panel p {
        font-size: 14px;
    }

    .student-panel {
        padding: 20px 16px;
        max-height: 100%;
    }

    .card {
        border-radius: var(--radius-md);
    }

    .meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    #btn-skip-student {
        align-self: flex-start;
        margin-left: 0;
        margin-top: 4px;
    }

    #book-name {
        font-size: 16px;
    }

    #summary-text {
        font-size: 15px;
        line-height: 1.65;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
        gap: 10px;
    }

    .action-spacer {
        display: none;
    }

    .action-inputs-row {
        justify-content: space-between;
        width: 100%;
    }

    .mini-input-group {
        flex: 1;
    }

    .mini-input-group select {
        width: 100%;
    }

    .action-buttons-row {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .action-buttons-row .btn-skip-sm {
        grid-column: 1 / -1;
        padding: 12px 16px;
        font-size: 14px;
    }

    .action-buttons-row .btn-action {
        padding: 14px 16px;
        font-size: 13px;
    }

    .summary-container {
        padding: 12px 16px 8px;
    }

    .meta-info {
        padding: 14px 16px 12px;
    }

    .toast {
        bottom: max(24px, env(safe-area-inset-bottom, 24px));
        font-size: 14px;
        padding: 12px 20px;
    }

    /* Reduce background orb sizes on mobile */
    body::before {
        width: 250px;
        height: 250px;
    }

    body::after {
        width: 200px;
        height: 200px;
    }
}

/* ═══════════════════════════════════════════════════════════
   Responsive — Small phones (≤375px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 375px) {
    .glass-panel {
        padding: 24px 16px;
    }

    .glass-panel h2 {
        font-size: 22px;
    }

    .student-panel {
        padding: 16px 12px;
    }

    .action-buttons-row {
        grid-template-columns: 1fr;
    }

    .meta-info {
        padding: 12px;
    }

    .summary-container {
        padding: 10px 12px 6px;
    }
}

/* ═══════════════════════════════════════════════════════════
   Reduced Motion — Accessibility
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}