:root{--esp-primary:#3454d1;--esp-primary-dark:#1a2340;--esp-bg-tint:#eef1fa;}

/* Content protection: applied only to student-facing routes (see
   ESP_Shortcodes::render_dashboard). Deters casual copying; cannot stop
   a screenshot or a second device pointed at the screen. */
.esp-protected{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative}
.esp-protected img{pointer-events:none;-webkit-user-drag:none}
.esp-protected input,.esp-protected textarea{-webkit-user-select:text;-moz-user-select:text;user-select:text}
.esp-print-blocked-message{display:none}
.esp-watermark-overlay{position:absolute;inset:0;pointer-events:none;background-repeat:repeat;z-index:9999}

@media print{
	.esp-protected{display:none !important}
	.esp-print-blocked-message{display:block !important;text-align:center;padding:120px 20px;font-size:20px;color:#333}
}

.esp-copy-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#1a2340;color:#fff;padding:10px 20px;border-radius:8px;font-size:14px;z-index:99999;opacity:0;transition:opacity .2s ease;pointer-events:none}
.esp-copy-toast.esp-copy-toast-visible{opacity:1}

.esp-dashboard-header{margin-bottom:24px}
.esp-dashboard-header h2{margin:0 0 4px}
.esp-student-name{color:#666;margin:0}

.esp-term-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin:24px 0}
.esp-term-card{display:block;padding:24px;border-radius:10px;background:#f4f6fb;border:1px solid #e2e6f0;text-decoration:none;color:var(--esp-primary-dark);transition:transform .15s ease,box-shadow .15s ease}
.esp-term-card:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(20,30,60,.08)}
.esp-term-card h3{margin:0 0 8px;font-size:18px}
.esp-term-card-cta{font-size:13px;font-weight:600;color:var(--esp-primary)}
.esp-term-card-c1{background:linear-gradient(135deg,#eef1fa,#dde3f7);border-color:#c7d0f0}
.esp-term-card-c2{background:linear-gradient(135deg,#e6f6ec,#d3f0dd);border-color:#b7e3c7}
.esp-term-card-c3{background:linear-gradient(135deg,#fbeee2,#f6ddc4);border-color:#f0cf9e}

.esp-color-stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:14px;margin:20px 0 8px}
.esp-color-stat{display:flex;flex-direction:column;align-items:center;gap:4px;padding:20px 12px;border-radius:14px;text-decoration:none;color:#fff;transition:transform .15s ease}
.esp-color-stat:hover{transform:translateY(-3px)}
.esp-color-stat-icon{font-size:24px;margin-bottom:2px}
.esp-color-stat-value{font-size:26px;font-weight:800}
.esp-color-stat-label{font-size:12px;opacity:.9;text-transform:uppercase;letter-spacing:.03em}
.esp-color-stat-orange{background:linear-gradient(135deg,#ff9a56,#dc5f1e)}
.esp-color-stat-purple{background:linear-gradient(135deg,#a06ae0,#6a35c4)}
.esp-color-stat-blue{background:linear-gradient(135deg,#5a8ff0,#3454d1)}
.esp-color-stat-green{background:linear-gradient(135deg,#4fcf80,#1e8a4c)}

.esp-back-link{margin-bottom:16px}
.esp-back-link a{text-decoration:none;font-weight:600}

.esp-subjects{margin-bottom:24px}
.esp-subject-list{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.esp-subject-list li{background:var(--esp-bg-tint);border-radius:20px;padding:6px 14px;font-size:14px}

.esp-tool-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}
.esp-tool-tile{padding:18px;border-radius:10px;background:#fff;border:1px solid #e2e6f0;border-top:3px solid var(--esp-primary);text-align:center;transition:transform .15s ease}
.esp-tool-tile:hover{transform:translateY(-2px)}
.esp-tool-grid a.esp-tool-tile:nth-child(6n+2){border-top-color:#1e8a4c}
.esp-tool-grid a.esp-tool-tile:nth-child(6n+3){border-top-color:#dc5f1e}
.esp-tool-grid a.esp-tool-tile:nth-child(6n+4){border-top-color:#6a35c4}
.esp-tool-grid a.esp-tool-tile:nth-child(6n+5){border-top-color:#c4293e}
.esp-tool-grid a.esp-tool-tile:nth-child(6n+6){border-top-color:#0891b2}
.esp-tool-label{display:block;font-weight:600;margin-bottom:6px}
.esp-tool-status{display:inline-block;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#9aa0b4;background:#f2f3f7;padding:2px 8px;border-radius:12px}

.esp-flash{padding:12px 16px;border-radius:8px;margin-bottom:16px;font-size:14px}
.esp-flash-success{background:#e6f6ec;color:#1e7b3e}
.esp-flash-error{background:#fbe9e9;color:#a12626}
.esp-flash-info{background:#eaf1fb;color:#20518c}

.esp-notice{padding:24px;background:#f7f8fb;border-radius:10px}
.esp-notice-warning{background:#fff4e5;border:1px solid #f0c36d;border-radius:8px;padding:12px 16px;color:#7a4a00;margin-bottom:14px}
.esp-btn{display:inline-block;padding:10px 20px;background:var(--esp-primary);color:#fff;border-radius:6px;text-decoration:none;font-weight:600;border:none;cursor:pointer;font-size:14px}
.esp-btn-small{padding:6px 14px;font-size:13px}
.esp-btn-link{background:none;border:none;color:var(--esp-primary);cursor:pointer;font-weight:600;font-size:13px;padding:0;text-decoration:underline}
.esp-input-full{width:100%;max-width:520px;padding:8px 10px;border:1px solid #d7dbe8;border-radius:6px}

.esp-tool-tile-disabled{opacity:.6}
.esp-tool-status-live{color:#1e7b3e;background:#e6f6ec}

.esp-subject-cards{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 28px}
.esp-subject-card{padding:10px 18px;border-radius:8px;background:var(--esp-bg-tint);color:var(--esp-primary-dark);text-decoration:none;font-weight:600}
.esp-subject-card:hover{background:#dde3f7}

.esp-library-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin:16px 0}
.esp-library-card{display:block;padding:18px;border-radius:10px;background:#fff;border:1px solid #e2e6f0;text-decoration:none;color:var(--esp-primary-dark)}
.esp-library-type{display:inline-block;font-size:11px;font-weight:700;letter-spacing:.05em;color:var(--esp-primary);background:var(--esp-bg-tint);padding:2px 8px;border-radius:10px;margin-bottom:8px}
.esp-library-card h3{margin:0;font-size:16px}
.esp-admin-link{margin-top:20px}

.esp-library-content{margin:20px 0}
.esp-note-block{padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid #eceff5}
.esp-note-block:last-child{border-bottom:none}
.esp-video-embed{position:relative;padding-bottom:56.25%;height:0;margin-bottom:16px}
.esp-video-embed iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;border-radius:8px}
.esp-pdf-embed{width:100%;height:600px;margin-bottom:12px}
.esp-pdf-embed iframe{width:100%;height:100%;border:1px solid #e2e6f0;border-radius:8px}
.esp-library-body{line-height:1.7;font-size:16px}
.esp-ms-controls{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:14px;padding:14px;background:#f7f8fb;border-radius:10px}
.esp-ms-select,.esp-ms-search{padding:10px 12px;border:1px solid #d7dbe8;border-radius:8px;font-size:15px;background:#fff}
.esp-ms-select{min-width:220px}
.esp-ms-search{flex:1;min-width:200px}
.esp-ms-hint{color:#666;font-style:italic;margin-bottom:18px}
.esp-ms-topic{padding:16px 0;border-top:1px solid #eef0f6}
.esp-ms-topic:first-of-type{border-top:none}
.esp-library-body h4{margin:26px 0 10px;font-size:18px;color:var(--esp-primary-dark);border-bottom:2px solid var(--esp-bg-tint);padding-bottom:6px}
.esp-library-body h5{margin:20px 0 8px;font-size:16px;color:var(--esp-primary)}
.esp-library-body ul,.esp-library-body ol{margin:12px 0;padding-left:24px}
.esp-library-body li{margin-bottom:7px}
.esp-library-body table{width:100%;border-collapse:collapse;margin:16px 0;font-size:14px}
/* Borders and top alignment are forced because block themes (Kadence and
   others) commonly reset table borders to none and centre cell content,
   which made these lesson-note tables unreadable on mobile. */
.esp-library-body table th,.esp-library-body table td{border:1px solid #c2c9da !important;padding:10px !important;text-align:left !important;vertical-align:top !important;line-height:1.5}
.esp-library-body table th{background:var(--esp-bg-tint);font-weight:700}
.esp-library-body table tr:nth-child(even) td{background:#fafbfd}
/* Tables are wrapped in this scroller by JS (initTableScroll) rather than
   setting display:block on the table itself - display:block collapses
   table layout and is what broke the borders in the first place. */
.esp-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:16px 0}
.esp-table-scroll table{margin:0;min-width:480px}
.esp-hint{color:#8a8fa3;font-size:13px;margin:8px 0 20px}

.esp-note-popover{position:sticky;bottom:16px;background:#fff;border:1px solid #d7dbe8;border-radius:10px;padding:14px;box-shadow:0 8px 24px rgba(20,30,60,.12);margin:16px 0}
.esp-note-popover textarea{width:100%;min-height:70px;border:1px solid #e2e6f0;border-radius:6px;padding:8px;font-family:inherit}
.esp-note-popover-actions{display:flex;gap:12px;align-items:center;margin-top:8px}

.esp-notes-panel{margin-top:28px;border-top:1px solid #eceff5;padding-top:20px}
.esp-note-card{background:#f9fafc;border-radius:8px;padding:12px 14px;margin-bottom:10px}
.esp-note-card blockquote{margin:0 0 6px;padding-left:10px;border-left:3px solid var(--esp-primary);color:#3a3f55;font-style:italic}
.esp-note-card p{margin:0 0 8px}

.esp-flashcard-deck{max-width:520px}
.esp-flashcard{background:#fff;border:1px solid #e2e6f0;border-radius:12px;padding:32px 24px;text-align:center;min-height:180px;display:flex;align-items:center;justify-content:center}
.esp-flashcard-face p{font-size:18px;margin:0 0 20px}
.esp-flashcard-ratings{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.esp-flashcard-ratings .esp-rate{background:var(--esp-bg-tint);color:var(--esp-primary-dark)}
.esp-flashcard-ratings .esp-rate[data-quality="0"]{background:#fbe9e9;color:#a12626}
.esp-flashcard-ratings .esp-rate[data-quality="5"]{background:#e6f6ec;color:#1e7b3e}
.esp-flashcard-done{text-align:center;padding:32px;color:#1e7b3e;font-weight:600}

.esp-ai-provider-picker{display:flex;flex-wrap:wrap;align-items:center;gap:14px;margin:12px 0}
.esp-ai-provider-option{display:inline-flex;align-items:center;gap:6px;font-size:14px;cursor:pointer}
.esp-chat-log{border:1px solid #e2e6f0;border-radius:10px;padding:16px;height:360px;overflow-y:auto;margin:16px 0;background:#fafbfd}
.esp-chat-bubble{max-width:80%;padding:10px 14px;border-radius:10px;margin-bottom:10px;line-height:1.5;font-size:14px;white-space:pre-wrap}
.esp-chat-user{background:var(--esp-primary);color:#fff;margin-left:auto}
.esp-chat-assistant{background:var(--esp-bg-tint);color:var(--esp-primary-dark)}
.esp-chat-form{display:flex;gap:10px;align-items:flex-end}
.esp-voice-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:10px 0}
.esp-mode-btn{border:1px solid #d7dbe8;background:#fff;border-radius:20px;padding:6px 14px;font-size:13px;cursor:pointer;color:#555}
.esp-mode-btn.active{background:var(--esp-primary);border-color:var(--esp-primary);color:#fff}
.esp-voice-readaloud-toggle{font-size:13px;color:#555;display:inline-flex;align-items:center;gap:6px}
.esp-mic-btn{flex:0 0 auto;width:44px;height:44px;border-radius:50%;border:1px solid #d7dbe8;background:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.esp-mic-btn.esp-mic-listening{background:#c4293e;border-color:#c4293e;color:#fff;animation:esp-mic-pulse 1.2s ease-in-out infinite}
@keyframes esp-mic-pulse{0%{box-shadow:0 0 0 0 rgba(196,41,62,.5)}70%{box-shadow:0 0 0 10px rgba(196,41,62,0)}100%{box-shadow:0 0 0 0 rgba(196,41,62,0)}}
.esp-voice-status{color:var(--esp-primary-dark);font-weight:600}

.esp-back-to-top{position:fixed !important;right:20px;bottom:24px;width:46px;height:46px;border-radius:50%;border:none;background:var(--esp-primary);color:#fff;font-size:20px;line-height:1;cursor:pointer;box-shadow:0 4px 14px rgba(20,30,60,.25);opacity:0 !important;visibility:hidden !important;transform:translateY(10px);transition:opacity .2s ease,transform .2s ease,visibility .2s;z-index:9998}
.esp-back-to-top-visible{opacity:1 !important;visibility:visible !important;transform:translateY(0)}
.esp-back-to-top:hover{background:var(--esp-primary-dark)}
@media (max-width:600px){.esp-back-to-top{right:14px;bottom:18px;width:42px;height:42px;font-size:18px}}

.esp-readaloud-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:14px;padding:10px 12px;background:var(--esp-bg-tint);border-radius:8px}
.esp-readaloud-speed{padding:4px 8px;border-radius:6px;border:1px solid #d7dbe8;font-size:13px}
.esp-chat-form textarea{flex:1;min-height:44px;padding:10px;border:1px solid #d7dbe8;border-radius:8px;font-family:inherit;resize:vertical}

.esp-subscribe{max-width:480px}
.esp-price-card{display:flex;align-items:baseline;gap:6px;background:var(--esp-bg-tint);border-radius:12px;padding:24px;margin:20px 0}
.esp-price-amount{font-size:32px;font-weight:700;color:var(--esp-primary-dark)}
.esp-price-period{color:#666;font-size:14px}
.esp-subscribe-form{margin-bottom:10px}
.esp-empty{color:#8a8fa3}

.esp-plan-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin:20px 0}
.esp-plan-card{background:#fff;border:1px solid #e2e6f0;border-radius:12px;padding:22px;text-align:center}
.esp-plan-card h3{margin:0 0 10px;font-size:16px}
.esp-plan-card .esp-price-amount{display:block;margin-bottom:14px}

.esp-register,.esp-register-form,.esp-profile-form{max-width:460px}
.esp-register-form,.esp-profile-form{display:flex;flex-direction:column}

.esp-quiz{max-width:640px}
.esp-quiz-intro{background:#f9fafc;border-radius:10px;padding:20px;margin:16px 0}
.esp-quiz-progress{font-size:13px;color:#8a8fa3;margin-bottom:10px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.esp-quiz-question-text{font-size:18px;margin:0 0 18px;line-height:1.5}
.esp-quiz-options{display:flex;flex-direction:column;gap:10px}
.esp-quiz-option{text-align:left;padding:12px 16px;border:1px solid #e2e6f0;border-radius:8px;background:#fff;color:#1a2340 !important;cursor:pointer;font-size:15px}
.esp-quiz-option:hover:not(:disabled){background:#f4f6fb}
.esp-quiz-option:disabled{cursor:default}
.esp-option-correct{background:#e6f6ec !important;border-color:#1e7b3e !important;color:#1e7b3e !important}
.esp-option-wrong{background:#fbe9e9 !important;border-color:#a12626 !important;color:#a12626 !important}
.esp-quiz-feedback{margin:16px 0;padding:12px 16px;border-radius:8px;font-size:14px;line-height:1.5}
.esp-feedback-correct{background:#e6f6ec;color:#1e7b3e}
.esp-feedback-wrong{background:#fbe9e9;color:#a12626}
.esp-quiz-result h3{font-size:28px;margin:20px 0 12px}
.esp-quiz-timer{font-weight:700;font-size:15px;color:var(--esp-primary-dark);background:var(--esp-bg-tint);display:inline-block;padding:6px 14px;border-radius:8px;margin-bottom:12px}
.esp-quiz-warning{background:#fbe9e9;color:#a12626;padding:10px 14px;border-radius:8px;font-size:14px;margin-bottom:14px;font-weight:600}
.esp-result-topics{list-style:none;padding:0}
.esp-result-topics li{padding:8px 12px;background:#f4f6fb;border-radius:6px;margin-bottom:6px;font-size:14px}
.esp-result-topics li.esp-weak{background:#fbe9e9;color:#a12626;font-weight:600}

.esp-paper-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin:16px 0}
.esp-paper-card{display:block;padding:18px;border-radius:10px;background:#fff;border:1px solid #e2e6f0;text-decoration:none;color:var(--esp-primary-dark)}
.esp-paper-card h3{margin:0 0 6px;font-size:16px}
.esp-paper-meta{font-size:13px;color:#8a8fa3}

.esp-weakness-row{display:grid;grid-template-columns:180px 1fr 100px;align-items:center;gap:14px;padding:10px 0;border-bottom:1px solid #eceff5}
.esp-weakness-topic{font-weight:600;font-size:14px}
.esp-weak-badge{display:inline-block;font-size:10px;background:#fbe9e9;color:#a12626;padding:2px 8px;border-radius:10px;margin-left:6px;font-weight:700;text-transform:uppercase}
.esp-weakness-bar{background:#eceff5;border-radius:6px;height:10px;overflow:hidden}
.esp-weakness-bar-fill{background:var(--esp-primary);height:100%}
.esp-weakness-flagged .esp-weakness-bar-fill{background:#a12626}
.esp-weakness-percent{font-size:13px;color:#666;text-align:right}

.esp-q-difficulty-tag{display:inline-block;font-size:10px;text-transform:uppercase;font-weight:700;padding:2px 6px;border-radius:8px;margin-right:6px}
.esp-q-easy{background:#e6f6ec;color:#1e7b3e}
.esp-q-medium{background:var(--esp-bg-tint);color:var(--esp-primary)}
.esp-q-hard{background:#fbe9e9;color:#a12626}
.esp-existing-questions{list-style:none;padding:0}
.esp-existing-questions li{padding:8px 0;border-bottom:1px solid #eceff5;font-size:14px}
.esp-question-checklist{list-style:none;padding:0;max-height:320px;overflow-y:auto;border:1px solid #e2e6f0;border-radius:8px;padding:10px}
.esp-question-checklist li{padding:6px 0}

.esp-planner-week{display:flex;flex-direction:column;gap:18px}
.esp-planner-day h3{font-size:15px;margin:0 0 8px;color:#3a3f55}
.esp-planner-tasks{list-style:none;padding:0;display:flex;flex-direction:column;gap:6px}
.esp-planner-task{display:flex;align-items:center;gap:10px;padding:10px 14px;background:#f9fafc;border-radius:8px}
.esp-planner-task a{color:var(--esp-primary-dark);text-decoration:none;font-size:14px}
.esp-task-toggle{width:20px;height:20px;border-radius:50%;border:2px solid #c7cde0;background:#fff;cursor:pointer;flex-shrink:0}
.esp-task-done{opacity:.55}
.esp-task-done .esp-task-toggle{background:var(--esp-primary);border-color:var(--esp-primary)}
.esp-task-done a{text-decoration:line-through}

.esp-stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:20px 0 32px}
.esp-stat-card{background:#f4f6fb;border-radius:10px;padding:18px;text-align:center}
.esp-stat-card-highlight{background:linear-gradient(135deg,var(--esp-primary),var(--esp-primary-dark));color:#fff}
.esp-stat-card-highlight .esp-stat-value,.esp-stat-card-highlight .esp-stat-label{color:#fff}
.esp-stat-value{display:block;font-size:26px;font-weight:700;color:var(--esp-primary-dark)}
.esp-stat-label{display:block;font-size:12px;color:#8a8fa3;margin-top:4px}
.esp-subject-progress-list{display:flex;flex-direction:column;gap:8px}
.esp-subject-progress-row{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#fff;border:1px solid #e2e6f0;border-radius:8px;text-decoration:none;color:var(--esp-primary-dark)}
.esp-subject-progress-name{font-weight:600}
.esp-subject-progress-stats{font-size:13px;color:#8a8fa3}

.esp-group-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin:16px 0}
.esp-group-card{display:block;padding:18px;border-radius:10px;background:#fff;border:1px solid #e2e6f0;text-decoration:none;color:var(--esp-primary-dark)}
.esp-group-card h3{margin:0 0 6px;font-size:16px}
.esp-group-card p{margin:0 0 8px;font-size:13px;color:#666}
.esp-group-meta{font-size:12px;color:#8a8fa3}
.esp-create-group-form{display:flex;flex-direction:column;gap:10px;max-width:420px;margin-top:12px}
.esp-group-members{font-size:13px;color:#666;margin-bottom:16px}

.esp-points-banner{display:flex;align-items:baseline;gap:8px;background:linear-gradient(135deg,var(--esp-primary),#5a7bf0);border-radius:12px;padding:24px;margin:20px 0;color:#fff}
.esp-points-value{font-size:36px;font-weight:700}
.esp-points-label{font-size:14px;opacity:.85}

.esp-badge-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:16px 0 32px}
.esp-badge-card{text-align:center;padding:18px 12px;border-radius:10px;background:#f4f6fb}
.esp-badge-icon{display:block;font-size:32px;margin-bottom:8px}
.esp-badge-name{display:block;font-weight:700;font-size:13px}
.esp-badge-desc{display:block;font-size:11px;color:#8a8fa3;margin-top:4px}
.esp-badge-locked{opacity:.35;filter:grayscale(1)}

.esp-leaderboard{list-style:none;padding:0;counter-reset:none}
.esp-leaderboard li{display:flex;align-items:center;gap:12px;padding:10px 14px;border-bottom:1px solid #eceff5;font-size:14px}
.esp-leaderboard-rank{font-weight:700;color:#8a8fa3;width:32px}
.esp-leaderboard-name{flex:1}
.esp-leaderboard-points{font-weight:600;color:var(--esp-primary)}
.esp-leaderboard-me{background:var(--esp-bg-tint);border-radius:8px}

.esp-roster-table{width:100%;border-collapse:collapse;margin:16px 0}
.esp-roster-table th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#8a8fa3;padding:8px 10px;border-bottom:2px solid #eceff5}
.esp-roster-table td{padding:10px;border-bottom:1px solid #eceff5;font-size:14px}
.esp-status-tag{display:inline-block;padding:2px 10px;border-radius:12px;font-size:11px;font-weight:700;text-transform:uppercase}
.esp-status-active{background:#e6f6ec;color:#1e7b3e}
.esp-status-pending{background:#fff6df;color:#9a6b00}
.esp-status-failed{background:#fbe9e9;color:#a12626}
.esp-enroll-form{max-width:420px;margin:16px 0 28px}
.esp-inline-form{display:inline-block;margin-right:8px}
.esp-pending-actions{display:flex;gap:10px;align-items:center}

.esp-pagination{display:flex;flex-wrap:wrap;align-items:center;gap:16px;margin:18px 0;padding:12px 16px;background:#f9fafc;border-radius:8px;font-size:13px}
.esp-pagination-summary{color:#666}
.esp-pagination-nav{display:flex;gap:8px}
.esp-pagination-per-page select{margin-left:6px;padding:4px 8px;border-radius:6px;border:1px solid #d7dbe8}

.esp-referral-code-card{background:linear-gradient(135deg,var(--esp-primary),var(--esp-primary-dark));color:#fff;border-radius:14px;padding:24px;margin:20px 0}
.esp-referral-code-label{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.05em;opacity:.85}
.esp-referral-code-value{display:block;font-size:32px;font-weight:800;letter-spacing:.05em;margin:6px 0}
.esp-referral-code-card .esp-hint{color:rgba(255,255,255,.85);margin:10px 0}
.esp-referral-share-link input{background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.4);color:#fff;padding:8px 10px;border-radius:6px}

.esp-syllabus-list{margin:16px 0;padding-left:22px}
.esp-syllabus-list li{padding:6px 0;border-bottom:1px solid #eceff5;font-size:14px}
.esp-syllabus-list li:last-child{border-bottom:none}
.esp-syllabus-list a{color:var(--esp-primary-dark);text-decoration:none;font-weight:500}
.esp-syllabus-list a:hover{color:var(--esp-primary);text-decoration:underline}
.esp-staff-dashboard .esp-dashboard-header{margin-bottom:0}

/* ==================================================================
 * JAMB (UTME) style CBT Self-Test (self-test.php / self-test-review.php)
 * Mobile-first: the majority of students use phones, so the default
 * (no media query) rules target a small screen, and desktop layout is
 * layered on top at 782px+ (WordPress's own admin breakpoint, reused
 * here for consistency with the rest of the plugin).
 * ================================================================== */
.esp-cbt-setup{max-width:520px}
.esp-cbt-setup-field{margin:16px 0}
.esp-cbt-setup-field label{display:block;font-weight:600;margin-bottom:6px;color:var(--esp-primary-dark)}
.esp-cbt-setup-field input[type="number"]{width:100%;padding:12px;border:1px solid #d7dbe8;border-radius:8px;font-size:16px}
.esp-cbt-setup-hint{display:block;margin-top:4px;font-size:13px;color:#666}

.esp-cbt-history{margin-top:32px;padding-top:24px;border-top:1px solid #e2e6f0}
.esp-cbt-history h3{margin-bottom:10px;color:var(--esp-primary-dark)}
.esp-cbt-history-empty{color:#666;font-size:14px}
.esp-cbt-history-count{color:#666;font-size:13px;margin-bottom:14px}
.esp-cbt-history-list{display:flex;flex-direction:column;gap:10px}
.esp-cbt-history-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border:1px solid #e2e6f0;border-radius:10px;background:#fff;flex-wrap:wrap}
.esp-cbt-history-main{display:flex;flex-direction:column;gap:2px;min-width:0}
.esp-cbt-history-score{font-weight:800;font-size:18px;width:fit-content;padding:2px 10px;border-radius:6px}
.esp-cbt-history-score-good{background:#e6f6ec;color:#1e7b3e}
.esp-cbt-history-score-low{background:#fbe9e9;color:#a12626}
.esp-cbt-history-detail{font-size:13px;color:#444}
.esp-cbt-history-date{font-size:12px;color:#888}
.esp-cbt-history-review-link{flex-shrink:0;font-weight:600;font-size:14px;color:var(--esp-primary);text-decoration:none;white-space:nowrap}
.esp-cbt-history-review-link:hover{text-decoration:underline}

/* Full-viewport exam shell */
.esp-cbt-exam{position:fixed;inset:0;z-index:9999;background:#fff;display:flex;flex-direction:column}
.esp-cbt-exam[hidden]{display:none}
.esp-cbt-topbar{display:flex;align-items:center;justify-content:space-between;background:var(--esp-primary-dark);color:#fff;padding:10px 14px;flex-shrink:0}
.esp-cbt-topbar-left{display:flex;flex-direction:column;min-width:0}
.esp-cbt-subject-name{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.esp-cbt-candidate{font-size:12px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.esp-cbt-topbar-right{display:flex;align-items:center;gap:8px;flex-shrink:0}
.esp-cbt-icon-btn{background:rgba(255,255,255,.15);border:none;color:#fff;font-size:18px;width:38px;height:38px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.esp-cbt-icon-btn:hover{background:rgba(255,255,255,.28)}
.esp-cbt-timer{background:#fff;color:var(--esp-primary-dark);font-weight:800;font-size:16px;padding:8px 12px;border-radius:8px;min-width:70px;text-align:center;font-variant-numeric:tabular-nums}
.esp-cbt-timer-low{background:#fbe9e9;color:#a12626;animation:esp-cbt-pulse 1s infinite}
@keyframes esp-cbt-pulse{0%,100%{opacity:1}50%{opacity:.55}}

.esp-cbt-warning{background:#fff4e5;color:#8a5a00;padding:10px 14px;font-size:13px;font-weight:600;text-align:center;flex-shrink:0}

.esp-cbt-body{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}

/* Palette - collapsible drawer on mobile, fixed side panel on desktop */
.esp-cbt-palette{position:fixed;top:56px;right:0;bottom:0;width:82%;max-width:320px;background:#f7f8fb;border-left:1px solid #e2e6f0;padding:14px;overflow-y:auto;transform:translateX(100%);transition:transform .2s ease;z-index:20;display:flex;flex-direction:column}
.esp-cbt-palette.esp-cbt-palette-open{transform:translateX(0);box-shadow:-6px 0 24px rgba(0,0,0,.15)}
.esp-cbt-palette-summary{font-weight:700;color:var(--esp-primary-dark);margin-bottom:8px;font-size:14px}
.esp-cbt-palette-legend{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#555;margin-bottom:14px}
.esp-cbt-palette-legend span{display:flex;align-items:center;gap:6px}
.esp-cbt-dot{width:12px;height:12px;border-radius:3px;display:inline-block;border:1px solid #c7cde0;background:#fff}
.esp-cbt-dot-answered{background:#e6f6ec;border-color:#1e7b3e}
.esp-cbt-dot-unanswered{background:#fff;border-color:#c7cde0}
.esp-cbt-dot-current{background:var(--esp-primary);border-color:var(--esp-primary)}
.esp-cbt-palette-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:16px}
.esp-cbt-palette-btn{aspect-ratio:1;border:1px solid #c7cde0;background:#fff;border-radius:6px;font-weight:700;font-size:13px;cursor:pointer;color:#333}
.esp-cbt-palette-btn.esp-cbt-palette-answered{background:#e6f6ec;border-color:#1e7b3e;color:#1e7b3e}
.esp-cbt-palette-btn.esp-cbt-palette-current{outline:3px solid var(--esp-primary);outline-offset:1px}
.esp-cbt-submit-btn{margin-top:auto;width:100%}

/* Question pane */
.esp-cbt-question-pane{flex:1;display:flex;flex-direction:column;padding:16px;overflow-y:auto;min-height:0}
.esp-cbt-q-header{font-weight:700;color:var(--esp-primary-dark);font-size:14px;margin-bottom:10px}
.esp-cbt-q-text{font-size:17px;line-height:1.55;margin-bottom:18px;color:#1a2340}
.esp-cbt-options{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}
.esp-cbt-option{display:flex;align-items:flex-start;gap:12px;text-align:left;padding:14px;border:1.5px solid #d7dbe8;border-radius:10px;background:#fff;cursor:pointer;color:#1a2340 !important;font-size:15px;line-height:1.4}
.esp-cbt-option:hover{background:#f4f6fb}
.esp-cbt-option-letter{flex-shrink:0;width:26px;height:26px;border-radius:50%;border:1.5px solid #c7cde0;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px}
.esp-cbt-option-selected{border-color:var(--esp-primary);background:var(--esp-bg-tint)}
.esp-cbt-option-selected .esp-cbt-option-letter{background:var(--esp-primary);border-color:var(--esp-primary);color:#fff}

.esp-cbt-nav{display:flex;gap:8px;margin-top:auto;flex-wrap:wrap}
.esp-cbt-nav-btn{flex:1;min-width:100px;padding:12px;border-radius:8px;border:1px solid #d7dbe8;background:#fff;font-weight:600;cursor:pointer;color:#1a2340}
.esp-cbt-nav-btn:disabled{opacity:.4;cursor:default}
.esp-cbt-next-btn{background:var(--esp-primary);color:#fff !important;border-color:var(--esp-primary)}
.esp-cbt-clear-btn{color:#a12626 !important}

/* Calculator */
.esp-cbt-calculator{position:fixed;bottom:16px;left:16px;right:16px;max-width:280px;margin:0 auto;background:#fff;border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,.25);z-index:30;overflow:hidden}
.esp-cbt-calc-header{display:flex;justify-content:space-between;align-items:center;background:var(--esp-primary-dark);color:#fff;padding:10px 14px;font-weight:700;font-size:14px}
.esp-cbt-calc-close{background:none;border:none;color:#fff;font-size:20px;cursor:pointer;line-height:1}
.esp-cbt-calc-display{width:100%;box-sizing:border-box;border:none;background:#f7f8fb;padding:16px 14px;text-align:right;font-size:26px;font-weight:700;color:#1a2340}
.esp-cbt-calc-keys{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:#e2e6f0}
.esp-cbt-calc-keys button{background:#fff;border:none;padding:16px 0;font-size:17px;font-weight:600;cursor:pointer;color:#1a2340}
.esp-cbt-calc-keys button:active{background:#eef1fa}
.esp-cbt-calc-op{color:var(--esp-primary) !important;font-weight:700}
.esp-cbt-calc-equals{background:var(--esp-primary) !important;color:#fff !important;grid-row:span 1}
.esp-cbt-calc-zero{grid-column:span 2}

/* Confirm-submit modal */
.esp-cbt-modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:40;display:flex;align-items:center;justify-content:center;padding:20px}
.esp-cbt-modal-backdrop[hidden]{display:none}
.esp-cbt-modal{background:#fff;border-radius:14px;padding:24px;max-width:360px;width:100%}
.esp-cbt-modal p{margin-top:0;font-size:15px;line-height:1.5}
.esp-cbt-modal-actions{display:flex;flex-direction:column;gap:10px}

.esp-cbt-result{max-width:560px;margin:24px auto;padding:0 16px}
.esp-cbt-result h3{font-size:28px;color:var(--esp-primary-dark)}

/* Review page */
.esp-cbt-review{max-width:720px}
.esp-cbt-review-summary{font-weight:700;font-size:16px;color:var(--esp-primary-dark)}
.esp-cbt-review-page-info{color:#666;font-size:13px;margin-bottom:20px}
.esp-cbt-review-item{border:1px solid #e2e6f0;border-radius:10px;padding:16px;margin-bottom:14px}
.esp-cbt-review-q{font-size:15px;line-height:1.5;margin-top:0}
.esp-cbt-review-correct-badge{color:#1e7b3e;font-weight:700;font-size:12px}
.esp-cbt-review-wrong-badge{color:#a12626;font-weight:700;font-size:12px}
.esp-cbt-review-unanswered{color:#8a5a00;font-weight:700;font-size:12px}
.esp-cbt-review-options{list-style:none;margin:0;padding:0}
.esp-cbt-review-options li{padding:8px 12px;border:1px solid #eef0f6;border-radius:6px;margin-bottom:6px;font-size:14px}
.esp-cbt-review-opt-correct{background:#e6f6ec;border-color:#1e7b3e !important}
.esp-cbt-review-opt-wrong{background:#fbe9e9;border-color:#a12626 !important}
.esp-cbt-review-options em{display:block;font-size:12px;color:#666;margin-top:2px}
.esp-cbt-review-explanation{background:#f7f8fb;padding:10px 12px;border-radius:8px;font-size:13px;color:#444;margin-bottom:0}
.esp-cbt-review-pagination{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
.esp-cbt-review-pagination a,.esp-cbt-review-page-current{display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:36px;border-radius:6px;text-decoration:none;font-weight:600;font-size:14px}
.esp-cbt-review-pagination a{border:1px solid #d7dbe8;color:var(--esp-primary-dark)}
.esp-cbt-review-page-current{background:var(--esp-primary);color:#fff}

/* Desktop layout (782px+) */
@media (min-width:782px){
	.esp-cbt-body{flex-direction:row}
	.esp-cbt-palette{position:static;width:260px;max-width:none;transform:none;box-shadow:none;border-top:none}
	#esp-cbt-palette-toggle{display:none}
	.esp-cbt-question-pane{max-width:640px;margin:0 auto;padding:32px}
	.esp-cbt-calculator{left:auto;right:24px;bottom:24px;margin:0}
}
