/* Global Theme System, Accessibility, RTL & Modern Settings UI */

/* 1. Global Theme Variables (Light Mode Default) */
:root {
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --border-color: #E2E8F0;
  --input-bg: #F8FAFC;
  --accent-emerald: #10B981;
  --accent-emerald-d: #059669;
  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.04);
}

/* 2. Global Dark Mode Palette ([data-theme="dark"]) */
[data-theme="dark"],
.dark {
  color-scheme: dark;

  --bg-main: #0B1120;
  --bg-card: #162032;
  --card: #131C2E;
  --surface-card: #131C2E;
  --surface-soft: #131C2E;
  --bg-elevated: #1E293B;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --border-color: #2A374F;
  --border: #2A374F;
  --input-bg: #0F172A;
  --accent-emerald: #34D399;
  --accent-emerald-d: #10B981;
  --shadow-card: 0 6px 22px rgba(0, 0, 0, 0.35);

  /* Remap core-theme.css tokens seamlessly */
  --bg: #0B1120;
  --bg-soft: #131C30;
  --surface: #162032;
  --line: #2A374F;
  --line-strong: #3B4C6B;
  --ink: #F8FAFC;
  --ink-2: #CBD5E1;
  --ink-muted: #94A3B8;
  --muted: #94A3B8;
  --faint: #64748B;

  --green: #34D399;  --green-d: #10B981;  --green-s: rgba(16, 185, 129, 0.18);  --green-t: #6EE7B7;  --green-50: rgba(16, 185, 129, 0.12);
  --sky: #38BDF8;    --sky-d: #0EA5E9;    --sky-s: rgba(14, 165, 233, 0.18);   --sky-t: #7DD3FC;
  --indigo: #818CF8; --indigo-d: #6366F1; --indigo-s: rgba(99, 102, 241, 0.20); --indigo-t: #A5B4FC;
  --gold: #FBBF24;   --gold-d: #F59E0B;   --gold-s: rgba(245, 158, 11, 0.18);  --gold-t: #FDE68A;
  --orange: #FB923C; --orange-d: #F97316; --orange-s: rgba(249, 115, 22, 0.18); --orange-t: #FDBA74;
  --red: #F87171;    --red-d: #EF4444;    --red-s: rgba(239, 68, 68, 0.18);    --red-t: #FCA5A5;
  --violet: #A78BFA; --violet-d: #8B5CF6; --violet-s: rgba(139, 92, 246, 0.2); --violet-t: #C4B5FD;
  --pink: #F472B6;   --pink-d: #EC4899;   --pink-s: rgba(236, 72, 153, 0.2);   --pink-t: #F9A8D4;
  --slate: #94A3B8;  --slate-d: #CBD5E1;  --slate-s: #1E293B;                  --slate-t: #CBD5E1;
}

/* Smooth theme transition without breaking reduced-motion */
html, body, .card, .sidebar, .topbar, .bottom-nav, .modal, .well, .input, select, textarea {
  transition: background-color 0.2s ease, color 0.15s ease, border-color 0.2s ease;
}

/* Anti-glare Dark Mode surface harmonization across all pages & views */
[data-theme="dark"] body,
[data-theme="dark"] .app,
[data-theme="dark"] .main,
[data-theme="dark"] .view {
  background-color: var(--bg-main);
  color: var(--text-primary);
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .topbar,
[data-theme="dark"] .bottom-nav,
[data-theme="dark"] .lp-nav {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary);
}

[data-theme="dark"] .card,
[data-theme="dark"] .modal,
[data-theme="dark"] .toast,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .lp-card,
[data-theme="dark"] .chapter-card,
[data-theme="dark"] .qb-pkg-card,
[data-theme="dark"] .qb-pkg-head,
[data-theme="dark"] .qb-chap-card,
[data-theme="dark"] .qb-chap-head,
[data-theme="dark"] .qb-question-card,
[data-theme="dark"] .qb-ws-grid-card,
[data-theme="dark"] .qb-ws-topbar,
[data-theme="dark"] .qb-topbar-card,
[data-theme="dark"] .qb-hub-card,
[data-theme="dark"] .qb-modal-inline,
[data-theme="dark"] .qb-review-card,
[data-theme="dark"] .qb-result-footer,
[data-theme="dark"] .room-card,
[data-theme="dark"] .tutor-shell,
[data-theme="dark"] .tutor-history-sidebar,
[data-theme="dark"] .tutor-workbench,
[data-theme="dark"] .tutor-workbench-sheet,
[data-theme="dark"] .hero-goal,
[data-theme="dark"] .trail-tab,
[data-theme="dark"] .chat-head,
[data-theme="dark"] .chat-input,
[data-theme="dark"] .av-studio-card,
[data-theme="dark"] .vp {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .tb-reader-slim-bar,
[data-theme="dark"] .pdf-reader-toolbar {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .tb-reader-slim-title {
  color: var(--text-primary) !important;
}
[data-theme="dark"] .tb-reader-slim-sub {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .qb-pkg-head:hover,
[data-theme="dark"] .qb-chap-head:hover {
  background: var(--bg-elevated) !important;
}

[data-theme="dark"] .well,
[data-theme="dark"] .stat-mini,
[data-theme="dark"] .qb-pkg-body,
[data-theme="dark"] .qb-sub-row,
[data-theme="dark"] .qb-opt-btn,
[data-theme="dark"] .qb-num-btn,
[data-theme="dark"] .qb-mode-switch,
[data-theme="dark"] .qb-rev-tabs,
[data-theme="dark"] .qb-rev-item,
[data-theme="dark"] .qb-rev-exp-panel,
[data-theme="dark"] .qb-exp-box,
[data-theme="dark"] .qb-report-item,
[data-theme="dark"] .qb-weak-item,
[data-theme="dark"] .qb-wrong-row,
[data-theme="dark"] .qb-sub-right,
[data-theme="dark"] .qb-try-pick,
[data-theme="dark"] .qb-total-pill,
[data-theme="dark"] .qb-chevron,
[data-theme="dark"] .qb-opt-letter,
[data-theme="dark"] .qb-stat-card,
[data-theme="dark"] .vid-choice,
[data-theme="dark"] .choice,
[data-theme="dark"] .opt,
[data-theme="dark"] .opt .key,
[data-theme="dark"] .chip,
[data-theme="dark"] .kbd,
[data-theme="dark"] .node-label,
[data-theme="dark"] .climber-tip,
[data-theme="dark"] .cp-row,
[data-theme="dark"] .bubble,
[data-theme="dark"] .tutor-empty-chips,
[data-theme="dark"] .rc-msg .rc-b,
[data-theme="dark"] .lb-table th,
[data-theme="dark"] .badge-tile,
[data-theme="dark"] .msg-ai,
[data-theme="dark"] .chat-bubble,
[data-theme="dark"] .sb-profile,
[data-theme="dark"] .cloud-pill {
  background: var(--bg-elevated) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .qb-sub-row:hover,
[data-theme="dark"] .qb-opt-btn:hover:not(:disabled),
[data-theme="dark"] .qb-try-pick:hover {
  background: #27354E !important;
}

[data-theme="dark"] .qb-pkg-title,
[data-theme="dark"] .qb-chap-title,
[data-theme="dark"] .qb-sub-title,
[data-theme="dark"] .qb-stem,
[data-theme="dark"] .qb-opt-text,
[data-theme="dark"] .qb-count-big,
[data-theme="dark"] .qb-hub-copy strong,
[data-theme="dark"] .qb-stat-v,
[data-theme="dark"] .qb-rev-num {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .qb-pkg-sub,
[data-theme="dark"] .qb-chap-meta,
[data-theme="dark"] .qb-sub-progress,
[data-theme="dark"] .qb-count-lbl,
[data-theme="dark"] .qb-hub-copy small,
[data-theme="dark"] .qb-stat-k,
[data-theme="dark"] .qb-stat-sub,
[data-theme="dark"] .qb-rev-snippet {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .qb-prog-pill {
  background: rgba(249, 115, 22, 0.18) !important;
  border-color: rgba(251, 146, 60, 0.45) !important;
  color: #FDBA74 !important;
}

[data-theme="dark"] .qb-prog-pill.is-done {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
  color: #6EE7B7 !important;
}

[data-theme="dark"] .qb-timer-pill,
[data-theme="dark"] .qb-flag-mini {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #FDE68A !important;
}

[data-theme="dark"] .qb-solution-box {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: #10B981 !important;
  color: #ECFDF5 !important;
}

[data-theme="dark"] .qb-hub-card.is-active {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: #FBBF24 !important;
}

[data-theme="dark"] .node.base .node-btn {
  background: var(--bg-elevated) !important;
  border-color: var(--border-color) !important;
  color: var(--accent-emerald) !important;
}

[data-theme="dark"] .feedback-title .fb-ic {
  background: var(--bg-card) !important;
}

[data-theme="dark"] .qb-opt-btn.is-selected {
  background: rgba(99, 102, 241, 0.24) !important;
  border-color: #818CF8 !important;
}
[data-theme="dark"] .qb-opt-btn.is-right,
[data-theme="dark"] .qb-solution-box.is-ok,
[data-theme="dark"] .qb-rev-item.is-ok,
[data-theme="dark"] .qb-stat-card.is-green {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: #10B981 !important;
  color: #ECFDF5 !important;
}
[data-theme="dark"] .qb-opt-btn.is-wrong,
[data-theme="dark"] .qb-solution-box.is-err,
[data-theme="dark"] .qb-rev-item.is-err,
[data-theme="dark"] .qb-stat-card.is-red {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: #F87171 !important;
  color: #FEF2F2 !important;
}
[data-theme="dark"] .qb-stat-card.is-gray {
  background: var(--bg-elevated) !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .qb-stat-card.is-amber {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: #FBBF24 !important;
}
[data-theme="dark"] .qb-result-hero {
  background: linear-gradient(135deg, #162032 0%, #1E293B 100%) !important;
}
[data-theme="dark"] .qb-ring-track {
  stroke: #2A374F;
}
[data-theme="dark"] .qb-loading-card,
[data-theme="dark"] .auth-mobile-hero,
[data-theme="dark"] .auth-otp-panel,
[data-theme="dark"] .auth-avatar-bar {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .av-tabs,
[data-theme="dark"] .av-char-btn,
[data-theme="dark"] .auth-tabs,
[data-theme="dark"] .auth-grade-pill,
[data-theme="dark"] .auth-target-pill {
  background: var(--bg-elevated) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .av-mode-btn:hover,
[data-theme="dark"] .auth-tab.is-active {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .qb-formula-hint {
  background: rgba(15, 23, 42, 0.72) !important;
  color: #C7D2FE !important;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .qb-retry-banner {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #FDE68A !important;
}

[data-theme="dark"] .qb-score-mini.is-high { background: rgba(16, 185, 129, 0.24) !important; color: #6EE7B7 !important; }
[data-theme="dark"] .qb-score-mini.is-mid { background: rgba(245, 158, 11, 0.24) !important; color: #FDE68A !important; }
[data-theme="dark"] .qb-score-mini.is-low { background: rgba(244, 63, 94, 0.24) !important; color: #FDA4AF !important; }

[data-theme="dark"] .qb-num-btn.is-correct { background: rgba(16, 185, 129, 0.24) !important; border-color: #34D399 !important; color: #6EE7B7 !important; }
[data-theme="dark"] .qb-num-btn.is-wrong { background: rgba(239, 68, 68, 0.24) !important; border-color: #F87171 !important; color: #FCA5A5 !important; }
[data-theme="dark"] .qb-num-btn.is-flagged { background: rgba(245, 158, 11, 0.24) !important; border-color: #FBBF24 !important; color: #FDE68A !important; }
[data-theme="dark"] .qb-num-btn.is-answered-exam { background: rgba(99, 102, 241, 0.24) !important; border-color: #818CF8 !important; color: #C7D2FE !important; }
[data-theme="dark"] .vid-choice.active { background: rgba(14, 165, 233, 0.20) !important; border-color: #38BDF8 !important; }
[data-theme="dark"] .qb-mode-switch button.active,
[data-theme="dark"] .qb-rev-tab.active,
[data-theme="dark"] .qb-rev-tab.is-active {
  background: #0F172A !important;
  color: #A5B4FC !important;
}
[data-theme="dark"] .qb-ans-chip {
  background: #0F172A !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}
[data-theme="dark"] .qb-rev-key-full,
[data-theme="dark"] .pdf-ans-box {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6EE7B7 !important;
}

[data-theme="dark"] .input,
[data-theme="dark"] input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--input-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748B;
}

[data-theme="dark"] .btn-white,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .icon-btn {
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .btn-white:hover,
[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .icon-btn:hover {
  background: #27354E !important;
}

[data-theme="dark"] .stat-pill {
  background: var(--bg-elevated) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-link {
  color: var(--text-secondary);
}
[data-theme="dark"] .nav-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
[data-theme="dark"] .nav-link.active {
  background: rgba(16, 185, 129, 0.16);
  color: #34D399;
}

[data-theme="dark"] .badge-slate,
[data-theme="dark"] .badge-outline {
  background: #1E293B !important;
  color: #CBD5E1 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .badge-emerald {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6EE7B7 !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
}
[data-theme="dark"] .badge-rose {
  background: rgba(244, 63, 94, 0.2) !important;
  color: #FDA4AF !important;
  border-color: rgba(251, 113, 133, 0.35) !important;
}

[data-theme="dark"] .pdf-stage { background: #0B1120 !important; }
[data-theme="dark"] .pdf-sheet { background: #162032 !important; border-color: #2A374F !important; }
[data-theme="dark"] .pdf-sheet-body,
[data-theme="dark"] .pdf-para,
[data-theme="dark"] .pdf-subhead,
[data-theme="dark"] .pdf-q-stem,
[data-theme="dark"] .pdf-formula-code { color: #F8FAFC !important; }
[data-theme="dark"] .pdf-meta-bar,
[data-theme="dark"] .pdf-q-box,
[data-theme="dark"] .pdf-sheet-foot { background: #1E293B !important; color: #CBD5E1 !important; border-color: #2A374F !important; }
[data-theme="dark"] .pdf-formula-box { background: rgba(99, 102, 241, 0.18) !important; }
[data-theme="dark"] .pdf-case-box { background: rgba(245, 158, 11, 0.14) !important; color: #FDE68A !important; border-color: rgba(251, 191, 36, 0.35) !important; }

[data-theme="dark"] .danger-zone {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
}

/* 3. Accessibility Modes (Berfungsi Nyata di Seluruh Aplikasi) */
html[data-font-scale="100"],
html[data-text-size="normal"] {
  --font-scale: 1;
  font-size: 100%;
}
html[data-font-scale="112"],
html[data-text-size="large"] {
  --font-scale: 1.12;
  font-size: 112%;
}
html[data-font-scale="125"],
html[data-text-size="xlarge"] {
  --font-scale: 1.25;
  font-size: 125%;
}

html[data-contrast="high"],
html[data-high-contrast="1"] {
  --line: #334155;
  --line-strong: #0F172A;
  --border-color: #334155;
  --text-primary: #000000;
  --ink: #000000;
  --ink-2: #0F172A;
  --text-secondary: #1E293B;
  --muted: #1E293B;
}
html[data-theme="dark"][data-contrast="high"],
html[data-theme="dark"][data-high-contrast="1"] {
  --line: #94A3B8;
  --line-strong: #F8FAFC;
  --border-color: #94A3B8;
  --text-primary: #FFFFFF;
  --ink: #FFFFFF;
  --ink-2: #F8FAFC;
  --text-secondary: #E2E8F0;
  --muted: #E2E8F0;
}
html[data-contrast="high"] .card,
html[data-contrast="high"] .set-group-card,
html[data-contrast="high"] .btn,
html[data-contrast="high"] .input,
html[data-contrast="high"] .well,
html[data-high-contrast="1"] .card,
html[data-high-contrast="1"] .set-group-card,
html[data-high-contrast="1"] .btn {
  border-width: 2.5px !important;
}
html[data-contrast="high"] :focus-visible,
html[data-high-contrast="1"] :focus-visible {
  outline: 3px solid var(--accent-emerald) !important;
  outline-offset: 2px !important;
}

html[data-reduce-motion="true"] *,
html[data-reduce-motion="true"] *::before,
html[data-reduce-motion="true"] *::after,
html[data-reduce-motion="1"] *,
html[data-reduce-motion="1"] *::before,
html[data-reduce-motion="1"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* 3b. Pusat Notifikasi (Bell Badge, In-App Banner & Inbox) */
.notif-bell-btn {
  position: relative;
}
.notif-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
  line-height: 1;
}
.notif-bell-badge.hidden {
  display: none !important;
}
.notif-banner {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  max-width: 360px;
  width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 2px solid var(--accent-emerald);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  animation: toastIn 0.25s ease;
}
.notif-banner.out {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.notif-banner-ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  color: var(--accent-emerald-d);
  flex-shrink: 0;
}
.notif-inbox-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.notif-inbox-item:hover {
  background: var(--bg-elevated);
}
.notif-inbox-item.is-unread {
  border-color: var(--accent-emerald);
  background: var(--green-50);
}
[data-theme="dark"] .notif-inbox-item.is-unread {
  background: rgba(16, 185, 129, 0.14);
}
.diff-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.diff-dot.is-green { background: #10B981; }
.diff-dot.is-amber { background: #F59E0B; }
.diff-dot.is-rose { background: #EF4444; }

/* 4. Safe RTL Adjustments (Arabic `ar`) */
html[dir="rtl"] .set-menu-item { text-align: right; }
html[dir="rtl"] .set-menu-chev { transform: rotate(180deg); }
html[dir="rtl"] .set-menu-val { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .sidebar,
html[dir="rtl"] .bottom-nav { direction: ltr; }
html[dir="rtl"] .nav-link,
html[dir="rtl"] .view,
html[dir="rtl"] .topbar-title { direction: rtl; }

/* 5. Modern Settings Layout (Grouped List + Desktop Master-Detail) */
.set-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

/* Mobile-first clean Settings App Header (< | Pengaturan | SELESAI) */
.set-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.set-head-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 78px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: 10px;
}
.set-head-back:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.set-head-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-head-done {
  min-width: 78px;
  text-align: right;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--accent-emerald-d);
  padding: 6px 10px;
  border-radius: 10px;
}
[data-theme="dark"] .set-head-done { color: var(--accent-emerald); }
.set-head-done:hover { background: var(--green-50); }

/* Master-Detail 2 Columns on Desktop (>= 768px) */
.set-master-detail {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.set-master-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
}

.set-detail-col {
  min-width: 0;
  animation: setSlideIn 0.22s ease;
}

@keyframes setSlideIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Grouped Rounded Cards */
.set-group-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.set-group-label {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0 8px;
}

.set-group-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.set-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.14s ease;
}
.set-menu-item:last-child { border-bottom: 0; }
.set-menu-item:hover { background: var(--bg-elevated); }
.set-menu-item.is-active {
  background: var(--green-50);
  color: var(--green-t);
}

.set-menu-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  font-size: 15px;
  flex-shrink: 0;
}
.set-menu-item.is-active .set-menu-ico {
  background: var(--green-s);
}

.set-menu-label {
  flex: 1;
  min-width: 0;
  font-size: 0.87rem;
  font-weight: 800;
  line-height: 1.25;
}

.set-menu-val {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-secondary);
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.set-menu-chev {
  color: var(--faint);
  font-size: 1.05rem;
  font-weight: 900;
  flex-shrink: 0;
  line-height: 1;
}

/* Detail Panel Card */
.set-detail-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.set-detail-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--border-color);
}

.set-detail-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  font-size: 21px;
  flex-shrink: 0;
}

.set-detail-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
}

.set-detail-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Toggle Switch Rows */
.set-toggle-list {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.set-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}
.set-toggle-row:last-child { border-bottom: 0; }

.set-toggle-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

.set-toggle-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.set-switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 99px;
  background: #CBD5E1;
  border: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
[data-theme="dark"] .set-switch { background: #334155; }
.set-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.set-switch.on { background: var(--accent-emerald-d); }
.set-switch.on::after { transform: translateX(20px); }

/* 3 Visual Theme Preview Cards */
.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.theme-preview-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.theme-preview-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-emerald);
}
.theme-preview-card.is-active {
  border-color: var(--accent-emerald-d);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.theme-mockup {
  height: 76px;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1.5px solid var(--border-color);
  overflow: hidden;
}
.theme-mockup.is-light { background: #F8FAFC; border-color: #CBD5E1; }
.theme-mockup.is-dark { background: #0B1120; border-color: #2A374F; }
.theme-mockup.is-system { background: linear-gradient(135deg, #F8FAFC 50%, #0B1120 50%); border-color: #64748B; }

.theme-mock-bar {
  height: 10px;
  width: 58%;
  border-radius: 99px;
}
.theme-mockup.is-light .theme-mock-bar { background: #10B981; }
.theme-mockup.is-dark .theme-mock-bar { background: #34D399; }
.theme-mockup.is-system .theme-mock-bar { background: #6366F1; }

.theme-mock-lines {
  display: flex;
  gap: 6px;
}
.theme-mock-box {
  flex: 1;
  height: 26px;
  border-radius: 7px;
}
.theme-mockup.is-light .theme-mock-box { background: #FFFFFF; border: 1px solid #E2E8F0; }
.theme-mockup.is-dark .theme-mock-box { background: #1E293B; border: 1px solid #2A374F; }
.theme-mockup.is-system .theme-mock-box:first-child { background: #FFFFFF; border: 1px solid #CBD5E1; }
.theme-mockup.is-system .theme-mock-box:last-child { background: #1E293B; border: 1px solid #334155; }

/* Language Picker with Search & 4 Regions */
.lang-search-wrap {
  position: relative;
}
.lang-search-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 700;
}
.lang-search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.lang-region-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lang-region-head {
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.lang-item:hover {
  border-color: var(--accent-emerald);
  background: var(--bg-elevated);
}
.lang-item.is-active {
  border-color: var(--accent-emerald-d);
  background: var(--green-50);
}
.lang-flag { font-size: 1.25rem; flex-shrink: 0; }
.lang-name { font-size: 0.82rem; font-weight: 800; line-height: 1.2; flex: 1; min-width: 0; }
.lang-check {
  color: var(--accent-emerald-d);
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Text Size 3-Card Picker */
.a11y-size-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.a11y-size-btn {
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.a11y-size-btn.is-active {
  border-color: var(--accent-emerald-d);
  background: var(--green-50);
  color: var(--green-t);
}

/* FAQ Accordion */
.faq-item {
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: left;
}
.faq-a {
  padding: 0 15px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Legal Document Body */
.legal-doc-box {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.legal-doc-box h4 {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* Footer: Bold Outline Logout + Signed-in Email + Quick Legal Links */
.set-footer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 0 18px;
}

.set-logout-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 16px;
  border: 2px solid var(--red);
  background: transparent;
  color: var(--red-d);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
[data-theme="dark"] .set-logout-btn { color: #FCA5A5; border-color: #F87171; }
.set-logout-btn:hover { background: var(--red-s); }
.set-logout-btn:active { transform: scale(0.99); }

.set-signed-email {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

.set-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.set-legal-links button {
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}
.set-legal-links button:hover {
  color: var(--accent-emerald-d);
  text-decoration: underline;
}

/* 6. Mobile & Tablet Settings Navigation (<= 960px: 1 kolom bersih) */
@media (max-width: 960px) {
  .set-master-detail {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .set-master-col {
    position: static;
  }
  .set-shell[data-mobile-view="list"] .set-detail-col {
    display: none;
  }
  .set-shell[data-mobile-view="detail"] .set-master-col {
    display: none;
  }
  .set-detail-card {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .theme-cards-grid {
    grid-template-columns: 1fr;
  }
  .lang-grid {
    grid-template-columns: 1fr;
  }
  .set-detail-card {
    padding: 16px;
  }
  .set-detail-card .input {
    min-width: 0;
  }
}

/* 7. RTL Mode (Khusus Bahasa Arab `ar`) & LTR Isolation */
[dir="rtl"] body,
[dir="rtl"] .main,
[dir="rtl"] .view,
[dir="rtl"] .card,
[dir="rtl"] .modal {
  text-align: right;
}

[dir="rtl"] .set-menu-item,
[dir="rtl"] .set-detail-head,
[dir="rtl"] .nav-link,
[dir="rtl"] .qb-opt-btn,
[dir="rtl"] .tutor-empty-chips .chip {
  text-align: right;
}

[dir="rtl"] .set-menu-chevron {
  transform: scaleX(-1);
}

[dir="rtl"] [dir="ltr"],
[dir="rtl"] .ltr-isolate,
[dir="rtl"] [data-stopwatch],
[dir="rtl"] .qb-code-pill,
[dir="rtl"] .qb-timer-pill,
[dir="rtl"] .pomo-clock,
[dir="rtl"] .qb-formula-hint,
[dir="rtl"] .calc-result-val,
[dir="rtl"] .tabular {
  direction: ltr;
  unicode-bidi: isolate;
}

/* 8. Public Pages Light Mode Tokens (`index.html` & `login.html` saat Light Mode) */
html[data-page-scope="public"]:not([data-theme="dark"]) {
  color-scheme: light;
  --bg-main: #F4F6F9;
  --bg-soft: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --border-strong: #CBD5E1;
  --input-bg: #FFFFFF;
}

/* Dark Mode contrast polish for dashboard tracks, progress dots, and teacher logout button */
[data-theme="dark"] .target-line {
  background: #1E293B;
}
[data-theme="dark"] .target-line .flag {
  box-shadow: 0 0 0 2px #162032;
}
[data-theme="dark"] .week-dots span.today {
  box-shadow: 0 0 0 2px #162032, 0 0 0 4px var(--orange);
}
[data-theme="dark"] .lb-mini-row.me {
  border-color: rgba(52, 211, 153, 0.36);
}
[data-theme="dark"] .pos-dots span {
  background: #2A374F;
}
[data-theme="dark"] #tpLogoutBtn {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #FCA5A5 !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
}

/* 9. Cyrillic (`ru`) Typography & Overflow Guard */
html[lang="ru"] {
  --font: 'Nunito', 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
  --font-display: 'Nunito', 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
}

html[lang="ru"] .nav-link,
html[lang="ru"] .set-menu-label,
html[lang="ru"] .btn,
html[lang="ru"] .badge,
html[lang="ru"] .chip,
html[lang="ru"] .qb-opt-btn {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 10. Dark Mode Support for Collapsible Sidebar & Floating Tooltip */
[data-theme="dark"] .sidebar-head,
[data-theme="dark"] .sidebar-foot {
  background: var(--bg-card);
  border-color: var(--border-color);
}
[data-theme="dark"] .sb-toggle-btn,
[data-theme="dark"] .topbar-sb-toggle {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
[data-theme="dark"] .sb-toggle-btn:hover,
[data-theme="dark"] .topbar-sb-toggle:hover {
  background: var(--bg-card);
  border-color: var(--accent-emerald);
  color: var(--text-primary);
}
[data-theme="dark"] .sb-floating-tooltip {
  background: #1E293B;
  color: #F8FAFC;
  border-color: #334155;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}






/* Dark Mode Comprehensive Polish — Naik Gunung, 5 Kasta Liga, Bank Soal, */

/* 1. Halaman Naik Gunung — Header Level 1..10 (Bukan Putih #FFFFFF!) */
[data-theme="dark"] .mtn-level-head:not(.is-secret),
.dark .mtn-level-head:not(.is-secret) {
  background: #131C2E !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .mtn-level-head:not(.is-secret) .h-card,
[data-theme="dark"] .mtn-level-head:not(.is-secret) .mtn-level-title,
.dark .mtn-level-head:not(.is-secret) .h-card,
.dark .mtn-level-head:not(.is-secret) .mtn-level-title {
  color: #F8FAFC !important;
}

[data-theme="dark"] .mtn-level-head:not(.is-secret) .mtn-level-sub,
[data-theme="dark"] .mtn-level-head:not(.is-secret) .t-xs,
.dark .mtn-level-head:not(.is-secret) .mtn-level-sub,
.dark .mtn-level-head:not(.is-secret) .t-xs {
  color: #CBD5E1 !important;
}

[data-theme="dark"] .mtn-level-head .mtn-level-bloom-badge,
.dark .mtn-level-head .mtn-level-bloom-badge {
  background: color-mix(in srgb, var(--lv-accent, #10B981) 20%, #0F172A) !important;
  color: color-mix(in srgb, var(--lv-accent, #10B981) 52%, #FFFFFF) !important;
  border: 1px solid color-mix(in srgb, var(--lv-accent, #10B981) 42%, transparent) !important;
}

[data-theme="dark"] .mtn-level-head .mtn-level-meta-badge,
.dark .mtn-level-head .mtn-level-meta-badge {
  background: rgba(99, 102, 241, 0.22) !important;
  color: #C7D2FE !important;
  border: 1px solid rgba(129, 140, 248, 0.35) !important;
}

/* 2. Tantangan & Papan Peringkat — 5 Kartu Kasta Liga (Anti Putih / Abu Terang) */
[data-theme="dark"] .league-pill,
.dark .league-pill {
  background: #131C2E !important;
  border: 1.5px solid rgba(148, 163, 184, 0.18) !important;
  border-bottom-width: 3px !important;
  color: #F8FAFC !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .league-pill:hover,
.dark .league-pill:hover {
  background: #19243B !important;
  border-color: rgba(148, 163, 184, 0.36) !important;
}

[data-theme="dark"] .league-pill.active,
[data-theme="dark"] .league-pill.is-current-tier,
.dark .league-pill.active,
.dark .league-pill.is-current-tier {
  background: #1E2532 !important;
  border-color: var(--lg-accent, #F59E0B) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--lg-accent, #F59E0B) 48%, transparent),
    0 10px 24px -8px color-mix(in srgb, var(--lg-accent, #F59E0B) 45%, transparent) !important;
}

[data-theme="dark"] .league-pill .league-pill-name,
[data-theme="dark"] .league-pill .c-ink,
.dark .league-pill .league-pill-name,
.dark .league-pill .c-ink {
  color: #F8FAFC !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .league-pill .league-pill-range,
[data-theme="dark"] .league-pill .c-muted,
.dark .league-pill .league-pill-range,
.dark .league-pill .c-muted {
  color: #94A3B8 !important;
}

[data-theme="dark"] .league-pill .badge-outline,
.dark .league-pill .badge-outline {
  background: rgba(15, 23, 42, 0.72) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #CBD5E1 !important;
}

[data-theme="dark"] .league-pill .league-pill-mine,
.dark .league-pill .league-pill-mine {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #6EE7B7 !important;
  border: 1px solid rgba(52, 211, 153, 0.4) !important;
}

[data-theme="dark"] .lb-row-league-pill,
.dark .lb-row-league-pill {
  background: color-mix(in srgb, var(--lg-color, #94A3B8) 18%, #0F172A) !important;
  border-color: color-mix(in srgb, var(--lg-color, #94A3B8) 42%, transparent) !important;
  color: color-mix(in srgb, var(--lg-color, #CBD5E1) 60%, #FFFFFF) !important;
}

[data-theme="dark"] .lb-table th,
.dark .lb-table th {
  background: #131C2E !important;
  color: #94A3B8 !important;
  border-bottom-color: #2A374F !important;
}

[data-theme="dark"] .badge-tile,
.dark .badge-tile {
  background: #131C2E !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

[data-theme="dark"] .badge-tile.locked,
.dark .badge-tile.locked {
  background: #0F172A !important;
}

[data-theme="dark"] .badge-tile.locked .badge-medal,
.dark .badge-tile.locked .badge-medal {
  background: #1E293B !important;
  border-bottom-color: #0F172A !important;
  color: #64748B !important;
}

[data-theme="dark"] .challenge-card.done,
.dark .challenge-card.done {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(52, 211, 153, 0.42) !important;
}

/* 3. Beranda, Belajar & Materi, Bank Soal HOTS, EkoTutor & Ruang Belajar */
[data-theme="dark"] .icon-btn,
[data-theme="dark"] .stat-pill,
[data-theme="dark"] .rc-msg .rc-b,
[data-theme="dark"] .room-mobile-tabs,
[data-theme="dark"] .rag-chunks-drawer,
[data-theme="dark"] .rag-chunk-item,
[data-theme="dark"] .tutor-sheet-grab,
[data-theme="dark"] .tutor-sheet-head,
[data-theme="dark"] .vid-choice,
[data-theme="dark"] .qb-opt-btn,
[data-theme="dark"] .qb-loading-card,
[data-theme="dark"] .qb-exp-box,
[data-theme="dark"] .qb-rev-exp-panel,
[data-theme="dark"] .qb-media-img-btn,
[data-theme="dark"] .qb-source-ext-link,
[data-theme="dark"] .pdf-meta-bar,
[data-theme="dark"] .pdf-q-box,
.dark .icon-btn,
.dark .stat-pill,
.dark .rc-msg .rc-b,
.dark .room-mobile-tabs,
.dark .qb-opt-btn,
.dark .qb-exp-box,
.dark .qb-media-img-btn,
.dark .qb-source-ext-link {
  background: #131C2E !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: #F8FAFC !important;
}

[data-theme="dark"] .qb-sub-right,
[data-theme="dark"] .qb-mode-switch,
[data-theme="dark"] .qb-opt-letter,
[data-theme="dark"] .qb-num-btn,
[data-theme="dark"] .qb-rev-tabs,
[data-theme="dark"] .qb-rev-item,
[data-theme="dark"] .qb-report-item,
[data-theme="dark"] .qb-weak-item,
[data-theme="dark"] .qb-wrong-row,
[data-theme="dark"] .av-mode-tab,
.dark .qb-sub-right,
.dark .qb-mode-switch,
.dark .qb-opt-letter,
.dark .qb-num-btn {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: #CBD5E1 !important;
}

[data-theme="dark"] .qb-mode-switch button.active,
.dark .qb-mode-switch button.active {
  background: #1E293B !important;
  color: #F8FAFC !important;
}

[data-theme="dark"] .qb-opt-btn:hover:not(:disabled),
[data-theme="dark"] .vid-choice:hover,
.dark .qb-opt-btn:hover:not(:disabled),
.dark .vid-choice:hover {
  background: #1E293B !important;
}

/* 4. Portal Guru Web — Seluruh Kartu, Tabel, Filter, Badge & Modal Dark Mode */
[data-theme="dark"] .sb-teacher-badge,
.dark .sb-teacher-badge {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6EE7B7 !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
}

[data-theme="dark"] .tp-kpi-card,
[data-theme="dark"] .tp-class-card,
.dark .tp-kpi-card,
.dark .tp-class-card {
  background: #131C2E !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: #F8FAFC !important;
}

[data-theme="dark"] .tp-heat-row,
[data-theme="dark"] .tp-feed-item,
[data-theme="dark"] .tp-empty-mini,
[data-theme="dark"] .tp-student-mini-card,
[data-theme="dark"] .tp-code-box,
[data-theme="dark"] .tp-mini-stat,
[data-theme="dark"] .tp-seg-bar,
[data-theme="dark"] .tp-hots-pick-item,
[data-theme="dark"] .tp-custom-q-box,
[data-theme="dark"] .tp-table th,
.dark .tp-heat-row,
.dark .tp-feed-item,
.dark .tp-empty-mini,
.dark .tp-student-mini-card,
.dark .tp-code-box,
.dark .tp-mini-stat,
.dark .tp-seg-bar,
.dark .tp-hots-pick-item,
.dark .tp-custom-q-box,
.dark .tp-table th {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .tp-seg-btn.active,
.dark .tp-seg-btn.active {
  background: #1E293B !important;
  color: #6EE7B7 !important;
}

[data-theme="dark"] .tp-hots-pick-item.checked,
.dark .tp-hots-pick-item.checked {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: #10B981 !important;
}

[data-theme="dark"] .tp-chip-soft,
[data-theme="dark"] .tp-status-pill.muted,
.dark .tp-chip-soft,
.dark .tp-status-pill.muted {
  background: #1E293B !important;
  color: #CBD5E1 !important;
}

[data-theme="dark"] .tp-grade-chip,
[data-theme="dark"] .tp-status-pill.pass,
.dark .tp-grade-chip,
.dark .tp-status-pill.pass {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6EE7B7 !important;
}

[data-theme="dark"] .tp-status-pill.remedial,
.dark .tp-status-pill.remedial {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #FCA5A5 !important;
}

[data-theme="dark"] .tp-projector-code,
.dark .tp-projector-code {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6EE7B7 !important;
  border-color: #34D399 !important;
}

[data-theme="dark"] .tp-kpi-ico.emerald { background: rgba(16, 185, 129, 0.18) !important; color: #34D399 !important; }
[data-theme="dark"] .tp-kpi-ico.blue { background: rgba(37, 99, 235, 0.2) !important; color: #60A5FA !important; }
[data-theme="dark"] .tp-kpi-ico.amber { background: rgba(245, 158, 11, 0.2) !important; color: #FBBF24 !important; }
[data-theme="dark"] .tp-kpi-ico.violet { background: rgba(124, 58, 237, 0.22) !important; color: #C4B5FD !important; }
[data-theme="dark"] .tp-kpi-ico.rose { background: rgba(239, 68, 68, 0.2) !important; color: #FCA5A5 !important; }

[data-theme="dark"] .ta-bg-pill,
.dark .ta-bg-pill {
  background: #131C2E !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .ta-bg-pill.active[data-ta-bg="blue"] {
  background: rgba(37, 99, 235, 0.24) !important;
  border-color: #60A5FA !important;
  color: #BFDBFE !important;
}
[data-theme="dark"] .ta-bg-pill.active[data-ta-bg="red"] {
  background: rgba(220, 38, 38, 0.24) !important;
  border-color: #F87171 !important;
  color: #FECACA !important;
}

/* Portal Guru — Pantau Progres Siswa Satu Sekolah (Kls 10, 11, 12) + Subtab */
.tp-subtab-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface-soft, #F1F5F9);
  border: 1px solid var(--border, #E2E8F0);
  flex-wrap: wrap;
}
.tp-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted, #64748B);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.tp-subtab-btn:hover {
  color: var(--ink, #0F172A);
}
.tp-subtab-btn.active {
  background: #FFFFFF;
  color: #047857;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.tp-subtab-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  font-size: 11px;
  font-weight: 900;
}

.tp-school-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tp-school-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tp-school-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border, #E2E8F0);
  background: var(--surface-soft, #F8FAFC);
  color: var(--muted, #475569);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
}
.tp-school-pill:hover {
  border-color: #10B981;
  color: #047857;
}
.tp-school-pill.active {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
}
.tp-school-pill-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 11px;
  font-weight: 900;
}
.tp-school-pill.active .tp-school-pill-cnt {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.tp-school-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tp-school-search-wrap {
  position: relative;
  min-width: 210px;
  flex: 1 1 210px;
}
.tp-school-search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted, #64748B);
  pointer-events: none;
}
.tp-school-search-input {
  height: 36px !important;
  padding: 6px 12px 6px 32px !important;
  font-size: 12.5px !important;
  width: 100%;
}
.tp-school-sort-select {
  height: 36px !important;
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  min-width: 185px;
}

.tp-school-grade-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.tp-school-grade-badge.g10 { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.tp-school-grade-badge.g11 { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.tp-school-grade-badge.g12 { background: #F5F3FF; color: #6D28D9; border: 1px solid #DDD6FE; }

.tp-school-mtn-cell {
  min-width: 165px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tp-school-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-soft, #E2E8F0);
  overflow: hidden;
  margin-top: 2px;
}
.tp-school-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10B981, #059669);
  transition: width 0.25s ease;
}

.tp-school-acc-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.tp-school-acc-pill.high { background: #ECFDF5; color: #047857; }
.tp-school-acc-pill.mid { background: #FFFBEB; color: #B45309; }
.tp-school-acc-pill.low { background: #FEF2F2; color: #DC2626; }
.tp-school-acc-pill.none { background: #F1F5F9; color: #64748B; }

.tp-school-streak-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: #D97706;
  font-size: 11.5px;
  font-weight: 800;
}
.tp-school-streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #B45309;
  font-size: 11.5px;
  font-weight: 800;
}

.tp-school-league-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.tp-school-league-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tp-school-league-pill.bronze { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }
.tp-school-league-pill.silver { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }
.tp-school-league-pill.gold { background: #FEF9C3; color: #A16207; border-color: #FDE047; }
.tp-school-league-pill.sapphire { background: #E0F2FE; color: #0369A1; border-color: #7DD3FC; }
.tp-school-league-pill.emerald { background: #ECFDF5; color: #047857; border-color: #6EE7B7; }
.tp-school-rank-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #64748B);
  padding-left: 2px;
}

.tp-detail-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 680px) {
  .tp-detail-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.tp-detail-mtn-row,
.tp-detail-ch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-soft, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
}
.tp-detail-empty {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-soft, #F8FAFC);
  border: 1px dashed var(--border, #CBD5E1);
  color: var(--muted, #64748B);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* Dark Mode Overrides untuk Panel Siswa Satu Sekolah & Modal Detail */
[data-theme="dark"] .tp-subtab-bar,
.dark .tp-subtab-bar {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}
[data-theme="dark"] .tp-subtab-btn,
.dark .tp-subtab-btn {
  color: #94A3B8 !important;
}
[data-theme="dark"] .tp-subtab-btn.active,
.dark .tp-subtab-btn.active {
  background: #1E293B !important;
  color: #6EE7B7 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
}
[data-theme="dark"] .tp-subtab-cnt,
.dark .tp-subtab-cnt {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #6EE7B7 !important;
}
[data-theme="dark"] .tp-school-pill,
.dark .tp-school-pill {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #CBD5E1 !important;
}
[data-theme="dark"] .tp-school-pill:hover,
.dark .tp-school-pill:hover {
  border-color: #34D399 !important;
  color: #6EE7B7 !important;
}
[data-theme="dark"] .tp-school-pill.active,
.dark .tp-school-pill.active {
  background: #059669 !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
}
[data-theme="dark"] .tp-school-pill-cnt,
.dark .tp-school-pill-cnt {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .tp-school-grade-badge.g10,
.dark .tp-school-grade-badge.g10 { background: rgba(16, 185, 129, 0.18) !important; color: #6EE7B7 !important; border-color: rgba(52, 211, 153, 0.35) !important; }
[data-theme="dark"] .tp-school-grade-badge.g11,
.dark .tp-school-grade-badge.g11 { background: rgba(59, 130, 246, 0.2) !important; color: #93C5FD !important; border-color: rgba(96, 165, 250, 0.35) !important; }
[data-theme="dark"] .tp-school-grade-badge.g12,
.dark .tp-school-grade-badge.g12 { background: rgba(139, 92, 246, 0.22) !important; color: #C4B5FD !important; border-color: rgba(167, 139, 250, 0.35) !important; }

[data-theme="dark"] .tp-school-progress-track,
.dark .tp-school-progress-track {
  background: rgba(148, 163, 184, 0.18) !important;
}
[data-theme="dark"] .tp-school-acc-pill.high,
.dark .tp-school-acc-pill.high { background: rgba(16, 185, 129, 0.2) !important; color: #6EE7B7 !important; }
[data-theme="dark"] .tp-school-acc-pill.mid,
.dark .tp-school-acc-pill.mid { background: rgba(245, 158, 11, 0.2) !important; color: #FCD34D !important; }
[data-theme="dark"] .tp-school-acc-pill.low,
.dark .tp-school-acc-pill.low { background: rgba(239, 68, 68, 0.2) !important; color: #FCA5A5 !important; }
[data-theme="dark"] .tp-school-acc-pill.none,
.dark .tp-school-acc-pill.none { background: #1E293B !important; color: #94A3B8 !important; }

[data-theme="dark"] .tp-school-streak-inline,
.dark .tp-school-streak-inline { color: #FBBF24 !important; }
[data-theme="dark"] .tp-school-streak-chip,
.dark .tp-school-streak-chip {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #FCD34D !important;
}

[data-theme="dark"] .tp-school-league-pill.bronze,
.dark .tp-school-league-pill.bronze { background: rgba(180, 83, 9, 0.24) !important; color: #FCD34D !important; border-color: rgba(251, 191, 36, 0.35) !important; }
[data-theme="dark"] .tp-school-league-pill.silver,
.dark .tp-school-league-pill.silver { background: rgba(148, 163, 184, 0.2) !important; color: #E2E8F0 !important; border-color: rgba(148, 163, 184, 0.35) !important; }
[data-theme="dark"] .tp-school-league-pill.gold,
.dark .tp-school-league-pill.gold { background: rgba(234, 179, 8, 0.24) !important; color: #FDE047 !important; border-color: rgba(250, 204, 21, 0.4) !important; }
[data-theme="dark"] .tp-school-league-pill.sapphire,
.dark .tp-school-league-pill.sapphire { background: rgba(14, 165, 233, 0.22) !important; color: #7DD3FC !important; border-color: rgba(56, 189, 248, 0.4) !important; }
[data-theme="dark"] .tp-school-league-pill.emerald,
.dark .tp-school-league-pill.emerald { background: rgba(16, 185, 129, 0.22) !important; color: #6EE7B7 !important; border-color: rgba(52, 211, 153, 0.4) !important; }

[data-theme="dark"] .tp-detail-mtn-row,
[data-theme="dark"] .tp-detail-ch-row,
[data-theme="dark"] .tp-detail-empty,
.dark .tp-detail-mtn-row,
.dark .tp-detail-ch-row,
.dark .tp-detail-empty {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

/* Komponen Komposit AvatarWithFrame & Tab Border Avatar / Badge Pencapaian */
.avf-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  user-select: none;
}
.avf-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}
.avf-inner > .avatar,
.avf-inner > .eko-avatar-canvas {
  width: 100% !important;
  height: 100% !important;
}
.avf-inner.is-framed {
  border-radius: 14% !important;
  overflow: hidden !important;
}
.avf-inner.is-framed > .avatar,
.avf-inner.is-framed > .eko-avatar-canvas,
.avf-inner.is-framed .eko-av-clip,
.avf-inner.is-framed .eko-av3-bg-img,
.avf-inner.is-framed img,
.avf-inner.is-framed svg,
.eko-avatar-canvas.is-rounded-sq,
.eko-avatar-canvas.is-rounded-sq .eko-av-clip {
  border-radius: 14% !important;
  border: 0 !important;
  box-shadow: none !important;
}
.avf-inner.is-round {
  border-radius: 50% !important;
  overflow: hidden !important;
}
.avf-inner.is-round > .avatar,
.avf-inner.is-round > .eko-avatar-canvas,
.avf-inner.is-round .eko-av-clip {
  border-radius: 50% !important;
}
.sb-avatar-btn:has(.avf-wrap.has-border),
.av-big-ring:has(.avf-wrap.has-border),
.av-sticky-preview-ring:has(.avf-wrap.has-border),
.avf-preview-ring:has(.avf-wrap.has-border) {
  border-radius: 20% !important;
  overflow: visible !important;
}
.avf-border-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  display: block;
}
.avf-badge-wrap {
  position: absolute;
  right: -6%;
  bottom: -6%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.35));
  transition: transform 0.16s ease;
}
.avf-badge-wrap:hover {
  transform: scale(1.16);
}
.avf-badge-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.avf-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.2));
}

.av-mode-tabs.has-cosmetics {
  flex-wrap: wrap;
}
.avf-tab-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
  font-size: 10.5px;
  font-weight: 900;
  margin-left: 2px;
}
.av-mode-tab.active .avf-tab-cnt {
  background: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}

.avf-preview-stage {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-soft, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
}
.avf-preview-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 22px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12), transparent 72%);
}

.avf-cosmetic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.avf-cosmetic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--border, #E2E8F0);
  background: var(--bg-card, #FFFFFF);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.avf-cosmetic-card:hover {
  transform: translateY(-2px);
  border-color: #10B981;
}
.avf-cosmetic-card.active {
  border-color: #059669;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.avf-cosmetic-card.locked {
  opacity: 0.72;
}
.avf-cosmetic-card.locked .avf-cosmetic-img {
  filter: grayscale(1) opacity(0.62);
}
.avf-cosmetic-thumb {
  position: relative;
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avf-cosmetic-thumb.is-none-thumb {
  border-radius: 16px;
  border: 1.5px dashed var(--border, #CBD5E1);
  background: var(--surface-soft, #F8FAFC);
}
.avf-none-glyph {
  font-size: 28px;
  font-weight: 800;
  color: var(--muted, #94A3B8);
}
.avf-cosmetic-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.avf-lock-pill {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #334155;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.avf-check-pill {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #059669;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
}
.avf-cosmetic-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink, #0F172A);
  line-height: 1.25;
}
.avf-cosmetic-status.is-open {
  font-size: 11px;
  font-weight: 800;
  color: #059669;
}
.avf-cosmetic-req {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted, #64748B);
  line-height: 1.3;
}
.avf-cosmetic-prog-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-soft, #E2E8F0);
  overflow: hidden;
  margin-top: 2px;
}
.avf-cosmetic-prog-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10B981, #059669);
}

/* Dark Mode Overrides — AvatarWithFrame & Studio Cosmetics */
[data-theme="dark"] .avf-preview-stage,
.dark .avf-preview-stage {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}
[data-theme="dark"] .avf-cosmetic-card,
.dark .avf-cosmetic-card {
  background: #131C2E !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}
[data-theme="dark"] .avf-cosmetic-card.active,
.dark .avf-cosmetic-card.active {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: #34D399 !important;
}
[data-theme="dark"] .avf-cosmetic-thumb.is-none-thumb,
.dark .avf-cosmetic-thumb.is-none-thumb {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}
[data-theme="dark"] .avf-cosmetic-name,
.dark .avf-cosmetic-name { color: #F1F5F9 !important; }
[data-theme="dark"] .avf-cosmetic-status.is-open,
.dark .avf-cosmetic-status.is-open { color: #6EE7B7 !important; }
[data-theme="dark"] .avf-cosmetic-req,
.dark .avf-cosmetic-req { color: #94A3B8 !important; }
[data-theme="dark"] .avf-cosmetic-prog-track,
.dark .avf-cosmetic-prog-track { background: rgba(148, 163, 184, 0.18) !important; }
[data-theme="dark"] .avf-tab-cnt,
.dark .avf-tab-cnt { background: rgba(16, 185, 129, 0.22) !important; color: #6EE7B7 !important; }

/* Global Dark Mode Harmonization: HOTS Data Tables, Markdown Tables, */
[data-theme="dark"] .qb-media-card,
.dark .qb-media-card {
  background: #111827 !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] .qb-media-head,
.dark .qb-media-head {
  background: #162033 !important;
  border-bottom-color: rgba(148, 163, 184, 0.20) !important;
}
[data-theme="dark"] .qb-media-title,
.dark .qb-media-title {
  color: #F8FAFC !important;
}
[data-theme="dark"] .qb-media-source,
[data-theme="dark"] .qb-chart-note,
.dark .qb-media-source,
.dark .qb-chart-note {
  color: #94A3B8 !important;
  border-top-color: rgba(148, 163, 184, 0.18) !important;
}
[data-theme="dark"] .qb-media-card.is-table .qb-media-kind,
.dark .qb-media-card.is-table .qb-media-kind {
  background: rgba(56, 189, 248, 0.18) !important;
  color: #7DD3FC !important;
}
[data-theme="dark"] .qb-media-card.is-diagram .qb-media-kind,
.dark .qb-media-card.is-diagram .qb-media-kind {
  background: rgba(129, 140, 248, 0.20) !important;
  color: #C7D2FE !important;
}
[data-theme="dark"] .qb-chart-leg-item,
.dark .qb-chart-leg-item {
  color: #E2E8F0 !important;
}

/* Bank Soal HOTS Data Tables (e.g., Data Keuangan Pramesti Salon) */
[data-theme="dark"] .qb-data-table,
.dark .qb-data-table {
  background: #162033 !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] .qb-data-table thead th,
.dark .qb-data-table thead th {
  background: #1E293B !important;
  color: #FFFFFF !important;
  border-bottom: 1.5px solid rgba(148, 163, 184, 0.26) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}
[data-theme="dark"] .qb-data-table tbody tr,
.dark .qb-data-table tbody tr {
  background: #162033 !important;
}
[data-theme="dark"] .qb-data-table tbody tr:nth-child(even),
.dark .qb-data-table tbody tr:nth-child(even) {
  background: #1E293B !important;
}
[data-theme="dark"] .qb-data-table tbody td,
[data-theme="dark"] .qb-data-table tbody td *,
.dark .qb-data-table tbody td,
.dark .qb-data-table tbody td * {
  color: #F1F5F9 !important;
  border-color: rgba(148, 163, 184, 0.20) !important;
}
[data-theme="dark"] .qb-data-table tbody td.is-num,
.dark .qb-data-table tbody td.is-num {
  color: #E2E8F0 !important;
}

/* HOTS True/False (Benar/Salah) Statements Table */
[data-theme="dark"] .qb-tf-table,
.dark .qb-tf-table {
  background: #162033 !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] .qb-tf-table thead th,
.dark .qb-tf-table thead th {
  background: #1E293B !important;
  color: #FFFFFF !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
[data-theme="dark"] .qb-tf-table td,
[data-theme="dark"] .qb-tf-stmt-text,
.dark .qb-tf-table td,
.dark .qb-tf-stmt-text {
  color: #F1F5F9 !important;
  border-color: rgba(148, 163, 184, 0.20) !important;
}
[data-theme="dark"] .qb-tf-radio,
.dark .qb-tf-radio {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .qb-tf-radio.is-selected,
.dark .qb-tf-radio.is-selected {
  background: rgba(16, 185, 129, 0.24) !important;
  border-color: #34D399 !important;
  color: #A7F3D0 !important;
}
[data-theme="dark"] .qb-tf-radio[data-qb-tf-val="false"].is-selected,
.dark .qb-tf-radio[data-qb-tf-val="false"].is-selected {
  background: rgba(239, 68, 68, 0.24) !important;
  border-color: #F87171 !important;
  color: #FECACA !important;
}

/* Universal Dark Mode Tables (Rekap Nilai, Leaderboard, Pembahasan, EkoTutor Markdown, Materi) */
[data-theme="dark"] .tp-table th,
[data-theme="dark"] .lb-table th,
[data-theme="dark"] .bubble table th,
[data-theme="dark"] .qb-exp-box table th,
[data-theme="dark"] .qb-solution-box table th,
[data-theme="dark"] .modal table th,
[data-theme="dark"] .pdf-sheet table th,
.dark .tp-table th,
.dark .lb-table th,
.dark .bubble table th,
.dark .qb-exp-box table th,
.dark .qb-solution-box table th,
.dark .modal table th,
.dark .pdf-sheet table th {
  background: #1E293B !important;
  color: #FFFFFF !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
[data-theme="dark"] .tp-table td,
[data-theme="dark"] .lb-table td,
[data-theme="dark"] .bubble table td,
[data-theme="dark"] .qb-exp-box table td,
[data-theme="dark"] .qb-solution-box table td,
[data-theme="dark"] .modal table td,
[data-theme="dark"] .pdf-sheet table td,
.dark .tp-table td,
.dark .lb-table td,
.dark .bubble table td,
.dark .qb-exp-box table td,
.dark .qb-solution-box table td,
.dark .modal table td,
.dark .pdf-sheet table td {
  color: #F1F5F9 !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}
[data-theme="dark"] .tp-table tbody tr:nth-child(even) td,
[data-theme="dark"] .bubble table tbody tr:nth-child(even) td,
[data-theme="dark"] .qb-exp-box table tbody tr:nth-child(even) td,
.dark .tp-table tbody tr:nth-child(even) td,
.dark .bubble table tbody tr:nth-child(even) td,
.dark .qb-exp-box table tbody tr:nth-child(even) td {
  background: rgba(30, 41, 59, 0.62) !important;
}

/* Dark Mode School Picker, Legal Docs & Teacher Pending Banner */
[data-theme="dark"] .school-picker-dropdown,
[data-theme="dark"] .school-dropdown-list,
.dark .school-picker-dropdown,
.dark .school-dropdown-list {
  background: #162033 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] .school-dropdown-item,
.dark .school-dropdown-item {
  color: #F1F5F9 !important;
}
[data-theme="dark"] .school-dropdown-item:hover,
.dark .school-dropdown-item:hover {
  background: #1E293B !important;
}
[data-theme="dark"] .tp-pending-verify-banner,
.dark .tp-pending-verify-banner {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(251, 191, 36, 0.40) !important;
  color: #FEF3C7 !important;
}
[data-theme="dark"] .tp-pending-verify-banner div,
.dark .tp-pending-verify-banner div {
  color: #FDE68A !important;
}

/* Mountain Reward Icon Glass Tile (Light & Dark Mode — Replaces White Box!) */
.mtn-reward-icon-tile {
  width: 50px;
  height: 50px;
  padding: 5px;
  border-radius: 13px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(16, 185, 129, 0.14);
  border: 1.5px solid rgba(52, 211, 153, 0.42);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  display: block;
}
[data-theme="dark"] .mtn-reward-icon-tile,
.dark .mtn-reward-icon-tile {
  background: rgba(15, 23, 42, 0.68);
  border-color: rgba(251, 191, 36, 0.45);
}

/* Mountain Victory Reward Card & Quiz Option States (Light & Dark Mode) */
.mtn-victory-reward-card {
  background: linear-gradient(135deg, #FEF3C7, #FFFBEB);
  border-color: #F59E0B;
}
.mtn-victory-reward-eyebrow { color: #B45309; }
.mtn-victory-reward-name { color: #78350F; }
[data-theme="dark"] .mtn-victory-reward-card,
.dark .mtn-victory-reward-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(16, 185, 129, 0.14)) !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
}
[data-theme="dark"] .mtn-victory-reward-eyebrow,
.dark .mtn-victory-reward-eyebrow { color: #FDE68A !important; }
[data-theme="dark"] .mtn-victory-reward-name,
.dark .mtn-victory-reward-name { color: #FFFFFF !important; }

.mtn-opt-correct {
  background: #ECFDF5 !important;
  border: 2px solid #10B981 !important;
  color: #065F46 !important;
}
.mtn-opt-wrong {
  background: #FFF1F2 !important;
  border: 2px solid #F43F5E !important;
  color: #9F1239 !important;
}
[data-theme="dark"] .mtn-opt-correct,
.dark .mtn-opt-correct {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: #34D399 !important;
  color: #A7F3D0 !important;
}
[data-theme="dark"] .mtn-opt-wrong,
.dark .mtn-opt-wrong {
  background: rgba(244, 63, 94, 0.18) !important;
  border-color: #FB7185 !important;
  color: #FECDD3 !important;
}

/* Studio Avatar — Mountain Expedition Reward Tiles (Clean Visual Only, Zero Text Inside Box) */
.av-png-tile.is-mtn-reward {
  position: relative;
}
.av-png-tile.is-mtn-reward.is-mtn-unlocked {
  border-color: rgba(52, 211, 153, 0.52);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.14), rgba(30, 41, 59, 0.92));
}
.av-png-tile.is-mtn-reward.is-mtn-locked {
  opacity: 0.72;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.42);
}
.av-png-tile.is-mtn-reward.is-mtn-locked .av-png-thumb-wrap {
  filter: grayscale(0.55) brightness(0.84);
}
.av-png-thumb.is-bg-cover {
  object-fit: cover;
}
.av-mtn-lock-ico {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.55);
  color: #FDE68A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 3;
}

/* EkoTutor AI — Spacious ChatGPT/Gemini Editorial UI, Drawers, Composer & Voice */
/* Hapus header ganda di desktop saat halaman EkoTutor aktif (cukup 1 topbar tipis) */
@media (min-width: 961px) {
  html.tutor-immersive-active .topbar {
    display: none !important;
  }
  html.tutor-immersive-active .tutor-modern-shell {
    height: calc(100vh - 36px);
  }
}

.tutor-modern-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 102px);
  min-height: 560px;
  border-radius: 20px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-color, #E2E8F0);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.tutor-chat-canvas {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
}

/* 1 Topbar Tipis Minimalis (52px) */
.tutor-topbar-slim {
  flex-shrink: 0;
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #E2E8F0;
  z-index: 10;
}
.tutor-topbar-left,
.tutor-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tutor-topbar-title-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  min-width: 0;
}
.tutor-topbar-title {
  font-size: 15px;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.tutor-grade-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #047857;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.tutor-top-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.tutor-top-icon-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.tutor-top-icon-btn i,
.tutor-top-icon-btn svg {
  width: 17px;
  height: 17px;
}
.tutor-top-pill-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #334155;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.tutor-top-pill-btn:hover {
  border-color: #10B981;
  color: #047857;
  background: #ECFDF5;
}
.tutor-top-pill-btn i,
.tutor-top-pill-btn svg {
  width: 15px;
  height: 15px;
}

/* Slide-Over Drawers (Riwayat Kiri & Alat Hitung Kanan — TERTUTUP DEFAULT) */
.tutor-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.tutor-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.tutor-drawer-left,
.tutor-drawer-right {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.tutor-drawer-left {
  left: 0;
  width: min(290px, 86%);
  border-right: 1px solid #E2E8F0;
  transform: translateX(-106%);
}
.tutor-drawer-left.open {
  transform: translateX(0);
}
.tutor-drawer-right {
  right: 0;
  width: min(370px, 92%);
  border-left: 1px solid #E2E8F0;
  transform: translateX(106%);
}
.tutor-drawer-right.open {
  transform: translateX(0);
}
.tutor-drawer-head {
  flex-shrink: 0;
  height: 54px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #E2E8F0;
}
.tutor-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

/* Stream Pesan Terpusat (max-width: 820px) */
.tutor-stream-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 18px 28px;
  scroll-behavior: smooth;
}
.tutor-stream-inner {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Empty State Elegan */
.tutor-empty-hero {
  margin: 4vh auto 0;
  width: 100%;
  max-width: 660px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 16px 8px;
}
.tutor-empty-mascot {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  border: 2px solid rgba(16, 185, 129, 0.42);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12), 0 10px 26px rgba(16, 185, 129, 0.24);
}
.tutor-empty-mascot img,
.tutor-empty-raka-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tutor-empty-title {
  margin: 4px 0 0;
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -0.02em;
}
.tutor-empty-sub {
  margin: 0;
  max-width: 500px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  color: #64748B;
}
.tutor-empty-grid {
  width: 100%;
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tutor-prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  color: #1E293B;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.tutor-prompt-card:hover {
  transform: translateY(-2px);
  border-color: #10B981;
  background: #ECFDF5;
}
.tutor-prompt-ico {
  color: #10B981;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Gelembung User (Kanan) & Editorial EkoTutor AI (Kiri) */
.tutor-row-user {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}
.tutor-user-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: min(600px, 85%);
  gap: 4px;
}
.tutor-bubble-user {
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 20px 20px 6px 20px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #FFFFFF;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.2);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tutor-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}
.tutor-row-user:hover .tutor-user-actions,
.tutor-row-user:focus-within .tutor-user-actions {
  opacity: 1;
}
.tutor-edit-card {
  width: min(620px, 92%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #F8FAFC;
  border: 1.5px solid #10B981;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.14);
}
.tutor-edit-textarea {
  width: 100%;
  min-height: 54px;
  max-height: 200px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0F172A;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.55;
}
.tutor-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.tutor-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.14s ease, transform 0.12s ease, filter 0.14s ease;
}
.tutor-edit-btn.is-cancel {
  background: #E2E8F0;
  color: #334155;
}
.tutor-edit-btn.is-cancel:hover {
  background: #CBD5E1;
}
.tutor-edit-btn.is-save {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.28);
}
.tutor-edit-btn.is-save:hover {
  filter: brightness(1.05);
}
.tutor-user-text {
  white-space: pre-wrap;
}
.tutor-row-bot {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}
.tutor-avatar-ring-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.tutor-avatar-ring-wrap.is-thinking::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #10B981 0deg, #14B8A6 120deg, #34D399 190deg, rgba(16, 185, 129, 0.12) 250deg, #10B981 360deg);
  animation: tutorRingSpin 1.15s linear infinite;
  z-index: 0;
}
.tutor-avatar-ring-wrap.is-thinking::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  border-radius: 50%;
  background: #FFFFFF;
  z-index: 1;
}
.tutor-bot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.tutor-bot-avatar.is-raka {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: #ECFDF5;
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  margin-top: 0;
  padding: 0;
}
.tutor-raka-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tutor-bot-avatar.is-error {
  background: linear-gradient(135deg, #EF4444, #DC2626);
}
.tutor-bot-avatar.is-stopped {
  background: #E2E8F0;
  color: #475569;
}
.tutor-stopped-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 13px;
  border-radius: 12px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
}
.tutor-bot-avatar i,
.tutor-bot-avatar svg {
  width: 15px;
  height: 15px;
}
.tutor-bot-editorial {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tutor-bot-head {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.25;
}
.tutor-bot-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #334155;
  letter-spacing: -0.01em;
}
.tutor-hots-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.24);
  color: #4F46E5;
}
.tutor-thinking-shimmer {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  background: linear-gradient(90deg, #64748B 0%, #10B981 45%, #14B8A6 55%, #64748B 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: tutorShimmer 1.6s linear infinite;
}
.tutor-bot-md {
  font-size: 15px;
  line-height: 1.72;
  color: #1E293B;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  word-spacing: normal;
  letter-spacing: normal;
  max-width: 100%;
}
.tutor-bot-md pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
  padding: 10px 12px;
  border-radius: 12px;
}
.tutor-bot-md strong,
.tutor-bot-md b,
.tutor-bot-md em,
.tutor-bot-md code {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
  word-spacing: normal;
  letter-spacing: normal;
}
.tutor-bot-md pre code {
  white-space: pre;
  overflow-wrap: normal;
}
.tutor-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0;
  border-radius: 12px;
}
.tutor-table-scroll table {
  min-width: 420px;
  margin: 0;
}
.tutor-bot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}
.tutor-act-btn,
.tutor-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #94A3B8;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.tutor-act-btn:hover,
.tutor-copy-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.tutor-act-btn.is-copied {
  color: #059669;
  background: #ECFDF5;
}
.tutor-act-btn.is-speaking {
  color: #DC2626;
  background: #FEF2F2;
  border-color: rgba(239, 68, 68, 0.28);
}
.tutor-error-box {
  padding: 12px 15px;
  border-radius: 14px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.55;
}

/* Composer Kapsul Modern Terpusat (max-width: 820px, overflow: visible agar popover + tidak terpotong) */
.tutor-composer-dock {
  flex-shrink: 0;
  padding: 8px 18px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 28%);
  overflow: visible;
  position: relative;
  z-index: 20;
}
.tutor-composer-inner {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  overflow: visible;
}
.tutor-composer-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px 10px;
  border-radius: 22px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  overflow: visible;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.tutor-composer-card:focus-within {
  border-color: #10B981;
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.14), 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* Strict [hidden] rules agar banner dikte / lampiran / tombol tidak pernah macet tampil */
.tutor-attach-bar[hidden],
.tutor-dictate-status[hidden],
.tutor-plus-popover[hidden],
.tutor-primary-action-btn[hidden] {
  display: none !important;
}

.tutor-attach-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 5px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}
.tutor-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}
.tutor-attach-chip.is-curr {
  background: #ECFDF5;
  border-color: #6EE7B7;
  color: #065F46;
}
.tutor-attach-chip.is-doc {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #3730A3;
}
.tutor-attach-thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.tutor-attach-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 210px;
}
.tutor-attach-lbl small {
  font-weight: 600;
  opacity: 0.72;
}
.tutor-attach-x {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 0;
  background: rgba(15, 23, 42, 0.1);
  color: inherit;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tutor-attach-x:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #DC2626;
}

.tutor-dictate-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #DC2626;
  font-size: 12px;
  font-weight: 800;
}
.tutor-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #EF4444;
  animation: tutorRecPulse 1.1s infinite;
  flex-shrink: 0;
}
.tutor-dictate-stop {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  text-decoration: underline;
  cursor: pointer;
}

.tutor-composer-input {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: #0F172A;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  padding: 2px 6px;
  min-height: 26px;
  max-height: 144px;
}
.tutor-composer-input::placeholder {
  color: #64748B;
}
.tutor-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tutor-composer-left,
.tutor-composer-right {
  display: flex;
  align-items: center;
  gap: 7px;
}
.tutor-plus-wrap {
  position: relative;
}
.tutor-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.tutor-icon-btn:hover {
  border-color: #10B981;
  color: #059669;
  background: #ECFDF5;
}
.tutor-icon-btn i,
.tutor-icon-btn svg {
  width: 17px;
  height: 17px;
}
.tutor-mic-btn.is-recording {
  background: #EF4444 !important;
  border-color: #DC2626 !important;
  color: #FFFFFF !important;
  animation: tutorRecPulse 1.1s infinite;
}

.tutor-primary-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.34);
  transition: transform 0.14s ease, filter 0.14s ease;
}
.tutor-primary-action-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.04);
}
.tutor-primary-action-btn i,
.tutor-primary-action-btn svg {
  width: 18px;
  height: 18px;
}
.tutor-primary-action-btn.is-stop {
  background: #0F172A;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
}
.tutor-stop-square {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 2.5px;
  background: #FFFFFF;
}

.tutor-think-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #334155;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tutor-think-chip:hover {
  border-color: #6366F1;
  color: #4F46E5;
}
.tutor-think-chip.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(99, 102, 241, 0.16));
  border-color: #10B981;
  color: #047857;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.16);
}

/* Popover Menu + (z-index tinggi, tepat di atas tombol +, tidak terpotong) */
.tutor-plus-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(310px, 84vw);
  padding: 6px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tutor-plus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: #0F172A;
  transition: background 0.12s ease;
}
.tutor-plus-item:hover {
  background: #F1F5F9;
}
.tutor-plus-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tutor-plus-ico.is-emerald { background: #ECFDF5; color: #059669; }
.tutor-plus-ico.is-indigo { background: #EEF2FF; color: #4F46E5; }
.tutor-plus-ico.is-amber { background: #FEF3C7; color: #D97706; }
.tutor-plus-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tutor-plus-txt b { font-size: 13px; font-weight: 800; line-height: 1.25; }
.tutor-plus-txt small { font-size: 11px; font-weight: 600; color: #64748B; line-height: 1.3; margin-top: 1px; }

/* Attachment Preview inside User Bubble */
.tutor-msg-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.tutor-msg-thumb {
  width: 152px;
  max-width: 100%;
  max-height: 152px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  display: block;
}
.tutor-msg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tutor-msg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
}

/* Curriculum Quick Picker Modal */
.tutor-curr-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.tutor-curr-tab {
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--border, #CBD5E1);
  background: var(--bg-soft, #F8FAFC);
  color: var(--muted, #475569);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.tutor-curr-tab.active {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
}
.tutor-curr-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 330px;
  overflow-y: auto;
}
.tutor-curr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border, #E2E8F0);
  background: var(--bg-soft, #F8FAFC);
  color: var(--ink, #0F172A);
  text-align: left;
  cursor: pointer;
}
.tutor-curr-item:hover {
  border-color: #10B981;
}
.tutor-curr-item b { display: block; font-size: 13px; font-weight: 800; }
.tutor-curr-item small { display: block; font-size: 11px; font-weight: 600; color: var(--muted, #64748B); margin-top: 2px; }
.tutor-curr-num {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Fullscreen Mode Suara Overlay (Tombol × Pojok Kanan Atas + Maskot Raka) */
.tutor-voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: radial-gradient(circle at 50% 35%, #13223F 0%, #0B1120 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 20px 28px;
  color: #F8FAFC;
}
.tutor-voice-brand-fixed {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 10002;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6EE7B7;
  font-size: 12.5px;
  font-weight: 800;
}
.tutor-voice-close-fixed {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10002;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(30, 41, 59, 0.9);
  color: #F8FAFC;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.tutor-voice-close-fixed:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #EF4444;
  transform: scale(1.06);
}
.tutor-voice-dialog {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.tutor-voice-stage {
  position: relative;
  width: 196px;
  height: 196px;
  display: grid;
  place-items: center;
}
.tutor-voice-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid rgba(16, 185, 129, 0.35);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.tutor-voice-ring.r2 {
  inset: -14px;
  border-color: rgba(52, 211, 153, 0.18);
}
.tutor-voice-stage.is-recording .tutor-voice-ring {
  border-color: rgba(239, 68, 68, 0.65);
  animation: tutorVoicePulse 1.3s ease-in-out infinite;
}
.tutor-voice-stage.is-speaking .tutor-voice-ring {
  border-color: rgba(16, 185, 129, 0.72);
  animation: tutorVoicePulse 1.5s ease-in-out infinite;
}
.tutor-voice-stage.is-thinking .tutor-voice-ring,
.tutor-voice-stage.is-transcribing .tutor-voice-ring {
  border-color: rgba(99, 102, 241, 0.68);
  animation: tutorVoicePulse 1.8s ease-in-out infinite;
}
.tutor-voice-avatar {
  width: 158px;
  height: 158px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25), rgba(15, 23, 42, 0.92));
  border: 3px solid rgba(52, 211, 153, 0.55);
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 2;
}
.tutor-voice-avatar img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}
.tutor-voice-status {
  font-size: 16.5px;
  font-weight: 900;
  color: #6EE7B7;
  letter-spacing: 0.02em;
}
.tutor-voice-captions {
  width: 100%;
  min-height: 76px;
  max-height: 170px;
  overflow-y: auto;
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tutor-voice-q { font-size: 13px; font-weight: 700; color: #94A3B8; font-style: italic; }
.tutor-voice-a { font-size: 14.5px; font-weight: 600; color: #F1F5F9; line-height: 1.55; }
.tutor-voice-hint { font-size: 13px; font-weight: 600; color: #94A3B8; line-height: 1.5; }
.tutor-voice-err { font-size: 13.5px; font-weight: 700; color: #FCA5A5; line-height: 1.55; }
.tutor-voice-warn {
  font-size: 13px;
  font-weight: 700;
  color: #FDE68A;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.36);
  border-radius: 12px;
  padding: 9px 12px;
  line-height: 1.5;
}

/* Real-Time Mic Volume Meter (Mode Suara & Mode Dikte) */
.tutor-mic-meter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(52, 211, 153, 0.34);
}
.tutor-mic-bar {
  width: 5px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #34D399, #10B981);
  transition: height 65ms linear, background-color 120ms ease;
}
.tutor-mic-meter.is-active .tutor-mic-bar {
  background: linear-gradient(180deg, #6EE7B7, #10B981);
}
.tutor-dictate-meter {
  width: 56px;
  height: 7px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.18);
  overflow: hidden;
  flex-shrink: 0;
}
.tutor-dictate-meter-fill {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10B981, #EF4444);
  transition: width 70ms linear;
}

/* Compact Microphone Device Picker inside Voice Overlay */
.tutor-voice-mic-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.24);
}
.tutor-voice-mic-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  color: #94A3B8;
  white-space: nowrap;
  flex-shrink: 0;
}
.tutor-voice-mic-select {
  flex: 1;
  min-width: 0;
  background: #0F172A;
  color: #F1F5F9;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.tutor-voice-mic-select:focus {
  border-color: #34D399;
}
.tutor-voice-mic-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tutor-voice-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}
.tutor-voice-main-btn,
.tutor-voice-interrupt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 0;
  font-size: 14.5px;
  font-weight: 900;
  color: #FFFFFF;
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  cursor: pointer;
}
.tutor-voice-main-btn.is-rec {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}
.tutor-voice-main-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tutor-voice-interrupt {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.32);
}

@keyframes tutorRecPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.06); }
}
@keyframes tutorVoicePulse {
  0%, 100% { transform: scale(0.96); opacity: 0.55; }
  50% { transform: scale(1.1); opacity: 1; }
}
@keyframes tutorRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes tutorShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -120% 0; }
}

@media (max-width: 1024px) and (min-width: 961px) {
  html.tutor-immersive-active .tutor-modern-shell {
    height: calc(100dvh - 108px);
  }
}

@media (max-width: 960px) {
  .tutor-modern-shell {
    height: calc(100dvh - 166px);
    min-height: 440px;
  }
}

@media (max-width: 680px) {
  .tutor-modern-shell {
    height: calc(100dvh - 156px);
    min-height: 420px;
    border-radius: 16px;
  }
  .tutor-empty-grid {
    grid-template-columns: 1fr;
  }
  .tutor-top-pill-btn span {
    display: none;
  }
  .tutor-stream-scroll {
    padding: 14px 12px 20px;
  }
  .tutor-composer-dock {
    padding: 6px 10px 10px;
  }
  .tutor-user-col {
    max-width: 92%;
  }
}

@media (max-width: 480px) {
  .tutor-topbar-slim {
    padding: 0 10px;
    gap: 6px;
  }
  .tutor-topbar-title {
    font-size: 13.5px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tutor-grade-pill {
    padding: 2px 7px;
    font-size: 10.5px;
  }
  .tutor-grade-pill[data-teacher-ctx-pill] {
    display: none;
  }
  .tutor-composer-dock {
    padding: 6px 8px 10px;
  }
  .tutor-composer-card {
    padding: 9px 10px 8px;
    border-radius: 18px;
    gap: 6px;
  }
  .tutor-composer-bar {
    gap: 6px;
  }
  .tutor-composer-left {
    gap: 5px;
    min-width: 0;
    flex: 1 1 auto;
  }
  .tutor-composer-right {
    gap: 5px;
    flex-shrink: 0;
  }
  .tutor-icon-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }
  .tutor-primary-action-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .tutor-think-chip {
    height: 34px;
    padding: 0 9px;
    font-size: 11.5px;
    gap: 4px;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .avf-cosmetic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .avf-cosmetic-card {
    padding: 10px 8px;
  }
  .avf-cosmetic-thumb {
    width: 62px;
    height: 62px;
  }
  .avf-preview-stage {
    padding: 12px;
    gap: 12px;
  }
}

/* Dark Mode Overrides — Deep Navy Slate (#0B1120 / #151F32) */
[data-theme="dark"] .tutor-modern-shell,
.dark .tutor-modern-shell {
  background: #0B1120 !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}
[data-theme="dark"] .tutor-topbar-slim,
.dark .tutor-topbar-slim {
  background: rgba(11, 17, 32, 0.94) !important;
  border-bottom-color: rgba(148, 163, 184, 0.16) !important;
}
[data-theme="dark"] .tutor-topbar-title,
.dark .tutor-topbar-title {
  color: #F8FAFC !important;
}
[data-theme="dark"] .tutor-grade-pill,
.dark .tutor-grade-pill {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  color: #6EE7B7 !important;
}
[data-theme="dark"] .tutor-top-icon-btn,
.dark .tutor-top-icon-btn {
  color: #CBD5E1 !important;
}
[data-theme="dark"] .tutor-top-icon-btn:hover,
.dark .tutor-top-icon-btn:hover {
  background: #1E293B !important;
  color: #FFFFFF !important;
}
[data-theme="dark"] .tutor-top-pill-btn,
.dark .tutor-top-pill-btn {
  background: #151F32 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .tutor-top-pill-btn:hover,
.dark .tutor-top-pill-btn:hover {
  border-color: #10B981 !important;
  color: #6EE7B7 !important;
}
[data-theme="dark"] .tutor-drawer-left,
[data-theme="dark"] .tutor-drawer-right,
.dark .tutor-drawer-left,
.dark .tutor-drawer-right {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}
[data-theme="dark"] .tutor-drawer-head,
.dark .tutor-drawer-head {
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}
[data-theme="dark"] .tutor-empty-mascot,
.dark .tutor-empty-mascot {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
}
[data-theme="dark"] .tutor-empty-title,
.dark .tutor-empty-title {
  color: #F8FAFC !important;
}
[data-theme="dark"] .tutor-empty-sub,
.dark .tutor-empty-sub {
  color: #94A3B8 !important;
}
[data-theme="dark"] .tutor-prompt-card,
.dark .tutor-prompt-card {
  background: #151F32 !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .tutor-prompt-card:hover,
.dark .tutor-prompt-card:hover {
  border-color: #10B981 !important;
  background: rgba(16, 185, 129, 0.14) !important;
}
[data-theme="dark"] .tutor-bot-md,
.dark .tutor-bot-md {
  color: #E2E8F0 !important;
}
[data-theme="dark"] .tutor-bot-md strong,
[data-theme="dark"] .tutor-bot-md b,
[data-theme="dark"] .tutor-bot-md h4,
.dark .tutor-bot-md strong,
.dark .tutor-bot-md b,
.dark .tutor-bot-md h4 {
  color: #F8FAFC !important;
}
[data-theme="dark"] .tutor-bot-md table,
.dark .tutor-bot-md table {
  border-color: rgba(148, 163, 184, 0.28) !important;
  background: #0F172A !important;
}
[data-theme="dark"] .tutor-bot-md th,
.dark .tutor-bot-md th {
  background: #1E293B !important;
  color: #FFFFFF !important;
  border-bottom-color: rgba(148, 163, 184, 0.28) !important;
}
[data-theme="dark"] .tutor-bot-md td,
.dark .tutor-bot-md td {
  color: #F1F5F9 !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}
[data-theme="dark"] .tutor-avatar-ring-wrap.is-thinking::after,
.dark .tutor-avatar-ring-wrap.is-thinking::after {
  background: #0B1120 !important;
}
[data-theme="dark"] .tutor-bot-name,
.dark .tutor-bot-name {
  color: #CBD5E1 !important;
}
[data-theme="dark"] .tutor-hots-pill,
.dark .tutor-hots-pill {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: rgba(129, 140, 248, 0.35) !important;
  color: #C7D2FE !important;
}
[data-theme="dark"] .tutor-act-btn,
[data-theme="dark"] .tutor-copy-btn,
.dark .tutor-act-btn,
.dark .tutor-copy-btn {
  color: #94A3B8 !important;
}
[data-theme="dark"] .tutor-act-btn:hover,
[data-theme="dark"] .tutor-copy-btn:hover,
.dark .tutor-act-btn:hover,
.dark .tutor-copy-btn:hover {
  background: #1E293B !important;
  color: #F8FAFC !important;
}
[data-theme="dark"] .tutor-act-btn.is-copied,
.dark .tutor-act-btn.is-copied {
  color: #6EE7B7 !important;
  background: rgba(16, 185, 129, 0.16) !important;
}
[data-theme="dark"] .tutor-act-btn.is-speaking,
.dark .tutor-act-btn.is-speaking {
  color: #FCA5A5 !important;
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}
[data-theme="dark"] .tutor-error-box,
.dark .tutor-error-box {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
  color: #FECACA !important;
}
[data-theme="dark"] .tutor-bot-avatar.is-stopped,
.dark .tutor-bot-avatar.is-stopped {
  background: #1E293B !important;
  color: #CBD5E1 !important;
}
[data-theme="dark"] .tutor-stopped-note,
.dark .tutor-stopped-note {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #CBD5E1 !important;
}
[data-theme="dark"] .tutor-edit-card,
.dark .tutor-edit-card {
  background: #1E293B !important;
  border-color: #10B981 !important;
}
[data-theme="dark"] .tutor-edit-textarea,
.dark .tutor-edit-textarea {
  color: #F8FAFC !important;
}
[data-theme="dark"] .tutor-edit-btn.is-cancel,
.dark .tutor-edit-btn.is-cancel {
  background: #334155 !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .tutor-primary-action-btn.is-stop,
.dark .tutor-primary-action-btn.is-stop {
  background: #F8FAFC !important;
  color: #0F172A !important;
}
[data-theme="dark"] .tutor-primary-action-btn.is-stop .tutor-stop-square,
.dark .tutor-primary-action-btn.is-stop .tutor-stop-square {
  background: #0F172A !important;
}
[data-theme="dark"] .tutor-composer-dock,
.dark .tutor-composer-dock {
  background: linear-gradient(180deg, rgba(11, 17, 32, 0) 0%, #0B1120 30%) !important;
}
[data-theme="dark"] .tutor-composer-card,
.dark .tutor-composer-card {
  background: #151F32 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36) !important;
}
[data-theme="dark"] .tutor-composer-card:focus-within,
.dark .tutor-composer-card:focus-within {
  border-color: #10B981 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}
[data-theme="dark"] .tutor-composer-input,
.dark .tutor-composer-input {
  color: #F1F5F9 !important;
}
[data-theme="dark"] .tutor-composer-input::placeholder,
.dark .tutor-composer-input::placeholder {
  color: #94A3B8 !important;
}
[data-theme="dark"] .tutor-icon-btn,
[data-theme="dark"] .tutor-think-chip,
.dark .tutor-icon-btn,
.dark .tutor-think-chip {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .tutor-think-chip.active,
.dark .tutor-think-chip.active {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #34D399 !important;
  color: #6EE7B7 !important;
}
[data-theme="dark"] .tutor-plus-popover,
.dark .tutor-plus-popover {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.58) !important;
}
[data-theme="dark"] .tutor-plus-item,
.dark .tutor-plus-item {
  color: #F1F5F9 !important;
}
[data-theme="dark"] .tutor-plus-item:hover,
.dark .tutor-plus-item:hover {
  background: #1E293B !important;
}
[data-theme="dark"] .tutor-plus-txt small,
.dark .tutor-plus-txt small {
  color: #94A3B8 !important;
}
[data-theme="dark"] .tutor-attach-chip,
.dark .tutor-attach-chip {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.32) !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .tutor-attach-chip.is-curr,
.dark .tutor-attach-chip.is-curr {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
  color: #6EE7B7 !important;
}
[data-theme="dark"] .tutor-attach-chip.is-doc,
.dark .tutor-attach-chip.is-doc {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: rgba(129, 140, 248, 0.45) !important;
  color: #C7D2FE !important;
}
[data-theme="dark"] .tutor-curr-item,
.dark .tutor-curr-item {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #F1F5F9 !important;
}

/* Universal Question Renderer (.qr-*) — Media Visual, SVG, Bintang & Matrix TF */
:root {
  --qr-bg: #F8FAFC;
  --qr-surface: #FFFFFF;
  --qr-border: #CBD5E1;
  --qr-text: #0F172A;
  --qr-muted: #64748B;
  --qr-axis: #334155;
  --qr-grid: rgba(148, 163, 184, 0.28);
  --qr-demand: #2563EB;
  --qr-supply: #059669;
  --qr-shift: #D97706;
  --qr-policy: #E11D48;
  --qr-node-bg: #FFFFFF;
  --qr-node-stroke: #94A3B8;
  --qr-bar: #10B981;
}
[data-theme="dark"],
.dark {
  --qr-bg: #0F172A;
  --qr-surface: #131C2E;
  --qr-border: rgba(148, 163, 184, 0.26);
  --qr-text: #F1F5F9;
  --qr-muted: #94A3B8;
  --qr-axis: #CBD5E1;
  --qr-grid: rgba(148, 163, 184, 0.18);
  --qr-demand: #60A5FA;
  --qr-supply: #34D399;
  --qr-shift: #FBBF24;
  --qr-policy: #FB7185;
  --qr-node-bg: #1E293B;
  --qr-node-stroke: #475569;
  --qr-bar: #34D399;
}

.qr-media-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.qr-media-card {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--qr-bg);
  border: 1.5px solid var(--qr-border);
  color: var(--qr-text);
}
.qr-media-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.qr-media-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--qr-text);
  line-height: 1.35;
}
.qr-media-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .qr-media-badge,
.dark .qr-media-badge {
  color: #6EE7B7;
}
.qr-media-caption {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--qr-muted);
  line-height: 1.45;
}

/* Tabel Data / Akuntansi Responsif */
.qr-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--qr-border);
  background: var(--qr-surface);
}
.qr-table {
  width: 100%;
  min-width: 340px;
  border-collapse: collapse;
  font-size: 13px;
}
.qr-table th,
.qr-table td {
  padding: 8px 11px;
  text-align: left;
  border-bottom: 1px solid var(--qr-border);
  color: var(--qr-text);
  vertical-align: top;
}
.qr-table tr:last-child td {
  border-bottom: 0;
}
.qr-table th {
  background: rgba(148, 163, 184, 0.12);
  font-weight: 800;
  white-space: nowrap;
}
.qr-table th.is-num,
.qr-table td.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* SVG Kurva, Grafik & Diagram Adaptif */
.qr-svg-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  background: var(--qr-surface);
  border-radius: 10px;
  border: 1px solid var(--qr-border);
  padding: 6px;
}
.qr-svg {
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
}
.qr-svg-axis { stroke: var(--qr-axis); stroke-width: 1.8; }
.qr-svg-grid { stroke: var(--qr-grid); stroke-width: 1; }
.qr-svg-guide { stroke: var(--qr-muted); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.7; }
.qr-svg-demand { stroke: var(--qr-demand); stroke-width: 2.6; stroke-linecap: round; }
.qr-svg-supply { stroke: var(--qr-supply); stroke-width: 2.6; stroke-linecap: round; }
.qr-svg-shift { stroke: var(--qr-shift); stroke-width: 2.5; stroke-linecap: round; }
.qr-svg-policy { stroke: var(--qr-policy); stroke-width: 2.2; }
.qr-svg-line { stroke: var(--qr-demand); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.qr-svg-area { fill: rgba(37, 99, 235, 0.12); }
.qr-svg-bar { fill: var(--qr-bar); }
.qr-svg-dot { fill: var(--qr-demand); stroke: var(--qr-surface); stroke-width: 2; }
.qr-svg-dot-shift { fill: var(--qr-shift); stroke: var(--qr-surface); stroke-width: 2; }
.qr-svg-zone-amber { fill: rgba(245, 158, 11, 0.18); }
.qr-svg-zone-rose { fill: rgba(244, 63, 94, 0.16); }
.qr-svg-node { fill: var(--qr-node-bg); stroke: var(--qr-node-stroke); stroke-width: 1.6; }
.qr-svg-node.is-accent { stroke: var(--qr-demand); }
.qr-svg-node.is-emerald { stroke: var(--qr-supply); }
.qr-svg-arrow { stroke: var(--qr-axis); stroke-width: 1.8; }
.qr-svg-arrowhead { fill: var(--qr-axis); }
.qr-svg-lbl { font-size: 12px; font-weight: 800; fill: var(--qr-text); }
.qr-svg-lbl.is-demand { fill: var(--qr-demand); }
.qr-svg-lbl.is-supply { fill: var(--qr-supply); }
.qr-svg-lbl.is-shift { fill: var(--qr-shift); }
.qr-svg-lbl.is-policy { fill: var(--qr-policy); }
.qr-svg-eq { font-size: 11px; font-weight: 800; fill: var(--qr-text); }
.qr-svg-eq.is-shift { fill: var(--qr-shift); }
.qr-svg-axis-lbl { font-size: 11px; font-weight: 800; fill: var(--qr-muted); }
.qr-svg-val { font-size: 10.5px; font-weight: 800; fill: var(--qr-text); }
.qr-svg-small { font-size: 10px; font-weight: 700; fill: var(--qr-muted); }
.qr-svg-node-txt { font-size: 10.5px; font-weight: 800; fill: var(--qr-text); }

/* Gambar / Infografis */
.qr-img-frame {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--qr-border);
  background: var(--qr-surface);
}
.qr-media-img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* 5 Bintang Kesulitan (Ala GO Expert) */
.qr-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  line-height: 1;
}
.qr-star {
  font-size: 13px;
  line-height: 1;
}
.qr-star.is-on {
  color: #F59E0B;
}
.qr-star.is-off {
  color: rgba(148, 163, 184, 0.5);
}
.qr-stars-tier {
  margin-left: 5px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #B45309;
}
[data-theme="dark"] .qr-stars-tier,
.dark .qr-stars-tier {
  color: #FDE68A;
}

/* Tabel Matriks Benar / Salah (matrix_tf) */
.qr-tf-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.qr-tf-table {
  width: 100%;
  min-width: 340px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.qr-tf-table th,
.qr-tf-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--qr-border);
  color: var(--qr-text);
  vertical-align: middle;
}
.qr-tf-table tr:last-child td {
  border-bottom: 0;
}
.qr-tf-table th {
  background: rgba(148, 163, 184, 0.12);
  font-weight: 800;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.qr-tf-table th.qr-tf-col,
.qr-tf-table td.qr-tf-choice {
  text-align: center;
  width: 86px;
}
.qr-tf-num {
  font-weight: 900;
  color: var(--qr-muted);
  margin-right: 4px;
}
.qr-tf-stmt-txt {
  font-weight: 600;
  line-height: 1.5;
}
.qr-tf-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--qr-border);
  background: var(--qr-bg);
  color: var(--qr-text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}
.qr-tf-btn:hover:not(:disabled) {
  border-color: #10B981;
  color: #059669;
}
.qr-tf-btn.is-picked {
  background: #4F46E5;
  border-color: #4F46E5;
  color: #FFFFFF;
}
.qr-tf-row.is-correct {
  background: rgba(16, 185, 129, 0.08);
}
.qr-tf-row.is-wrong {
  background: rgba(244, 63, 94, 0.08);
}
.qr-tf-btn.is-key {
  box-shadow: 0 0 0 2px #10B981;
}
.qr-tf-row-fb {
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
}
.qr-tf-row-fb.ok { color: #059669; }
.qr-tf-row-fb.bad { color: #E11D48; }
[data-theme="dark"] .qr-tf-row-fb.ok,
.dark .qr-tf-row-fb.ok { color: #6EE7B7; }
[data-theme="dark"] .qr-tf-row-fb.bad,
.dark .qr-tf-row-fb.bad { color: #FDA4AF; }
.qr-tf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* GO Expert Style Cards — PG A-E (/x), Radio Matrix B/S, Solusi, & Bank Guru */
.qr-go-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--qr-surface);
  border: 1.5px solid var(--qr-border);
  display: flex;
  flex-direction: column;
  gap: 13px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.qr-go-card.is-ok { border-color: rgba(16, 185, 129, 0.45); }
.qr-go-card.is-err { border-color: rgba(244, 63, 94, 0.42); }
.qr-go-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.qr-go-head-left,
.qr-go-head-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.qr-src-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.qr-src-badge.is-book { background: rgba(16, 185, 129, 0.14); color: #047857; border: 1px solid rgba(16, 185, 129, 0.34); }
.qr-src-badge.is-archive { background: rgba(37, 99, 235, 0.12); color: #1D4ED8; border: 1px solid rgba(37, 99, 235, 0.3); }
.qr-src-badge.is-ai { background: rgba(124, 58, 237, 0.12); color: #6D28D9; border: 1px solid rgba(124, 58, 237, 0.3); }
[data-theme="dark"] .qr-src-badge.is-book, .dark .qr-src-badge.is-book { color: #6EE7B7; }
[data-theme="dark"] .qr-src-badge.is-archive, .dark .qr-src-badge.is-archive { color: #93C5FD; }
[data-theme="dark"] .qr-src-badge.is-ai, .dark .qr-src-badge.is-ai { color: #DDD6FE; }

.qr-chap-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--qr-bg);
  border: 1px solid var(--qr-border);
  color: var(--qr-muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qr-num-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.06);
  color: var(--qr-text);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .qr-num-pill, .dark .qr-num-pill {
  background: rgba(148, 163, 184, 0.16);
}
.qr-flag-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.18);
  color: #B45309;
}
[data-theme="dark"] .qr-flag-pill, .dark .qr-flag-pill { color: #FDE68A; }

.qr-status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.qr-status-pill.is-ok, .qr-status-pill.is-key { background: rgba(16, 185, 129, 0.16); color: #047857; }
.qr-status-pill.is-err { background: rgba(244, 63, 94, 0.16); color: #BE123C; }
.qr-status-pill.is-blank { background: rgba(148, 163, 184, 0.18); color: var(--qr-muted); }
[data-theme="dark"] .qr-status-pill.is-ok, [data-theme="dark"] .qr-status-pill.is-key,
.dark .qr-status-pill.is-ok, .dark .qr-status-pill.is-key { color: #6EE7B7; }
[data-theme="dark"] .qr-status-pill.is-err, .dark .qr-status-pill.is-err { color: #FDA4AF; }

.qr-ragu-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 10px;
  border: 1.5px solid var(--qr-border);
  background: var(--qr-bg);
  color: var(--qr-text);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}
.qr-ragu-check.is-checked {
  background: rgba(245, 158, 11, 0.16);
  border-color: #F59E0B;
  color: #B45309;
}
[data-theme="dark"] .qr-ragu-check.is-checked, .dark .qr-ragu-check.is-checked { color: #FDE68A; }
.qr-ragu-box {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.qr-go-stem {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.68;
  color: var(--qr-text);
}
.qr-go-source-line {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--qr-muted);
}

/* PG A–E Cards (Mode Kerjakan, Review /x, & Kunci Guru) */
.qr-pg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.qr-pg-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--qr-border);
  background: var(--qr-bg);
  color: var(--qr-text);
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}
.qr-pg-card:hover:not(:disabled):not(.is-static) {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.06);
}
.qr-pg-card.is-selected {
  border-color: #4F46E5;
  background: rgba(79, 70, 229, 0.1);
}
.qr-pg-card.is-static { cursor: default; }
.qr-pg-card.is-key {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.12);
}
.qr-pg-card.is-student-correct {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}
.qr-pg-card.is-student-wrong {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.12);
}
.qr-pg-card.is-dim-wrong {
  opacity: 0.82;
}
.qr-pg-letter {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1.5px solid var(--qr-border);
  background: var(--qr-surface);
  color: var(--qr-text);
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qr-pg-card.is-selected .qr-pg-letter { background: #4F46E5; border-color: #4F46E5; color: #FFFFFF; }
.qr-pg-card.is-key .qr-pg-letter { background: #10B981; border-color: #10B981; color: #FFFFFF; }
.qr-pg-card.is-student-wrong .qr-pg-letter { background: #EF4444; border-color: #EF4444; color: #FFFFFF; }
.qr-pg-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.qr-pg-picked-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  vertical-align: middle;
}
.qr-pg-picked-tag.is-ok { background: #10B981; color: #FFFFFF; }
.qr-pg-picked-tag.is-err { background: #EF4444; color: #FFFFFF; }
.qr-pg-mark {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}
.qr-pg-mark.is-ok { background: #10B981; color: #FFFFFF; }
.qr-pg-mark.is-err { background: #EF4444; color: #FFFFFF; }
.qr-pg-mark.is-muted-x { background: rgba(148, 163, 184, 0.16); color: #94A3B8; }

/* Radio Bulat & Highlight Blok Hijau/Merah pada Matriks Benar/Salah */
.qr-tf-radio {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid var(--qr-border);
  background: var(--qr-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.qr-tf-radio:hover:not(:disabled) {
  border-color: #10B981;
}
.qr-tf-radio.is-checked {
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}
.qr-tf-radio-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.12s ease;
}
.qr-tf-radio.is-checked .qr-tf-radio-dot {
  background: #4F46E5;
}
.qr-tf-choice.is-key-block {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #047857;
}
.qr-tf-choice.is-wrong-block {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #BE123C;
}
.qr-tf-cell-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}
.qr-tf-cell-icon.is-ok { background: #10B981; color: #FFFFFF; }
.qr-tf-cell-icon.is-err { background: #EF4444; color: #FFFFFF; }
.qr-tf-cell-sub {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  margin-top: 2px;
  opacity: 0.85;
}
.qr-tf-cell-empty {
  color: var(--qr-muted);
  opacity: 0.45;
  font-weight: 700;
}

/* Tombol Tampilkan Solusi -> Solusi : ala GO Expert */
.qr-sol-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qr-sol-trigger-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.qr-sol-toggle-btn {
  flex: 1;
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}
.qr-sol-toggle-btn:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10B981;
}
.qr-sol-toggle-btn.is-open {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
}
[data-theme="dark"] .qr-sol-toggle-btn:not(.is-open),
.dark .qr-sol-toggle-btn:not(.is-open) {
  color: #6EE7B7;
  background: rgba(16, 185, 129, 0.14);
}
.qr-sol-panel {
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--qr-bg);
  border: 1.5px solid rgba(16, 185, 129, 0.34);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.qr-sol-heading {
  font-size: 13.5px;
  font-weight: 900;
  color: #059669;
}
[data-theme="dark"] .qr-sol-heading, .dark .qr-sol-heading { color: #6EE7B7; }
.qr-sol-formula {
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.28);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--qr-text);
}
.qr-sol-text,
.qr-sol-steps {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.65;
  color: var(--qr-text);
  margin: 0;
}
.qr-sol-steps { padding-left: 20px; }
.qr-sol-matrix-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qr-sol-matrix-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--qr-text);
}
.qr-sol-matrix-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.qr-sol-matrix-tag.is-true { background: rgba(16, 185, 129, 0.16); color: #047857; }
.qr-sol-matrix-tag.is-false { background: rgba(244, 63, 94, 0.16); color: #BE123C; }
[data-theme="dark"] .qr-sol-matrix-tag.is-true, .dark .qr-sol-matrix-tag.is-true { color: #6EE7B7; }
[data-theme="dark"] .qr-sol-matrix-tag.is-false, .dark .qr-sol-matrix-tag.is-false { color: #FDA4AF; }
.qr-sol-key-box {
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.12);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--qr-text);
}

/* Strip Navigasi Nomor Hasil Benar/Salah (Review Siswa) */
.qb-rev-nav-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--qr-bg);
  border: 1px solid var(--qr-border);
}
.qb-rev-nav-pill {
  min-width: 34px;
  height: 32px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.qb-rev-nav-pill:hover { transform: translateY(-1px); }
.qb-rev-nav-pill.is-ok { background: #10B981; color: #FFFFFF; }
.qb-rev-nav-pill.is-err { background: #EF4444; color: #FFFFFF; }
.qb-rev-nav-pill.is-blank { background: var(--qr-surface); border-color: var(--qr-border); color: var(--qr-muted); }

.qb-ws-verdict {
  padding: 9px 13px;
  border-radius: 11px;
  font-size: 13px;
}
.qb-ws-verdict.is-ok { background: rgba(16, 185, 129, 0.14); color: #047857; border: 1px solid rgba(16, 185, 129, 0.35); }
.qb-ws-verdict.is-err { background: rgba(239, 68, 68, 0.12); color: #BE123C; border: 1px solid rgba(239, 68, 68, 0.32); }
[data-theme="dark"] .qb-ws-verdict.is-ok, .dark .qb-ws-verdict.is-ok { color: #6EE7B7; }
[data-theme="dark"] .qb-ws-verdict.is-err, .dark .qb-ws-verdict.is-err { color: #FDA4AF; }

/* Modul Bank Soal & Kunci Guru (Portal Guru) */
.tp-qb-dist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.tp-qb-dist-card {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--qr-bg);
  border: 1px solid var(--qr-border);
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--qr-text);
}
.tp-qb-dist-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.tp-qb-dist-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.tp-qb-dist-card.is-book .tp-qb-dist-bar span { background: #10B981; }
.tp-qb-dist-card.is-archive .tp-qb-dist-bar span { background: #3B82F6; }
.tp-qb-dist-card.is-ai .tp-qb-dist-bar span { background: #8B5CF6; }

.tp-qb-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.tp-qb-select {
  height: 38px !important;
  padding: 6px 10px !important;
  font-size: 12.5px !important;
}
@media (max-width: 820px) {
  .tp-qb-dist-grid,
  .tp-qb-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Optimasi Responsif Tablet & PWA Standalone (768px – 1024px · iPad & Tab) */
@media (display-mode: standalone) {
  body {
    overscroll-behavior-y: none;
  }
  .topbar {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  /* Kontainer utama Bank Soal, Naik Gunung, EkoTutor AI & Pengaturan tetap lega di layar Tablet */
  .view {
    max-width: 100%;
    box-sizing: border-box;
  }

  .qr-table-wrap,
  .tutor-md-table-wrap,
  .qb-media-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .qr-card,
  .qb-card,
  .set-detail-card,
  .tp-qb-dist-card {
    min-width: 0;
  }

  .tp-qb-dist-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tp-qb-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 961px) and (max-width: 1024px) {
  .set-master-detail {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
  }
}

@media (min-width: 769px) and (max-width: 834px) {
  .tp-qb-dist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qb-rev-nav-strip {
    gap: 6px;
  }

  .qr-matrix-table th,
  .qr-matrix-table td {
    padding: 9px 10px;
    font-size: 13px;
  }
}
