/* ============================================================
   GALIEN â€” Design System v2
   ============================================================ */
:root {
  --bg:#f8fafc;--surface:#ffffff;--surface-2:#f1f5f9;
  --border:#e2e8f0;--border-2:#cbd5e1;
  --accent:#0d9488;--accent-2:#0f766e;--accent-light:#ccfbf1;--accent-ghost:#f0fdfa;
  --red:#ef4444;--red-light:#fef2f2;--green:#22c55e;--green-light:#f0fdf4;
  --amber:#f59e0b;--amber-light:#fffbeb;--blue:#3b82f6;--blue-light:#eff6ff;
  --ink:#0f172a;--ink-2:#334155;--ink-3:#64748b;--ink-4:#94a3b8;
  --radius-sm:6px;--radius:12px;--radius-lg:20px;--radius-xl:28px;
  --shadow-sm:0 1px 3px rgba(15,23,42,.06),0 1px 2px rgba(15,23,42,.04);
  --shadow:0 4px 16px rgba(15,23,42,.08),0 1px 4px rgba(15,23,42,.04);
  --shadow-lg:0 12px 40px rgba(15,23,42,.12),0 4px 12px rgba(15,23,42,.06);
  --shadow-xl:0 24px 64px rgba(15,23,42,.16),0 8px 24px rgba(15,23,42,.08);
  --font:'Plus Jakarta Sans',system-ui,sans-serif;--font-serif:'Lora',Georgia,serif;
  --nav-h:60px;--sidebar-w:240px;--t:.18s cubic-bezier(.4,0,.2,1);
}

:root[data-theme="dark"] {
  --bg:#0b1220;--surface:#111827;--surface-2:#1f2937;
  --border:#334155;--border-2:#475569;
  --accent:#14b8a6;--accent-2:#0d9488;--accent-light:#134e4a;--accent-ghost:#0f2f2b;
  --red:#f87171;--red-light:#3a1c21;--green:#4ade80;--green-light:#123024;
  --amber:#fbbf24;--amber-light:#3b2c11;--blue:#60a5fa;--blue-light:#1d2c45;
  --ink:#e5e7eb;--ink-2:#cbd5e1;--ink-3:#94a3b8;--ink-4:#64748b;
}

:root[data-theme="dark"] .mode-card h4{color:var(--ink)}
:root[data-theme="dark"] .mode-card p{color:var(--ink-3)}
:root[data-theme="dark"] .dash-panel-title{color:var(--ink)}
:root[data-theme="dark"] .muted{color:var(--ink-3)}

:root[data-theme="dark"] .explanation{
  background:#13263f;
  border-left-color:#60a5fa;
  color:#dbeafe;
}

:root[data-theme="dark"] .rr-explanation{
  background:#13263f;
  border-left-color:#60a5fa;
  color:#dbeafe;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:var(--font);font-size:15px;line-height:1.6;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
button{cursor:pointer;font-family:inherit;border:none}
input,textarea,select{font-family:inherit}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border-2);border-radius:99px}
::-webkit-scrollbar-thumb:hover{background:var(--ink-4)}

h1{font-size:clamp(1.75rem,4vw,2.6rem);font-weight:800;line-height:1.15;letter-spacing:-.04em}
h2{font-size:clamp(1.3rem,3vw,1.8rem);font-weight:700;letter-spacing:-.03em}
h3{font-size:1.05rem;font-weight:700;letter-spacing:-.02em}
h4{font-size:.9rem;font-weight:600}
p{color:var(--ink-2)}
.muted{color:var(--ink-3);font-size:.875rem}
.label{font-size:.72rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3)}
.container{max-width:1100px;margin:0 auto;padding:0 20px}

/* â”€â”€ Nav â”€â”€ */
.nav{display:flex;align-items:center;justify-content:space-between;height:var(--nav-h);padding:0 24px;background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:100}
.brand{font-size:1.25rem;font-weight:800;letter-spacing:-.05em;color:var(--accent);font-family:var(--font-serif)}
.nav-actions{display:flex;align-items:center;gap:10px}

/* â”€â”€ Buttons â”€â”€ */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 20px;background:var(--accent);color:#fff;border:none;border-radius:var(--radius);font-size:.9rem;font-weight:600;line-height:1;transition:var(--t);white-space:nowrap;cursor:pointer}
.btn:hover{background:var(--accent-2);transform:translateY(-1px);box-shadow:0 4px 16px rgba(13,148,136,.28)}
.btn:active{transform:none}
.btn.ghost,.btn.ghost:hover{background:transparent;color:var(--accent);border:1.5px solid var(--accent);box-shadow:none;transform:none}
.btn.ghost:hover{background:var(--accent-ghost)}
a.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 20px;background:var(--accent);color:#fff;border:none;border-radius:var(--radius);font-size:.9rem;font-weight:600;transition:var(--t)}
a.btn:hover{background:var(--accent-2);transform:translateY(-1px);box-shadow:0 4px 16px rgba(13,148,136,.28)}
a.btn.ghost{background:transparent;color:var(--accent);border:1.5px solid var(--accent)}
a.btn.ghost:hover{background:var(--accent-ghost);transform:none;box-shadow:none}
.btn-inline{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;background:var(--surface-2);color:var(--ink-2);border:1px solid var(--border);border-radius:var(--radius-sm);font-size:.82rem;font-weight:600;transition:var(--t);cursor:pointer}
.btn-inline:hover{background:var(--border);color:var(--ink)}
.btn-ghost{background:transparent;color:var(--ink-3);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px 16px;font-size:.875rem;font-weight:500;transition:var(--t);cursor:pointer}
.btn-ghost:hover{background:var(--surface-2);color:var(--ink)}
.btn-danger{background:var(--red);color:#fff;border:none;border-radius:var(--radius);padding:10px 20px;font-size:.9rem;font-weight:600;transition:var(--t);cursor:pointer}
.btn-danger:hover{background:#dc2626}
.btn-sm{padding:6px 14px;font-size:.8rem}

/* â”€â”€ Forms â”€â”€ */
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field span,.field > label{font-size:.82rem;font-weight:600;color:var(--ink-2);letter-spacing:.01em}
.field input,.field select,.field textarea,
input[type="text"],input[type="email"],input[type="password"],input[type="number"],select,textarea{width:100%;padding:10px 14px;background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:.9rem;color:var(--ink);transition:border-color var(--t),box-shadow var(--t);appearance:none}
.field input:focus,.field select:focus,.field textarea:focus,
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(13,148,136,.12)}
.field textarea,textarea{resize:vertical;min-height:80px}
select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:36px}
.field select.multi-select{
  min-height: 96px;
  max-height: 124px;
  overflow-y: auto;
  background-image: none;
  padding-right: 12px;
}
.field select.multi-select option{
  padding: 4px 6px;
}
.form-msg{font-size:.875rem;color:var(--red);margin-top:8px;min-height:18px}

/* â”€â”€ Card â”€â”€ */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:24px;box-shadow:var(--shadow-sm)}
.card.soft{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:24px}
.card-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid var(--border)}

/* â”€â”€ Pills â”€â”€ */
.pill{display:inline-flex;align-items:center;padding:4px 12px;background:var(--accent-light);color:var(--accent-2);border-radius:99px;font-size:.75rem;font-weight:700;letter-spacing:.04em}
.badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;background:var(--red);color:#fff;border-radius:99px;font-size:.7rem;font-weight:700}
.badge.hidden{display:none}
.tag{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;background:var(--surface-2);color:var(--ink-2);border:1px solid var(--border);border-radius:99px;font-size:.75rem;font-weight:500}

/* â”€â”€ Alert â”€â”€ */
.alert{padding:12px 16px;border-radius:var(--radius);font-size:.875rem;display:flex;align-items:center;gap:10px}
.alert.success{background:var(--green-light);color:#166534;border:1px solid #bbf7d0}
.alert.error{background:var(--red-light);color:#991b1b;border:1px solid #fca5a5}
.alert.info{background:var(--blue-light);color:#1e40af;border:1px solid #93c5fd}

/* â”€â”€ Modal â”€â”€ */
.modal{position:fixed;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:9000;display:flex;align-items:center;justify-content:center;padding:16px;animation:fadeIn .15s ease}
.modal.hidden{display:none}
.modal-content{background:var(--surface);border-radius:var(--radius-lg);padding:24px;width:100%;max-width:460px;box-shadow:var(--shadow-xl);animation:slideUp .2s cubic-bezier(.34,1.56,.64,1);max-height:90vh;overflow-y:auto}
.modal-content h3{margin-bottom:6px}
.modal-content .muted{margin-bottom:14px}
.modal-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
/* Feedback modal */
.feedback-type-row{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.feedback-type-btn{padding:6px 14px;border-radius:var(--radius-sm);border:1.5px solid var(--border);background:var(--surface);color:var(--ink-2);font-size:.82rem;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:6px;transition:all .15s}
.feedback-type-btn:hover{border-color:var(--accent);color:var(--accent)}
.feedback-type-btn.active{background:var(--accent);border-color:var(--accent);color:#fff}
.feedback-textarea{width:100%;padding:10px 12px;border:1.5px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);font-family:var(--font);font-size:.9rem;resize:vertical;min-height:110px;box-sizing:border-box;transition:border-color .15s}
.feedback-textarea:focus{outline:none;border-color:var(--accent)}
.feedback-error{color:var(--red);font-size:.82rem;margin-top:8px}
/* Feedback admin list */
.feedback-item{cursor:default;transition:background .15s;margin-bottom:10px}
.feedback-item--unread{border-left:3px solid var(--accent);cursor:pointer}
.feedback-item--unread:hover{background:var(--accent-ghost)}
.feedback-item-header{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.feedback-item-user{font-size:.8rem;font-weight:600;color:var(--ink-2)}
.feedback-item-date{font-size:.75rem;color:var(--ink-3);margin-left:auto}
.feedback-item-message{font-size:.875rem;color:var(--ink);white-space:pre-wrap;line-height:1.6}
.feedback-unread-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);flex-shrink:0}
.feedback-tag{display:inline-flex;align-items:center;padding:2px 10px;border-radius:20px;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.feedback-tag-bug{background:#fef2f2;color:var(--red)}
.feedback-tag-suggestion{background:var(--accent-light);color:var(--accent)}
.feedback-tag-autre{background:var(--surface-2);color:var(--ink-2)}
[data-theme="dark"] .feedback-tag-bug{background:rgba(239,68,68,.15)}
[data-theme="dark"] .feedback-tag-suggestion{background:rgba(13,148,136,.2)}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes slideUp{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:none}}

/* â”€â”€ Toggle â”€â”€ */
.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--border)}
.toggle-row.disabled-row{opacity:.35;pointer-events:none}
.toggle-label{font-size:.875rem;color:var(--ink-2);font-weight:500;flex:1}
.toggle-label small{display:block;font-size:.75rem;color:var(--ink-3);font-weight:400;margin-top:1px}
.toggle-switch{position:relative;width:40px;height:22px;flex-shrink:0}
.toggle-switch input{opacity:0;width:0;height:0;position:absolute}
.toggle-slider{position:absolute;inset:0;background:var(--border-2);border-radius:99px;cursor:pointer;transition:var(--t)}
.toggle-slider::before{content:'';position:absolute;width:16px;height:16px;left:3px;top:3px;background:#fff;border-radius:50%;transition:var(--t);box-shadow:0 1px 3px rgba(0,0,0,.2)}
.toggle-switch input:checked + .toggle-slider{background:var(--accent)}
.toggle-switch input:checked + .toggle-slider::before{transform:translateX(18px)}

/* â”€â”€ Spinner â”€â”€ */
.spinner{width:30px;height:30px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;margin:0 auto}
@keyframes spin{to{transform:rotate(360deg)}}
.loading-wrap{display:flex;align-items:center;justify-content:center;padding:48px 0}
.hidden{display:none!important}
.link{color:var(--accent);font-weight:600;font-size:.9rem}

.theme-toggle{
  position:fixed;
  left:14px;
  bottom:14px;
  width:40px;
  height:40px;
  border-radius:999px;
  background:var(--surface);
  color:var(--ink);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  z-index:2200;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}

.theme-toggle:hover{
  background:var(--surface-2);
}
.profile-page .theme-toggle{left:auto;right:18px;bottom:18px}
.link:hover{text-decoration:underline}
.help-text{font-size:.78rem;color:var(--ink-3);padding:8px 12px;background:var(--surface-2);border-radius:var(--radius-sm);border-left:3px solid var(--accent);line-height:1.5;margin-top:4px}
.duplicate-alert{padding:10px 12px;background:var(--amber-light);border:1px solid var(--amber);border-radius:var(--radius);font-size:.8rem;color:#92400e;margin-top:8px}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   HOME
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.container.home{padding-top:0}
.home .nav{position:fixed;top:0;left:0;right:0}
.hero{display:grid;grid-template-columns:1fr 1fr;gap:48px;align-items:center;min-height:calc(100vh - var(--nav-h));padding:calc(var(--nav-h) + 48px) 24px 60px;max-width:1100px;margin:0 auto}
.hero-text{display:flex;flex-direction:column;gap:18px}
.hero-text .pill{align-self:flex-start;margin-bottom:4px}
.hero-text p{font-size:1rem;max-width:44ch;line-height:1.75}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:8px}
.hero-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);padding:28px;box-shadow:var(--shadow-lg)}
.hero-card-title{font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--accent);margin-bottom:14px}
.feature-list{list-style:none;display:flex;flex-direction:column;gap:12px}
.feature-list li{display:flex;align-items:flex-start;gap:12px;color:var(--ink-2);font-size:.92rem;line-height:1.5}
.feature-list li::before{content:'';flex-shrink:0;width:20px;height:20px;margin-top:2px;background:var(--accent-light);border-radius:50%;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center}
.feature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding:48px 24px 72px;max-width:1100px;margin:0 auto}
.feature-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;transition:box-shadow var(--t)}
.feature-card:hover{box-shadow:var(--shadow)}
.feature-card h3{margin-bottom:8px}
.feature-card p{font-size:.88rem}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   AUTH
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.container.auth{min-height:100vh;display:grid;grid-template-columns:1fr 1fr;max-width:none;padding:0}
.auth-hero{background:linear-gradient(145deg,#0f172a 0%,#134e4a 100%);padding:60px 48px;display:flex;flex-direction:column;justify-content:center;gap:20px;position:relative;overflow:hidden}
.auth-hero::before{content:'';position:absolute;top:-100px;right:-100px;width:400px;height:400px;background:radial-gradient(circle,rgba(13,148,136,.3) 0%,transparent 70%);pointer-events:none}
.auth-hero .pill{align-self:flex-start;background:rgba(204,251,241,.15);color:#ccfbf1}
.auth-hero h1{color:#fff}
.auth-hero p{color:rgba(255,255,255,.7);font-size:.95rem;max-width:36ch}
.auth-card{display:flex;flex-direction:column;justify-content:center;padding:60px 48px;max-width:460px;margin:auto;width:100%}
.auth-card h2{margin-bottom:4px}
.auth-card .muted{margin-bottom:24px}
.auth-card .btn{width:100%;margin-top:8px}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   DASHBOARD
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.dashboard-wrap{min-height:100vh;display:flex;flex-direction:column}
.dash-topbar{height:var(--nav-h);display:flex;align-items:center;justify-content:space-between;padding:0 24px;background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:50}
.dash-brand{font-size:1.2rem;font-weight:800;letter-spacing:-.05em;color:var(--accent);font-family:var(--font-serif)}
.topbar-right{display:flex;align-items:center;gap:6px}
.topbar-stat-pill{position:relative;display:flex;align-items:center;gap:4px;padding:4px 10px;border-radius:20px;background:var(--surface-2);border:1px solid var(--border);font-size:.78rem;font-weight:700;color:var(--ink-2);white-space:nowrap;user-select:none;cursor:default}
.topbar-stat-pill-icon{font-size:.85rem;line-height:1}
.topbar-stat-pill::after{content:attr(data-tip);position:absolute;top:calc(100% + 8px);left:50%;transform:translateX(-50%);background:var(--ink);color:var(--surface);font-size:.75rem;font-weight:500;padding:5px 10px;border-radius:var(--radius-sm);white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .15s;z-index:100}
.topbar-stat-pill::before{content:'';position:absolute;top:calc(100% + 3px);left:50%;transform:translateX(-50%);border:5px solid transparent;border-bottom-color:var(--ink);pointer-events:none;opacity:0;transition:opacity .15s;z-index:100}
.topbar-stat-pill:hover::after,.topbar-stat-pill:hover::before{opacity:1}
.topbar-badge{position:absolute;top:-3px;right:-3px;background:var(--red);color:#fff;font-size:.6rem;font-weight:700;min-width:15px;height:15px;border-radius:8px;display:flex;align-items:center;justify-content:center;padding:0 3px;line-height:1;pointer-events:none}
.topbar-username{font-size:.82rem;font-weight:600;color:var(--ink-2);white-space:nowrap;max-width:120px;overflow:hidden;text-overflow:ellipsis}
@media(max-width:540px){.topbar-username{display:none}}
.topbar-avatar-wrap{position:relative;display:flex;align-items:center;gap:8px}
.topbar-avatar{width:36px;height:36px;border-radius:50%;background:var(--accent);color:#fff;font-size:.8rem;font-weight:700;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:opacity .15s;padding:0}
.topbar-avatar:hover{opacity:.85}
.topbar-avatar-img{width:100%;height:100%;object-fit:cover}
.topbar-dropdown{position:absolute;top:calc(100% + 8px);right:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 8px 24px rgba(0,0,0,.13);min-width:200px;z-index:200;overflow:hidden}
.topbar-dropdown-name{padding:12px 16px;font-size:.8rem;font-weight:600;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-dropdown-divider{height:1px;background:var(--border)}
.topbar-dropdown-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 16px;font-size:.875rem;color:var(--ink);background:none;border:none;cursor:pointer;text-decoration:none;transition:background .1s;text-align:left}
.topbar-dropdown-item:hover{background:var(--surface-2)}
.topbar-dropdown-item--danger{color:var(--red)}
.topbar-dropdown-item--danger:hover{background:#fef2f2}
[data-theme="dark"] .topbar-dropdown-item--danger:hover{background:rgba(239,68,68,.1)}
.dashboard-main{flex:1;display:flex;align-items:flex-start;justify-content:center;padding:28px 16px 60px}
.dashboard-card{width:100%;max-width:580px}
.dashboard-card > h2{margin-bottom:4px}
.dashboard-card > .muted{margin-bottom:22px}

.mode-cards{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:22px}
.mode-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:16px;background:var(--surface);border:2px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;transition:var(--t);text-align:left}
.mode-card:hover{border-color:var(--accent);background:var(--accent-ghost)}
.mode-card.selected{border-color:var(--accent);background:var(--accent-ghost);box-shadow:0 0 0 3px rgba(13,148,136,.12)}
.mode-card-icon{width:36px;height:36px;border-radius:9px;background:var(--accent-light);display:flex;align-items:center;justify-content:center;font-size:1.1rem;color:var(--accent)}
.mode-card h4{font-size:.88rem}
.mode-card p{font-size:.76rem;color:var(--ink-3);line-height:1.4}

.dash-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px;margin-bottom:14px}
.dash-panel-title{font-size:.72rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3);margin-bottom:12px;display:flex;align-items:center;gap:8px}
.filters-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.filters-row.three{grid-template-columns:1fr 1fr 1fr}
.filters-row--top{align-items:end}
.filters-row--single{grid-template-columns:1fr}
.filters-row--triple{grid-template-columns:1fr 1fr 1fr}
.field--slider{margin-bottom:0}
.panel-divider{height:1px;background:var(--border);margin:12px 0}

/* Dashboard options panels (training/exam) */
#trainingPanel.dash-panel,
#examPanel.dash-panel{
  padding:0;
  border-radius:22px;
  overflow:hidden;
}
#trainingPanel .dash-panel-title,
#examPanel .dash-panel-title{
  margin:0;
  padding:16px 22px;
  background:var(--surface-2);
  border-bottom:1px solid var(--border);
  font-size:1.05rem;
  text-transform:none;
  letter-spacing:.01em;
  color:var(--ink-2);
}
#trainingPanel .dash-panel-title i,
#examPanel .dash-panel-title i{
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:var(--accent-light);
  color:var(--accent-2);
}
.options-panel-body{
  padding:16px 22px 18px;
}
.options-panel-body .field{
  margin-bottom:0;
}
.options-panel-body .field > span{
  font-size:.95rem;
  color:var(--ink-2);
  font-weight:700;
}
.options-panel-body .field input,
.options-panel-body .field select{
  height:54px;
  border-radius:14px;
}
.options-panel-body .qcount-slider-wrap{
  gap:10px;
}
.options-panel-body .slider-count strong{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:var(--accent-light);
  color:var(--accent-2);
  border-radius:11px;
  padding:4px 12px;
}
.options-panel-body .slider-count strong span{
  opacity:.8;
}
.options-panel-body .qcount-slider-wrap input[type="range"]{
  height:4px;
}
.options-panel-body .toggle-row{
  padding:10px 0;
}
.options-panel-body .toggle-label{
  font-size:1rem;
  color:var(--ink);
  font-weight:700;
}
.options-panel-body .toggle-label small{
  font-size:.92rem;
  color:var(--ink-3);
  font-weight:500;
}
.options-panel-body .help-text{
  margin-top:12px;
  border-radius:12px;
  padding:12px 14px;
}

/* ══════════════════════════════════════════════════
   WIZARD FILTER BUILDER
══════════════════════════════════════════════════ */

/* Panel shell */
.wb-panel { padding:16px 18px; }
.wb-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.filter-mode-switch{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface-2);
}
.mode-pill{
  border:none;
  background:transparent;
  color:var(--ink-3);
  padding:6px 12px;
  border-radius:999px;
  font-size:.74rem;
  font-weight:700;
  cursor:pointer;
  transition:var(--t);
  font-family:inherit;
}
.mode-pill.active{
  background:var(--accent);
  color:#fff;
  box-shadow:0 8px 20px rgba(13,148,136,.22);
}
.mode-pill:not(.active):hover{color:var(--ink)}
.filter-reset-btn {
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 10px; border:1px solid var(--border); border-radius:99px;
  background:transparent; color:var(--ink-3); font-size:.72rem;
  font-weight:600; font-family:inherit; cursor:pointer; transition:var(--t);
}
.filter-reset-btn:hover { background:var(--red-light); border-color:var(--red); color:var(--red); }

/* Confirmed blocks */
.wb-block {
  display:flex; align-items:flex-start; gap:10px;
  padding:10px 12px; border:1px solid var(--border);
  border-radius:var(--radius); margin-bottom:8px;
  background:var(--surface-2); animation:wbBlockIn .22s ease;
}
@keyframes wbBlockIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.wb-block-num {
  width:22px; height:22px; border-radius:50%; display:flex; align-items:center;
  justify-content:center; color:#fff; font-size:.68rem; font-weight:800; flex-shrink:0; margin-top:2px;
}
.wb-block-info { flex:1; min-width:0; }
.wb-block-actions{display:flex;align-items:center;gap:4px}
.wb-block-title { display:flex; align-items:center; gap:8px; margin-bottom:6px; flex-wrap:wrap; }
.wb-block-cls { font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.wb-block-mod { font-size:.82rem; font-weight:600; color:var(--ink-2); }
.wb-block-chips { display:flex; flex-wrap:wrap; gap:5px; }
.wb-chip {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 9px; border-radius:99px; font-size:.7rem; font-weight:600;
  border:1px solid transparent;
}
.wb-chip--course { background:var(--accent-light); color:var(--accent-2); border-color:color-mix(in srgb,var(--accent) 30%,transparent); }
.wb-chip--source { background:var(--blue-light); color:#1d4ed8; border-color:color-mix(in srgb,#3b82f6 30%,transparent); }
.wb-chip--fav    { background:#fff1f2; color:#be123c; border-color:#fecdd3; }
.wb-chip--muted  { background:var(--surface-2); color:var(--ink-4); border-color:var(--border); font-style:italic; }
:root[data-theme="dark"] .wb-chip--source { background:#1d2c45; color:#93c5fd; border-color:#1e3a5f; }
:root[data-theme="dark"] .wb-chip--fav    { background:#3a0d18; color:#fb7185; border-color:#4c1627; }
.wb-del-btn {
  background:none; border:none; color:var(--ink-4); padding:4px 6px;
  border-radius:var(--radius-sm); cursor:pointer; transition:var(--t); flex-shrink:0;
  font-size:.85rem;
}
.wb-edit-btn{
  background:none; border:none; color:var(--ink-4); padding:4px 6px;
  border-radius:var(--radius-sm); cursor:pointer; transition:var(--t); flex-shrink:0;
  font-size:.85rem;
}
.wb-edit-btn:hover{color:var(--accent);background:var(--accent-ghost)}
.wb-del-btn:hover { color:var(--red); background:var(--red-light); }

/* Add-another button */
.wb-add-btn {
  display:inline-flex; align-items:center; gap:7px;
  padding:7px 14px; border:1.5px dashed var(--border-2);
  border-radius:var(--radius); background:transparent;
  color:var(--ink-3); font-size:.8rem; font-weight:600;
  font-family:inherit; cursor:pointer; transition:var(--t);
}
.wb-add-btn:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-ghost); }

/* Question counter */
.filters-count-wrap {
  background:var(--surface-2); border-radius:var(--radius); padding:10px 14px;
  display:flex; align-items:center; justify-content:center;
}
.question-counter { display:flex; align-items:baseline; gap:6px; }
.question-counter-num { font-size:1.5rem; font-weight:800; color:var(--accent); letter-spacing:-.04em; }
.question-counter-label { font-size:.78rem; color:var(--ink-3); font-weight:500; }

/* ── Question count inline section (inside filter panel, advanced mode) ── */
.wb-qcount-section { padding: 4px 0 8px; }
.wb-qcount-hd { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

#questionCountPanel .wb-qcount-section {
  padding: 0;
}
#questionCountPanel .wb-qcount-hd {
  font-size: .78rem;
  color: var(--ink-3);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
#questionCountPanel .qcount-slider-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 12px;
  gap: 12px;
}
#questionCountPanel .slider-header > span {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-2);
}
#questionCountPanel .slider-count strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.04em;
}
#questionCountPanel .slider-count strong span {
  font-size: .58rem;
  color: var(--ink-3);
}
#questionCountPanel .slider-ends {
  color: var(--ink-4);
  font-size: .7rem;
  margin-top: -6px;
}

/* ── Wizard step 5 — per-block question count ── */
.wb-qcount-step { margin: 8px 0; }
.wb-qcount-context {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--ink-3); font-weight: 500;
  background: var(--accent-ghost); border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom: 14px;
}
.wb-qcount-context strong { color: var(--accent); font-size: .95rem; font-weight: 800; }
.wb-qcount-context i { color: var(--accent); font-size: .85rem; }
.wb-qcount-incard { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }

/* ── Block card count row ── */
.wb-block-qcount {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; font-size: .75rem; font-weight: 600;
}
.wb-block-qcount-sel { color: var(--accent); display: flex; align-items: center; gap: 4px; }
.wb-block-qcount-sep { color: var(--ink-4); font-size: .7rem; }
.wb-block-qcount-avail { color: var(--ink-3); font-weight: 500; }

/* ── Wizard wrapper ── */
.wb-wizard-wrap {
  border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:14px 16px; margin-bottom:10px;
  background:var(--surface); animation:wbBlockIn .2s ease;
}
.wb-meta { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.wb-meta-right{display:flex;align-items:center;gap:8px}
.wb-bloc-label { font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.07em; color:var(--ink-4); }
.wb-dots { display:flex; gap:5px; align-items:center; }
.wb-cancel{
  border:1px solid var(--border);
  background:transparent;
  color:var(--ink-3);
  padding:4px 8px;
  border-radius:8px;
  font-size:.7rem;
  font-weight:700;
  cursor:pointer;
  transition:var(--t);
}
.wb-cancel:hover{background:var(--surface-2);color:var(--ink)}
.wb-dot {
  width:7px; height:7px; border-radius:50%; background:var(--border-2); transition:var(--t);
}
.wb-dot.active { background:var(--accent); transform:scale(1.3); }
.wb-dot.done   { background:var(--accent); opacity:.45; }

/* Step header */
.wb-step-hd { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.wb-snum {
  width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  border:2px solid var(--border-2); font-size:.72rem; font-weight:800; color:var(--ink-3);
  flex-shrink:0; transition:var(--t);
}
.wb-snum.done { background:var(--accent); border-color:var(--accent); color:#fff; }
.wb-slbl { font-size:.8rem; font-weight:700; color:var(--ink-2); text-transform:uppercase; letter-spacing:.05em; flex:1; }
.wb-sval { font-size:.72rem; color:var(--ink-4); margin-left:auto; }

/* Breadcrumb row (completed steps summary) */
.wb-crumb {
  display:flex; align-items:center; gap:8px; margin-bottom:10px;
  padding:7px 10px; border-radius:var(--radius-sm);
  background:color-mix(in srgb, var(--cc,var(--accent)) 7%, transparent);
  border:1px solid color-mix(in srgb, var(--cc,var(--accent)) 18%, transparent);
  flex-wrap:wrap;
}
.wb-crumb-val { font-size:.75rem; color:var(--ink-3); margin-left:auto; }

/* Class cards */
.wb-class-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:12px; }
.wb-class-card {
  padding:12px 11px; border:2px solid var(--border); border-radius:var(--radius);
  background:var(--surface); cursor:pointer; transition:var(--t);
  display:flex; flex-direction:column; gap:5px; text-align:left;
  font-family:inherit; position:relative; overflow:hidden;
}
.wb-class-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background:var(--cc,var(--accent)); opacity:0; transition:var(--t);
}
.wb-class-card:hover::before, .wb-class-card.selected::before { opacity:1; }
.wb-class-card:hover { border-color:var(--cc,var(--accent)); transform:translateY(-2px); box-shadow:var(--shadow-sm); }
.wb-class-card.selected {
  border-color:var(--cc,var(--accent));
  background:var(--cg,var(--accent-ghost));
  box-shadow:0 0 0 3px color-mix(in srgb, var(--cc,var(--accent)) 14%, transparent);
}
.wb-cc-top { display:flex; align-items:center; gap:6px; }
.wb-cc-icon { font-size:1.2rem; }
.wb-cc-name { font-size:.82rem; font-weight:800; color:var(--ink); }
.wb-cc-desc { font-size:.66rem; color:var(--ink-4); line-height:1.45; }
.wb-cc-count { font-size:.68rem; font-weight:700; }

/* Module cards */
.wb-mod-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; margin-bottom:12px; }
.wb-mod-card {
  padding:9px 11px; border:1.5px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface); cursor:pointer; transition:var(--t);
  text-align:left; font-family:inherit;
}
.wb-mod-card:hover { border-color:var(--accent); background:var(--accent-ghost); transform:translateY(-1px); }
.wb-mod-card.selected { border-color:var(--accent); background:var(--accent-ghost); box-shadow:0 0 0 3px rgba(13,148,136,.12); }
.wb-mod-head{display:flex;align-items:center;gap:8px}
.wb-mod-icon{font-size:.95rem;color:var(--accent);opacity:.9}
.wb-mod-name { font-size:.8rem; font-weight:700; color:var(--ink); }
.wb-mod-count { font-size:.67rem; color:var(--ink-4); margin-top:2px; }
/* ═══ FILTRE NON GUIDE (Libre) — custom dropdowns ═══ */
.lib-grid{display:grid;grid-template-columns:1fr 1fr}
.lib-grid-top{border-bottom:1px solid var(--border)}
.lib-item{padding:12px 14px;border-right:1px solid var(--border);position:relative;overflow:visible}
.lib-item:nth-child(even){border-right:none}
.lib-item-hd{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.lib-item-lbl{display:flex;align-items:center;gap:7px;font-size:.76rem;font-weight:700;color:var(--ink-2)}
.lib-icon{width:24px;height:24px;border-radius:6px;background:var(--surface-2);display:flex;align-items:center;justify-content:center;font-size:.8rem;color:var(--ink-3);border:1px solid var(--border)}
.lib-badge{font-size:.64rem;font-weight:700;padding:2px 8px;border-radius:99px;background:var(--surface-2);color:var(--ink-4);border:1px solid var(--border);white-space:nowrap;transition:var(--t)}
.lib-badge.active{background:var(--accent-light);color:var(--accent-2);border-color:var(--accent)}
.lib-select-wrap{position:relative}
.lib-trig{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:.8rem;color:var(--ink-2);cursor:pointer;transition:var(--t);font-family:inherit;text-align:left}
.lib-trig:hover{border-color:var(--border-2);background:var(--surface)}
.lib-trig.open{border-color:var(--accent);box-shadow:0 0 0 3px rgba(13,148,136,.1);background:var(--surface)}
.lib-trig-txt{flex:1;min-width:0;white-space:nowrap;overflow:hidden;display:flex;align-items:center}
.lib-trig-txt.ph{color:var(--ink-4);font-style:italic}
.lib-chev{font-size:.7rem;color:var(--ink-4);flex-shrink:0;transition:transform var(--t)}
.lib-trig.open .lib-chev{transform:rotate(180deg)}
.lib-tags{display:flex;align-items:center;gap:4px}
.lib-tag{padding:1px 7px;background:var(--accent-light);color:var(--accent-2);border-radius:99px;font-size:.68rem;font-weight:700}
.lib-tag-more{font-size:.68rem;color:var(--ink-4);font-weight:600}
.lib-drop{position:absolute;top:calc(100% + 5px);left:0;right:0;z-index:300;background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);min-width:200px}
.lib-drop.hidden{display:none}
.lib-search-wrap{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid var(--border);font-size:.8rem;color:var(--ink-4)}
.lib-search{flex:1;border:none;outline:none;background:transparent;font-size:.82rem;color:var(--ink);font-family:inherit}
.lib-sel-all{display:flex;align-items:center;gap:8px;padding:7px 10px;border-bottom:1px solid var(--border);cursor:pointer;font-size:.77rem;font-weight:600;color:var(--ink-3);transition:background var(--t)}
.lib-sel-all:hover{background:var(--surface-2)}
.lib-allbox{width:15px;height:15px;border-radius:4px;border:2px solid var(--border-2);background:var(--surface);flex-shrink:0;position:relative;transition:var(--t)}
.lib-allbox.all{background:var(--accent);border-color:var(--accent)}
.lib-allbox.all::after{content:'';position:absolute;left:2px;top:-1px;width:7px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg)}
.lib-allbox.partial{background:var(--accent-ghost);border-color:var(--accent)}
.lib-allbox.partial::before{content:'';position:absolute;left:2px;top:5px;width:7px;height:2px;background:var(--accent);border-radius:1px}
.lib-opts{max-height:200px;overflow-y:auto;padding:4px 0}
.lib-opt{display:flex;align-items:center;gap:9px;padding:7px 10px;font-size:.82rem;color:var(--ink-2);cursor:pointer;transition:background var(--t)}
.lib-opt:hover{background:var(--surface-2)}
.lib-opt.lib-hidden{display:none}
.lib-opt.selected .lib-cb{background:var(--accent);border-color:var(--accent);box-shadow:0 0 0 2px rgba(13,148,136,.15)}
.lib-opt.selected .lib-cb::after{opacity:1}
.lib-cb{width:15px;height:15px;border-radius:4px;border:2px solid var(--border-2);background:var(--surface);flex-shrink:0;position:relative;transition:var(--t)}
.lib-cb::after{content:'';position:absolute;left:2px;top:-1px;width:7px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg);opacity:0;transition:var(--t)}
.lib-empty{padding:12px 10px;font-size:.78rem;color:var(--ink-4);text-align:center}
/* fav rose variant */
.lib-item--fav{background:linear-gradient(160deg,#fff5f7 0%,var(--surface) 100%)}
[data-theme="dark"] .lib-item--fav{background:linear-gradient(160deg,rgba(244,63,94,.06) 0%,var(--surface) 100%)}
.lib-icon--fav{background:#fff1f2;color:#f43f5e;border-color:#fecdd3}
[data-theme="dark"] .lib-icon--fav{background:#3b0e18;color:#fb7185;border-color:#9f1239}
.lib-badge--fav.active{background:#fff1f2;color:#e11d48;border-color:#f43f5e}
[data-theme="dark"] .lib-badge--fav.active{background:#3b0e18;color:#fb7185;border-color:#f43f5e}
.lib-trig--fav:hover{border-color:#fecdd3;background:#fff5f7}
.lib-trig--fav.open{border-color:#f43f5e;box-shadow:0 0 0 3px rgba(244,63,94,.1)}
.lib-trig--fav .lib-tag{background:#fff1f2;color:#e11d48}
#lib_opts_favtag .lib-opt.selected .lib-cb{background:#f43f5e;border-color:#f43f5e}
#lib_all_favtag .lib-allbox.all{background:#f43f5e;border-color:#f43f5e}
#lib_all_favtag .lib-allbox.partial{background:#fff1f2;border-color:#f43f5e}
#lib_all_favtag .lib-allbox.partial::before{background:#f43f5e}
.lib-allbox--fav{border-color:#fecdd3}
@media(max-width:520px){
  .lib-grid{grid-template-columns:1fr}
  .lib-item{border-right:none;border-bottom:1px solid var(--border)}
  .lib-item:last-child{border-bottom:none}
}

/* Course chips */
.wb-chips-wrap { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.wb-course-chip {
  display:inline-flex; align-items:center; padding:5px 11px;
  border:1.5px solid var(--border); border-radius:99px;
  background:var(--surface); font-size:.76rem; font-weight:500;
  color:var(--ink-3); cursor:pointer; transition:var(--t); font-family:inherit;
}
.wb-course-chip:hover { border-color:var(--accent); color:var(--accent); }
.wb-course-chip.selected {
  border-color:var(--accent); background:var(--accent-ghost);
  color:var(--accent-2); font-weight:700;
}

/* Source pills */
.wb-src-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-bottom:12px; }
.wb-src-pill {
  display:flex; align-items:center; gap:8px; padding:8px 12px;
  border:1.5px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface); font-size:.78rem; color:var(--ink-3);
  cursor:pointer; transition:var(--t);
}
.wb-src-dot { width:7px; height:7px; border-radius:50%; background:var(--ink-4); flex-shrink:0; transition:var(--t); }
.wb-src-pill:hover { border-color:#93c5fd; background:#eff6ff; color:#1d4ed8; }
.wb-src-pill:hover .wb-src-dot { background:#3b82f6; }
.wb-src-pill.selected { border-color:#3b82f6; background:#eff6ff; color:#1d4ed8; font-weight:700; }
.wb-src-pill.selected .wb-src-dot { background:#3b82f6; }
.wb-src-check { margin-left:auto; color:#3b82f6; font-size:.8rem; }
:root[data-theme="dark"] .wb-src-pill:hover,
:root[data-theme="dark"] .wb-src-pill.selected { background:#1d2c45; color:#93c5fd; border-color:#1e3a5f; }
:root[data-theme="dark"] .wb-src-pill:hover .wb-src-dot,
:root[data-theme="dark"] .wb-src-pill.selected .wb-src-dot { background:#60a5fa; }

/* Fav tag toggle row */
.wb-fav-toggle-row {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 12px; border-radius:var(--radius-sm);
  background:var(--surface-2); border:1px solid var(--border);
  margin-bottom:10px;
}
.wb-fav-toggle-left { display:flex; align-items:center; gap:10px; }
.wb-fav-icon {
  width:30px; height:30px; border-radius:8px;
  background:#fff1f2; color:#f43f5e;
  display:flex; align-items:center; justify-content:center; font-size:.9rem;
}
.wb-fav-lbl { font-size:.8rem; font-weight:600; color:var(--ink-2); }
.wb-fav-sub { font-size:.7rem; color:var(--ink-4); margin-top:1px; }
.wb-chips-fav .wb-fav-chip {
  display:inline-flex; align-items:center; padding:5px 12px;
  border:1.5px solid #fecdd3; border-radius:99px;
  background:#fff1f2; font-size:.76rem; font-weight:500;
  color:#be123c; cursor:pointer; transition:var(--t); font-family:inherit;
}
.wb-chips-fav .wb-fav-chip:hover { background:#ffe4e6; border-color:#f43f5e; }
.wb-chips-fav .wb-fav-chip.selected { background:#f43f5e; border-color:#f43f5e; color:#fff; font-weight:700; }
:root[data-theme="dark"] .wb-fav-icon { background:#3a0d18; color:#fb7185; }
:root[data-theme="dark"] .wb-chips-fav .wb-fav-chip { background:#3a0d18; border-color:#4c1627; color:#fb7185; }
:root[data-theme="dark"] .wb-chips-fav .wb-fav-chip.selected { background:#f43f5e; border-color:#f43f5e; color:#fff; }

/* Nav buttons */
.wb-nav { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:4px; }
.wb-back {
  display:inline-flex; align-items:center; gap:5px;
  padding:6px 12px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:transparent; color:var(--ink-3); font-size:.78rem; font-weight:600;
  font-family:inherit; cursor:pointer; transition:var(--t);
}
.wb-back:hover { background:var(--surface-2); color:var(--ink); }
.wb-next {
  display:inline-flex; align-items:center; gap:5px;
  padding:7px 16px; border:none; border-radius:var(--radius-sm);
  background:var(--accent); color:#fff; font-size:.8rem; font-weight:700;
  font-family:inherit; cursor:pointer; transition:var(--t);
}
.wb-next:disabled { opacity:.4; cursor:not-allowed; }
.wb-next:not(:disabled):hover { filter:brightness(1.08); transform:translateY(-1px); }
.wb-confirm {
  display:inline-flex; align-items:center; gap:6px;
  padding:7px 16px; border:none; border-radius:var(--radius-sm);
  background:var(--accent); color:#fff; font-size:.8rem; font-weight:700;
  font-family:inherit; cursor:pointer; transition:var(--t);
}
.wb-confirm:hover { background:var(--accent-2); transform:translateY(-1px); }

/* Misc */
.wb-empty { font-size:.76rem; color:var(--ink-4); font-style:italic; padding:4px 0; }

/* Responsive */
@media (max-width:520px) {
  .wb-class-grid { grid-template-columns:1fr; }
  .wb-mod-grid   { grid-template-columns:1fr 1fr; }
  .wb-src-grid   { grid-template-columns:1fr; }
  .wb-advanced-grid{grid-template-columns:1fr}
}

.exam-extras{display:flex;flex-direction:column}
.delay-row{display:flex;gap:8px;align-items:flex-end}
.delay-row .field{flex:1;margin-bottom:0}
.delay-input-wrap{display:flex;flex-direction:column;gap:6px}
.delay-input-wrap span{font-size:.82rem;font-weight:600;color:var(--ink-2)}
.delay-input-wrap input{width:90px}
.qcount-slider-wrap{display:flex;flex-direction:column;gap:8px}
.qcount-slider-wrap input[type="range"]{
  width:100%;
  appearance:none;
  -webkit-appearance:none;
  height:6px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--accent) 0%,var(--accent) var(--pct,0%),var(--border) var(--pct,0%),var(--border) 100%);
  outline:none;
  transition:background .2s ease;
}
.qcount-slider-wrap input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:18px;height:18px;border-radius:50%;
  background:var(--accent);
  border:2px solid #fff;
  box-shadow:0 2px 8px rgba(13,148,136,.35);
}
.qcount-slider-wrap input[type="range"]::-moz-range-thumb{
  width:18px;height:18px;border-radius:50%;
  background:var(--accent);
  border:2px solid #fff;
  box-shadow:0 2px 8px rgba(13,148,136,.35);
}
.qcount-slider-meta{display:flex;justify-content:space-between;align-items:center;font-size:.8rem}
.qcount-slider-meta strong{font-size:.9rem;color:var(--ink)}
.start-btn{width:100%;padding:13px;font-size:.95rem;font-weight:700;border-radius:var(--radius-lg)}
.start-btn:disabled{opacity:.4;cursor:not-allowed;pointer-events:none}

/* ── Effective count panel (after options, before start) ── */
.effective-count-panel { padding: 10px 16px; }
.effective-count-row { display: flex; align-items: center; gap: 14px; }
.effective-count-num {
  font-size: 2rem; font-weight: 800; color: var(--accent);
  letter-spacing: -.05em; line-height: 1; flex-shrink: 0;
}
.effective-count-labels { display: flex; flex-direction: column; gap: 2px; }
.effective-count-main { font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.effective-count-sub { font-size: .72rem; color: var(--ink-4); font-weight: 400; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   QCM
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.qcm-layout{min-height:100vh;display:flex;flex-direction:column}
.qcm-topbar{position:sticky;top:0;z-index:50;background:var(--surface);border-bottom:1px solid var(--border);padding:0 20px;height:50px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.qcm-topbar-left{display:flex;align-items:center;gap:12px;flex:1;min-width:0}
.qcm-progress-wrap{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.qcm-progress-text{font-size:.74rem;font-weight:600;color:var(--ink-3)}
.progress-bar-track{height:4px;background:var(--border);border-radius:99px;overflow:hidden}
.progress-bar-fill{height:100%;background:var(--accent);border-radius:99px;transition:width .3s ease}
.qcm-timer{display:flex;align-items:center;gap:5px;font-size:.8rem;font-weight:600;color:var(--ink-2);background:var(--surface-2);padding:4px 11px;border-radius:99px;white-space:nowrap;flex-shrink:0}
.qcm-timer.urgent{color:var(--red);background:var(--red-light);animation:pulse 1s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.7}}
.qcm-body{flex:1;display:flex;gap:18px;max-width:1140px;width:100%;margin:0 auto;padding:22px 18px}
.qcm-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:14px}
.qcm-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);padding:26px;box-shadow:var(--shadow-sm)}
.tag-row{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.course-tag{display:inline-flex;align-items:center;padding:3px 9px;background:var(--surface-2);color:var(--ink-3);border:1px solid var(--border);border-radius:99px;font-size:.71rem;font-weight:500}
.question-text{font-size:1.04rem;font-weight:500;line-height:1.7;color:var(--ink);margin-bottom:18px}
#options{display:flex;flex-direction:column;gap:8px}
.option{display:flex;align-items:flex-start;gap:12px;padding:12px 15px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--radius);cursor:pointer;transition:var(--t);position:relative;user-select:none}
.option:hover:not(.correct):not(.wrong):not(:has(input:disabled)){border-color:var(--accent);background:var(--accent-ghost)}
.option input[type="checkbox"]{appearance:none;-webkit-appearance:none;width:18px;height:18px;min-width:18px;border:2px solid var(--border-2);border-radius:5px;background:var(--surface);cursor:pointer;margin-top:2px;transition:var(--t);position:relative;flex-shrink:0}
.option input[type="checkbox"]:checked{background:var(--accent);border-color:var(--accent)}
.option input[type="checkbox"]:checked::after{content:'';position:absolute;left:3px;top:0;width:8px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg)}
.opt-letter{font-weight:700;font-size:.79rem;color:var(--ink-3);min-width:18px;padding-top:2px}
.opt-text{font-size:.92rem;color:var(--ink);line-height:1.5;flex:1}
.option.correct{background:var(--green-light);border-color:var(--green)}
.option.correct .opt-letter,.option.correct .opt-text{color:#166534}
.option.wrong{background:var(--red-light);border-color:var(--red)}
.option.wrong .opt-letter,.option.wrong .opt-text{color:#991b1b}
.option input[type="checkbox"]:disabled{cursor:not-allowed}
.explanation{margin-top:14px;padding:13px 15px;background:var(--blue-light);border-left:4px solid var(--blue);border-radius:0 var(--radius) var(--radius) 0;font-size:.87rem;color:#1e40af;line-height:1.65;display:none}
.explanation.visible{display:block}
.question-note-inline{margin-top:12px;padding:12px 15px;background:var(--amber-light);border:1px solid #fde68a;border-radius:var(--radius);font-size:.84rem;color:#92400e}
.question-note-inline.hidden{display:none}
.question-note-inline-head{display:flex;align-items:center;gap:8px;font-weight:600;margin-bottom:5px}

.q-actions{display:flex;align-items:center;gap:6px;margin-top:16px;padding-top:13px;border-top:1px solid var(--border)}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);color:var(--ink-3);font-size:1rem;transition:var(--t);cursor:pointer}
.icon-btn:hover{background:var(--border);color:var(--ink)}
.icon-btn .icon-fill{display:none}
.icon-btn.active{background:var(--accent-light);border-color:var(--accent);color:var(--accent)}
.icon-btn.active .icon-fill{display:block}
.icon-btn.active .icon-outline{display:none}
.icon-btn.warn.active{background:var(--red-light);border-color:var(--red);color:var(--red)}

.qcm-nav{display:flex;align-items:center;gap:10px;margin-top:16px}
.btn-prev{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:var(--surface-2);color:var(--ink-2);border:1.5px solid var(--border);border-radius:var(--radius);font-size:.87rem;font-weight:600;transition:var(--t);cursor:pointer;white-space:nowrap}
.btn-prev:hover:not(:disabled){background:var(--border)}
.btn-prev:disabled{opacity:.4;cursor:not-allowed}
.btn-next{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 18px;background:var(--accent);color:#fff;border:none;border-radius:var(--radius);font-size:.92rem;font-weight:700;transition:var(--t);cursor:pointer}
.btn-next:hover:not(:disabled){background:var(--accent-2)}
.btn-next:disabled{opacity:.5;cursor:not-allowed}

/* Comments */
.qcm-sidebar{width:330px;flex-shrink:0}
.comment-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);padding:16px;box-shadow:var(--shadow-sm);position:sticky;top:70px;max-height:calc(100vh - 96px);display:flex;flex-direction:column}
.comment-panel.hidden{display:none}
.comment-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid var(--border)}
.comment-header h3{font-size:.9rem}
.comment-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:9px;min-height:50px;max-height:260px}
.comment-item{padding:10px;background:var(--surface-2);border-radius:var(--radius)}
.comment-row{display:flex;gap:9px}
.comment-avatar{width:28px;height:28px;min-width:28px;border-radius:50%;background:var(--accent-light);color:var(--accent);font-size:.7rem;font-weight:700;display:flex;align-items:center;justify-content:center;overflow:hidden}
.comment-avatar img{width:100%;height:100%;object-fit:cover}
.comment-content{flex:1;min-width:0}
.comment-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:3px}
.comment-author{font-size:.77rem;font-weight:700}
.comment-date{font-size:.7rem}
.comment-body{font-size:.82rem;color:var(--ink-2);line-height:1.5;word-break:break-word}
.comment-actions{display:flex;gap:6px;margin-top:6px}
.comment-action{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;border-radius:99px;background:transparent;border:1px solid var(--border);font-size:.71rem;color:var(--ink-3);transition:var(--t);cursor:pointer}
.comment-action:hover{background:var(--surface-2)}
.comment-action.active.like{background:var(--red-light);border-color:var(--red);color:var(--red)}
.comment-action.active.dislike{background:var(--blue-light);border-color:var(--blue);color:var(--blue)}
.comment-menu{position:relative;margin-left:auto}
.comment-menu-btn{width:22px;height:22px;border-radius:4px;background:transparent;border:none;color:var(--ink-3);font-size:.8rem;display:flex;align-items:center;justify-content:center;cursor:pointer}
.comment-menu-btn:hover{background:var(--border)}
.comment-menu-list{position:absolute;right:0;top:100%;margin-top:4px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow);z-index:100;min-width:130px;overflow:hidden}
.comment-menu-list.hidden{display:none}
.comment-menu-item{display:flex;align-items:center;gap:8px;width:100%;padding:8px 14px;background:transparent;border:none;font-size:.8rem;color:var(--ink-2);text-align:left;transition:var(--t);cursor:pointer}
.comment-menu-item:hover{background:var(--surface-2)}
.comment-menu-item.delete{color:var(--red)}
.comment-menu-item.delete:hover{background:var(--red-light)}
.comment-form{margin-top:11px;padding-top:10px;border-top:1px solid var(--border);display:flex;flex-direction:column;gap:7px}
.comment-form textarea{min-height:52px;font-size:.84rem;resize:none;padding:8px 12px}
.comment-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:18px;text-align:center;color:var(--ink-3);font-size:.84rem}
.comment-empty i{font-size:1.4rem}
.comment-skeleton{display:flex;flex-direction:column;gap:5px;padding:10px}
.skeleton-line{height:11px;background:linear-gradient(90deg,var(--border) 25%,var(--surface-2) 50%,var(--border) 75%);background-size:200% 100%;border-radius:4px;animation:shimmer 1.5s infinite}
.skeleton-line:last-child{width:60%}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.note-meta-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;flex-wrap:wrap}
.note-inline-toggle{display:flex!important;align-items:center!important;flex-direction:row!important;gap:8px;font-size:.79rem;color:var(--ink-3);cursor:pointer}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESULT
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.result-wrap{min-height:100vh;display:flex;align-items:flex-start;justify-content:center;padding:28px 16px 56px}
.result-content{width:100%;max-width:620px;display:flex;flex-direction:column;gap:20px}
.result-card{width:100%;text-align:center}
.result-score-circle{width:142px;height:142px;margin:0 auto 22px;position:relative}
.result-score-circle svg{width:100%;height:100%;transform:rotate(-90deg)}
.circle-bg{fill:none;stroke:var(--border);stroke-width:10}
.circle-fill{fill:none;stroke-width:10;stroke-linecap:round;stroke-dasharray:440;transition:stroke-dashoffset 1s ease}
.result-score-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.result-score-pct{font-size:1.85rem;font-weight:800;letter-spacing:-.05em;color:var(--ink)}
.result-score-label{font-size:.71rem;color:var(--ink-3);font-weight:600}
.result-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0}
.result-meta-item{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:13px 10px;text-align:center}
.result-meta-item .val{font-size:1.05rem;font-weight:700;color:var(--ink)}
.result-meta-item .lbl{font-size:.71rem;color:var(--ink-3);margin-top:2px}
.result-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:18px}

/* Question review */
.result-review{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}
.result-review-header{padding:14px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.result-review-header h3{font-size:.92rem}
.rr-list{display:flex;flex-direction:column}
.rr-row{display:grid;grid-template-columns:36px 1fr auto auto;gap:10px;align-items:center;padding:11px 14px;border-bottom:1px solid var(--border);cursor:pointer;transition:background var(--t)}
.rr-row:last-child{border-bottom:none}
.rr-row:hover{background:var(--surface-2)}
.rr-num{font-size:.73rem;font-weight:700;color:var(--ink-3);text-align:center}
.rr-answers{display:flex;flex-direction:column;gap:3px}
.rr-answer-line{font-size:.77rem;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.rr-label{font-size:.67rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--ink-4);min-width:50px}
.rr-letters{display:flex;gap:4px;flex-wrap:wrap}
.rr-letter{display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;border-radius:5px;font-size:.7rem;font-weight:700;background:var(--surface-2);border:1px solid var(--border);color:var(--ink-2)}
.rr-letter.correct{background:var(--green-light);border-color:var(--green);color:#166534}
.rr-letter.wrong{background:var(--red-light);border-color:var(--red);color:#991b1b}
.rr-letter.missed{background:var(--amber-light);border-color:var(--amber);color:#92400e}
.rr-score{font-size:.76rem;font-weight:700;padding:3px 9px;border-radius:99px;white-space:nowrap}
.rr-score.full{background:var(--green-light);color:#166534}
.rr-score.partial{background:var(--amber-light);color:#92400e}
.rr-score.zero{background:var(--red-light);color:#991b1b}
.rr-chevron{color:var(--ink-4);font-size:.82rem;transition:transform var(--t);flex-shrink:0}
.rr-row.open .rr-chevron{transform:rotate(90deg)}
.rr-detail{display:none;padding:12px 14px;border-bottom:1px solid var(--border);background:var(--surface-2)}
.rr-detail.open{display:block}
.rr-question-text{font-size:.87rem;font-weight:500;color:var(--ink);line-height:1.65;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--border)}
.rr-options{display:flex;flex-direction:column;gap:5px;margin-bottom:10px}
.rr-option{display:flex;align-items:flex-start;gap:9px;padding:7px 11px;border-radius:var(--radius-sm);background:var(--surface);border:1px solid var(--border);font-size:.82rem;color:var(--ink-2)}
.rr-option.correct{background:var(--green-light);border-color:var(--green);color:#166534}
.rr-option.wrong{background:var(--red-light);border-color:var(--red);color:#991b1b}
.rr-option.missed{background:var(--amber-light);border-color:var(--amber);color:#92400e}
.rr-option-letter{font-weight:700;font-size:.74rem;min-width:18px}
.rr-explanation{padding:9px 13px;background:var(--blue-light);border-left:4px solid var(--blue);border-radius:0 var(--radius-sm) var(--radius-sm) 0;font-size:.82rem;color:#1e40af;line-height:1.6;margin-top:6px}
.rr-unanswered{font-size:.77rem;color:var(--ink-3);font-style:italic;padding:4px 0}
.rr-no-data{display:flex;flex-direction:column;align-items:center;padding:32px;text-align:center;color:var(--ink-3);font-size:.875rem;gap:8px}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   PROFILE
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.profile-app{display:flex;min-height:100vh;max-width:none;padding:0}
.profile-sidebar{width:var(--sidebar-w);min-height:100vh;background:var(--surface);border-right:1px solid var(--border);padding:18px 12px;display:flex;flex-direction:column;gap:3px;position:sticky;top:0;flex-shrink:0;max-height:100vh;overflow-y:auto}
.sidebar-back{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);color:var(--ink-2);margin-bottom:12px;transition:var(--t)}
.sidebar-back:hover{background:var(--border)}
.sidebar-back svg{width:16px;height:16px;fill:currentColor}
.profile-sidebar-top{display:flex;flex-direction:column;align-items:center;gap:9px;padding:12px 0 16px;margin-bottom:6px;border-bottom:1px solid var(--border)}
.sidebar-avatar{width:64px;height:64px;border-radius:50%;object-fit:cover;border:3px solid var(--border)}
.sidebar-name{font-size:.82rem;font-weight:700;text-align:center;color:var(--ink)}
.profile-tab{display:flex;align-items:center;gap:9px;padding:9px 11px;border-radius:var(--radius-sm);background:transparent;border:none;font-size:.82rem;font-weight:500;color:var(--ink-3);text-align:left;transition:var(--t);position:relative;width:100%;cursor:pointer}
.profile-tab:hover{background:var(--surface-2);color:var(--ink)}
.profile-tab.active{background:var(--accent-ghost);color:var(--accent);font-weight:600}
.profile-tab .tab-icon{font-size:.92rem;width:17px;text-align:center}
.tab-messages{justify-content:space-between}
.profile-tab-logout{margin-top:auto;color:var(--red);padding-top:9px;border-top:1px solid var(--border)}
.profile-tab-logout:hover{background:var(--red-light);color:var(--red)}
.profile-sections{flex:1;padding:28px;overflow-y:auto;min-width:0}
.profile-section{display:none}
.profile-section.active{display:flex;flex-direction:column;gap:18px}
.profile-section.hidden{display:none}
.avatar-stack{display:flex;align-items:center;gap:16px;padding:16px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);margin:12px 0}
.avatar{border-radius:50%;object-fit:cover;border:3px solid var(--border)}
.avatar.xl{width:76px;height:76px}
#profilePhoto{cursor:zoom-in}
#profilePhoto{cursor:zoom-in}
.avatar-actions.vertical{display:flex;flex-direction:column;gap:7px}
.file-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);font-size:.8rem;font-weight:600;color:var(--ink-2);cursor:pointer;transition:var(--t)}
.file-btn:hover{background:var(--border)}
.file-btn input[type="file"]{display:none}
.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:13px;background:var(--surface-2);border-radius:var(--radius);margin-bottom:12px}
.info-grid p{margin:0;font-size:.84rem}
/* ── Profile Tab ────────────────────────────────────────────────────────── */
.prof-hero{position:relative;border-radius:var(--radius);overflow:hidden;border:1.5px solid var(--border);background:var(--surface-2)}
.prof-hero-gradient{position:absolute;inset:0;height:90px;background:linear-gradient(135deg,rgba(13,148,136,.18) 0%,rgba(99,102,241,.13) 100%);pointer-events:none}
.prof-hero-body{position:relative;display:flex;align-items:center;gap:18px;padding:22px 22px 18px;flex-wrap:wrap}
.prof-avatar-wrap{position:relative;flex-shrink:0;cursor:pointer}
.prof-avatar{width:88px;height:88px;border-radius:50%;object-fit:cover;border:3px solid var(--surface);box-shadow:0 4px 16px rgba(13,148,136,.18);display:block}
.prof-avatar-overlay{position:absolute;inset:0;border-radius:50%;background:transparent !important;color:transparent !important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:none !important;cursor:pointer;transition:background .2s,color .2s;font-size:.6rem;font-weight:700;line-height:1.2;padding:0}
.prof-avatar-wrap:hover .prof-avatar-overlay{background:rgba(0,0,0,.5) !important;color:#fff !important}
.photo-modal-content{max-width:420px;text-align:center}
.photo-modal-preview-wrap{position:relative;width:150px;height:150px;border-radius:50%;overflow:hidden;margin:0 auto 16px;cursor:pointer;box-shadow:0 4px 20px rgba(0,0,0,.15)}
.photo-modal-preview{width:100%;height:100%;object-fit:cover;display:block}
.photo-modal-overlay{position:absolute;inset:0;background:rgba(0,0,0,0);color:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:.78rem;font-weight:700;transition:background .2s,color .2s;pointer-events:none}
.photo-modal-preview-wrap:hover .photo-modal-overlay{background:rgba(0,0,0,.5);color:#fff}
.photo-crop-wrap{margin:0 auto 16px}
.photo-crop-container{width:300px;height:300px;margin:0 auto;overflow:hidden;border-radius:var(--radius)}
.photo-crop-container img{display:block;max-width:100%}
.prof-hero-info{flex:1;min-width:0}
.prof-hero-name{font-size:1.25rem;font-weight:800;color:var(--ink);line-height:1.2;margin-bottom:7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.prof-hero-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:6px}
.prof-hero-email{font-size:.8rem;color:var(--ink-3)}
.prof-photo-btn{margin-left:auto;flex-shrink:0}
/* role badges */
.role-badge{display:inline-flex;align-items:center;padding:2px 10px;border-radius:99px;font-size:.7rem;font-weight:700;letter-spacing:.02em}
.role-badge.role-admin{background:rgba(239,68,68,.12);border:1px solid rgba(239,68,68,.3);color:#ef4444}
.role-badge.role-manager{background:rgba(249,115,22,.12);border:1px solid rgba(249,115,22,.3);color:#f97316}
.role-badge.role-worker{background:rgba(59,130,246,.12);border:1px solid rgba(59,130,246,.3);color:#3b82f6}
.role-badge.role-user{background:rgba(13,148,136,.1);border:1px solid rgba(13,148,136,.25);color:var(--accent)}
/* status pill */
.status-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:99px;font-size:.7rem;font-weight:700}
.status-pill.pill-active{background:rgba(22,163,74,.1);border:1px solid rgba(22,163,74,.3);color:#16a34a}
.status-pill.pill-expired{background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.3);color:#ef4444}
.status-pill.pill-inactive{background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.3);color:#ef4444}
.status-pill.pill-active::before{content:"●";font-size:.5rem;color:#16a34a}
.status-pill.pill-expired::before{content:"●";font-size:.5rem;color:#ef4444}
.status-pill.pill-inactive::before{content:"●";font-size:.5rem;color:#ef4444}
/* deactivated banner */
.deactivated-banner{display:flex;align-items:flex-start;gap:12px;padding:14px 18px;border-radius:var(--radius);background:rgba(239,68,68,.07);border:1.5px solid rgba(239,68,68,.28);color:#dc2626;margin-bottom:16px}
.deactivated-banner strong{display:block;font-weight:700;margin-bottom:3px}
.deactivated-banner span{font-size:.85rem;opacity:.85}
.deactivated-banner-icon{width:22px;height:22px;flex-shrink:0;fill:currentColor;margin-top:1px}
/* quick stats bar */
.prof-stats-bar{display:flex;align-items:center;background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--radius);overflow:hidden}
.prof-stat-item{flex:1;display:flex;flex-direction:column;align-items:center;padding:16px 8px;gap:4px}
.prof-stat-val{font-size:1.35rem;font-weight:800;color:var(--ink);line-height:1}
.prof-stat-label{font-size:.71rem;color:var(--ink-3);text-align:center}
.prof-stat-sep{width:1px;height:40px;background:var(--border);flex-shrink:0}
/* account info list */
.prof-info-list{display:flex;flex-direction:column;gap:0}
.prof-info-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}
.prof-info-row:last-child{border-bottom:none}
.prof-info-icon{font-size:1rem;flex-shrink:0;width:22px;text-align:center;color:var(--ink-3)}
.prof-info-label{font-size:.78rem;color:var(--ink-3);width:130px;flex-shrink:0}
.prof-info-value{font-size:.86rem;font-weight:600;color:var(--ink);flex:1}
.prof-expiry-warn{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:99px;font-size:.7rem;font-weight:700;background:rgba(245,158,11,.12);border:1px solid rgba(245,158,11,.3);color:#d97706;margin-left:8px}
@media(max-width:600px){
  .prof-hero-body{flex-direction:column;align-items:flex-start;gap:12px}
  .prof-photo-btn{margin-left:0}
  .prof-stats-bar{flex-direction:column;gap:0}
  .prof-stat-sep{width:80%;height:1px;background:var(--border)}
  .prof-info-label{width:90px}
}
/* ── Statistics Tab ─────────────────────────────────────────────────────── */
.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.stat-item{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:18px 14px;text-align:center;transition:var(--t)}
.stat-item:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,0,0,.07)}
.stat-item-icon{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;margin:0 auto 10px;font-size:1.15rem}
.stat-val{font-size:1.45rem;font-weight:800;color:var(--ink);line-height:1}
.stat-lbl{font-size:.68rem;color:var(--ink-3);margin-top:6px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}
/* Extra stat row (secondary, smaller cards) */
.stat-grid-extra{grid-template-columns:repeat(5,1fr);margin-top:10px}
.stat-item-sm{padding:12px 10px}
.stat-val-sm{font-size:1.1rem}
/* Radar + weekly charts */
.radar-chart-wrap{height:280px;padding:8px 0}
.weekly-chart-wrap{height:200px;padding:4px 0}
/* Donut chart row */
.stats-charts-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.chart-donut-wrap{display:flex;flex-direction:column;align-items:center;gap:10px;padding:16px}
.chart-donut-wrap canvas{display:block}
.chart-legend{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.chart-legend-item{display:flex;align-items:center;gap:6px;font-size:.75rem;color:var(--ink-2);font-weight:600}
.chart-legend-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
/* Analytics grid + pills */
.analytics-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px}
.analytics-pill{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:14px;transition:var(--t)}
.analytics-pill:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.06)}
.analytics-pill .pill-icon{font-size:1.1rem;margin-bottom:4px}
.analytics-pill .k{font-size:.68rem;color:var(--ink-3);text-transform:uppercase;letter-spacing:.05em;font-weight:700}
.analytics-pill .v{font-size:1rem;font-weight:700;color:var(--ink);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Analytics block (shared wrapper) */
.analytics-block{margin-top:12px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:14px}
.analytics-block h4{font-size:.86rem;margin:0 0 10px}
.block-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.block-header h4{font-size:.86rem;margin:0}
/* Module bar rows */
.module-bar-list{display:flex;flex-direction:column;gap:4px}
.module-bar-row{display:grid;grid-template-columns:minmax(0,180px) 1fr auto auto;align-items:center;gap:12px;padding:8px 10px;border-radius:var(--radius-sm);cursor:pointer;transition:var(--t);border:1px solid transparent}
.module-bar-row:hover{background:var(--surface);border-color:var(--border)}
.module-bar-row.active{background:var(--accent-ghost);border-color:var(--accent-light)}
.module-bar-label{font-size:.82rem;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.module-bar-track{height:8px;background:var(--border);border-radius:99px;overflow:hidden}
.module-bar-fill{height:100%;border-radius:99px;transition:width .4s ease}
.module-bar-pct{font-size:.82rem;font-weight:700;min-width:44px;text-align:right}
.module-bar-attempts{font-size:.72rem;color:var(--ink-3);min-width:52px;text-align:right}
/* Course rows */
.course-list{display:flex;flex-direction:column;gap:3px}
.course-row{display:grid;grid-template-columns:1fr 80px auto;align-items:center;gap:12px;padding:7px 10px;border-radius:var(--radius-sm);transition:var(--t)}
.course-row:hover{background:var(--surface)}
.course-row-name{font-size:.82rem;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.course-row-bar{height:6px;background:var(--border);border-radius:99px;overflow:hidden}
.course-row-bar-fill{height:100%;border-radius:99px}
.course-row-pct{font-size:.8rem;font-weight:700;min-width:44px;text-align:right}
/* Timeline */
.trend-badge{font-size:.75rem;font-weight:700;padding:3px 10px;border-radius:99px}
.timeline-chart-wrap{height:160px;margin:4px 0 12px}
.timeline-list{display:flex;flex-direction:column;gap:5px;margin-top:8px}
.timeline-day{display:flex;align-items:center;gap:10px;font-size:.78rem;color:var(--ink-2)}
.timeline-bar-track{flex:1;height:4px;background:var(--border);border-radius:99px;overflow:hidden}
.timeline-bar-fill{height:100%;border-radius:99px}
/* Failed questions cards */
.failed-list{display:flex;flex-direction:column;gap:8px}
.failed-card{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);overflow:hidden;transition:var(--t)}
.failed-card:hover{box-shadow:0 2px 12px rgba(0,0,0,.07)}
.failed-card-header{display:grid;grid-template-columns:1fr auto auto auto;align-items:center;gap:10px;padding:10px 12px;cursor:pointer}
.failed-card-main{min-width:0}
.failed-card-q{font-size:.82rem;color:var(--ink);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.failed-card-meta{font-size:.71rem;color:var(--ink-3);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.failed-card-rate{font-size:1.3rem;font-weight:800;color:var(--red);text-align:center;line-height:1}
.failed-card-rate span{font-size:.7rem;font-weight:600}
.failed-card-count{font-size:.75rem;color:var(--ink-3);text-align:center;white-space:nowrap}
.failed-card-detail{display:grid;gap:6px;padding:12px 14px;background:var(--surface-2);border-top:1px solid var(--border);font-size:.81rem}
.failed-opt{display:flex;gap:8px;align-items:flex-start}
.failed-opt strong{color:var(--ink-3);min-width:18px;flex-shrink:0}
.failed-answer{margin-top:6px;padding:6px 10px;background:var(--accent-ghost);border:1px solid var(--accent-light);border-radius:var(--radius-sm);font-size:.8rem;font-weight:600;color:var(--accent-2)}
.failed-answer span{font-weight:400;color:var(--ink-3)}
.failed-explication{margin-top:6px;font-style:italic;color:var(--ink-2);font-size:.8rem}
/* Compat: keep mini-table for other uses */
.mini-table{display:flex;flex-direction:column;gap:7px}
.mini-row{display:grid;grid-template-columns:1fr auto auto;gap:10px;padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);font-size:.8rem}
.mini-row .muted{font-size:.72rem}
.mini-row .pct{font-weight:700}
.mini-row .pct.good{color:var(--green)}
.mini-row .pct.bad{color:var(--red)}
.timeline-note{font-size:.81rem;color:var(--ink-2);line-height:1.5}
/* ── Empty state ── */
.empty-state{text-align:center;padding:52px 20px;display:flex;flex-direction:column;align-items:center;gap:10px}
.empty-icon{font-size:2.6rem;line-height:1}
/* ── Session cards (history + saved) ── */
.session-list{display:flex;flex-direction:column;gap:10px;padding-top:4px}
.session-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 18px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--radius);text-decoration:none;color:inherit;transition:border-color var(--t),box-shadow var(--t);cursor:pointer}
.session-card:hover{border-color:var(--accent);box-shadow:0 2px 14px rgba(13,148,136,.1)}
.session-card-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.session-card-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.session-card-bottom{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.session-card-date{font-size:.78rem;color:var(--ink-3)}
.session-info-label{font-size:.78rem;color:var(--ink-2)}
.session-name-link{font-weight:600;font-size:.9rem;color:var(--ink);text-decoration:none;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.session-name-link:hover{color:var(--accent)}
.session-badge{display:inline-flex;align-items:center;padding:3px 10px;border-radius:99px;font-size:.72rem;font-weight:700;letter-spacing:.03em;flex-shrink:0}
.badge-exam{background:rgba(99,102,241,.12);color:#6366f1}
.badge-train{background:rgba(20,184,166,.12);color:var(--accent)}
.session-score-block{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:72px;padding:10px 14px;border-radius:var(--radius-sm);flex-shrink:0}
.session-pct{font-size:1.3rem;font-weight:800;line-height:1}
.session-raw{font-size:.71rem;color:inherit;opacity:.75}
.session-score-block.score-ok{background:rgba(22,163,74,.1);color:#16a34a}
.session-score-block.score-mid{background:rgba(234,179,8,.1);color:#b45309}
.session-score-block.score-low{background:rgba(220,38,38,.1);color:#dc2626}
/* Saved session extras */
.saved-session-card{flex-direction:column;align-items:stretch;cursor:default}
.saved-session-card:hover{border-color:var(--border);box-shadow:none}
.session-card-main{display:flex;align-items:center;justify-content:space-between;gap:16px}
.session-rename-row{display:flex;gap:8px;align-items:center;padding-top:10px;border-top:1px solid var(--border);margin-top:4px}
.session-rename-row input{flex:1;min-width:0;width:auto!important;padding:7px 12px;background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:.82rem;color:var(--ink);transition:border-color var(--t)}
.session-rename-row input:focus{outline:none;border-color:var(--accent)}
/* ── Flag cards (new) ── */
.flag-card{padding:14px 18px;border-radius:var(--radius);margin-bottom:10px;display:flex;flex-direction:column;gap:10px;border:1.5px solid}
.flag-pending{background:rgba(239,68,68,.04);border-color:rgba(239,68,68,.25)}
.flag-resolved{background:var(--surface-2);border-color:var(--border)}
.flag-card-header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.flag-card-date{font-size:.75rem;color:var(--ink-3)}
.flag-card-question{font-size:.87rem;color:var(--ink);font-weight:500;line-height:1.55}
.flag-card-reason{font-size:.81rem;color:var(--ink-2);background:var(--surface);padding:9px 13px;border-radius:var(--radius-sm);border-left:3px solid var(--border)}
.flag-card-actions{display:flex;gap:8px}
.flag-status-pill{display:inline-flex;align-items:center;gap:5px;padding:3px 11px;border-radius:99px;font-size:.72rem;font-weight:700;letter-spacing:.02em}
.pill-warn{background:rgba(234,179,8,.18);color:#b45309}
.pill-ok{background:rgba(22,163,74,.14);color:#16a34a}
/* ── Note cards v2 ── */
.note-card-v2{padding:15px 18px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--radius);display:flex;flex-direction:column;gap:9px;margin-bottom:10px;transition:border-color var(--t)}
.note-card-v2:hover{border-color:var(--accent)}
.note-card-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.note-chip{display:inline-flex;align-items:center;padding:2px 9px;border-radius:99px;font-size:.7rem;font-weight:600;background:var(--surface);border:1px solid var(--border);color:var(--ink-2)}
.note-chip-module{background:rgba(99,102,241,.08);border-color:rgba(99,102,241,.25);color:#6366f1}
.note-chip-source{background:rgba(20,184,166,.08);border-color:rgba(20,184,166,.25);color:var(--accent)}
.note-updated{font-size:.72rem;color:var(--ink-3);margin-left:auto}
.note-card-question{font-size:.88rem;color:var(--ink);font-weight:600;line-height:1.55}
.note-tags{display:flex;flex-wrap:wrap;gap:5px}
.note-card-text{font-size:.83rem;color:var(--ink-2);line-height:1.65;background:var(--surface);padding:9px 13px;border-radius:var(--radius-sm);border-left:3px solid var(--accent);white-space:pre-wrap}
.note-card-actions{display:flex;gap:8px;flex-wrap:wrap;padding-top:2px}
/* ── Pagination ── */
.pagination-bar{display:flex;align-items:center;justify-content:center;gap:14px;padding:14px 0 4px;font-size:.84rem}
/* ── Preferences tab ───────────────────────────────────────────────────── */
.prefs-page{display:flex;flex-direction:column;gap:14px;padding:4px 0}
.pref-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.pref-card-header{display:flex;align-items:center;gap:14px;padding:16px 18px;background:var(--surface-2);border-bottom:1px solid var(--border)}
.pref-card-icon{font-size:1.5rem;flex-shrink:0;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background:var(--surface);border:1px solid var(--border);border-radius:10px}
.pref-card-header h4{font-size:.95rem;font-weight:700;color:var(--ink);margin:0 0 2px}
.pref-card-header p{font-size:.78rem;color:var(--ink-3);margin:0}
.pref-card-body{display:flex;flex-direction:column}
.pref-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 18px;border-bottom:1px solid var(--border)}
.pref-row:last-child{border-bottom:none}
.pref-row-sub{background:var(--surface-2)}
.pref-row-label{flex:1;min-width:0}
.pref-row-label strong{display:block;font-size:.88rem;color:var(--ink);font-weight:600}
.pref-row-label span{font-size:.76rem;color:var(--ink-3);margin-top:2px;display:block}
.pref-input-short{width:110px!important;min-width:110px;max-width:110px;padding:8px 12px;background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:.88rem;color:var(--ink);flex-shrink:0;transition:border-color var(--t)}
.pref-input-short:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(13,148,136,.1)}
.pref-select{width:auto!important;max-width:220px;padding:8px 12px;background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:.88rem;color:var(--ink);flex-shrink:0;min-width:180px;transition:border-color var(--t);appearance:none;cursor:pointer}
.pref-select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(13,148,136,.1)}
/* Toggle switch */
.toggle-switch{position:relative;display:inline-flex;align-items:center;flex-shrink:0;cursor:pointer}
.toggle-switch input{position:absolute;opacity:0;width:0;height:0}
.toggle-track{display:flex;align-items:center;width:46px;height:26px;background:var(--border-2);border-radius:99px;transition:background var(--t);position:relative}
.toggle-thumb{width:20px;height:20px;background:#fff;border-radius:50%;position:absolute;left:3px;transition:left .2s ease;box-shadow:0 1px 4px rgba(0,0,0,.2)}
.toggle-switch input:checked + .toggle-track{background:var(--accent)}
.toggle-switch input:checked + .toggle-track .toggle-thumb{left:23px}
/* Theme picker */
.theme-picker{display:flex;gap:8px;flex-wrap:wrap}
.theme-btn{flex:1;min-width:0;padding:8px 12px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:.82rem;font-weight:600;color:var(--ink-2);cursor:pointer;transition:var(--t);white-space:nowrap;text-align:center}
.theme-btn:hover{border-color:var(--accent);color:var(--ink)}
.theme-btn.active{background:var(--accent-ghost);border-color:var(--accent);color:var(--accent-2);box-shadow:0 0 0 3px rgba(13,148,136,.1)}
@media(max-width:480px){.pref-row:has(.theme-picker){flex-direction:column;align-items:flex-start}.theme-picker{width:100%}}
/* Save footer */
.pref-footer{display:flex;align-items:center;gap:14px;padding:4px 0 2px}
.prefs-msg{font-size:.84rem;font-weight:600}
.prefs-msg.ok{color:var(--green)}
.prefs-msg.err{color:var(--red)}
.message-list{display:flex;flex-direction:column;gap:9px}
.message-item{padding:12px 14px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);transition:var(--t)}
.message-item.unread{background:var(--blue-light);border-color:#93c5fd}
.message-meta{display:flex;justify-content:space-between;gap:8px;font-size:.77rem;color:var(--ink-3);margin-bottom:5px}
.message-item.unread .message-meta{color:#1d4ed8;font-weight:600}
.message-body{font-size:.87rem;color:var(--ink-2);line-height:1.5}
.favorites-toolbar{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap;align-items:center}
.favorites-toolbar select,.favorites-toolbar input{width:auto!important;max-width:170px;min-width:110px;padding:7px 12px;font-size:.82rem}
.favorites-toolbar select{padding-right:32px}
.favorite-item{padding:13px 15px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);display:flex;flex-direction:column;gap:7px;margin-bottom:8px;transition:var(--t)}
.favorite-item:hover{border-color:var(--accent)}
.favorite-title{font-size:.87rem;color:var(--ink);line-height:1.5;font-weight:500}
.favorite-tags{display:flex;flex-wrap:wrap;gap:5px}
.favorite-actions{display:flex;gap:7px;flex-wrap:wrap}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   ADMIN
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.admin-layout{display:flex;min-height:100vh}
.admin-sidebar{width:var(--sidebar-w);min-height:100vh;background:#0f172a;padding:18px 10px;display:flex;flex-direction:column;gap:2px;position:sticky;top:0;max-height:100vh;overflow-y:auto;flex-shrink:0}
.admin-brand{padding:9px 13px 18px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:6px}
.admin-brand .brand{color:#5eead4;font-size:1.1rem}
.admin-brand .muted{color:rgba(255,255,255,.4);font-size:.7rem;margin-top:2px}
.admin-tab{display:flex;align-items:center;gap:9px;padding:9px 13px;border-radius:var(--radius-sm);background:transparent;border:none;font-size:.82rem;font-weight:500;color:rgba(255,255,255,.5);text-align:left;cursor:pointer;transition:var(--t);width:100%}
.admin-tab:hover{background:rgba(255,255,255,.06);color:rgba(255,255,255,.85)}
.admin-tab.active{background:rgba(13,148,136,.2);color:#5eead4;font-weight:600}
.admin-tab i{font-size:.92rem;width:17px;text-align:center}
.admin-sep{height:1px;background:rgba(255,255,255,.08);margin:5px 0}
.admin-content{flex:1;padding:28px;overflow-y:auto;min-width:0;background:var(--bg)}
.admin-section{display:none}
.admin-section.active{display:block}
.admin-header{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:22px;flex-wrap:wrap}
.admin-header h2{font-size:1.35rem}
.admin-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.admin-toolbar input[type="text"],.admin-toolbar select{max-width:190px;font-size:.82rem;padding:7px 30px 7px 10px;width:auto}
.admin-table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;box-shadow:var(--shadow-sm)}
.admin-table{width:100%;border-collapse:collapse;font-size:.84rem}
.admin-table th{background:var(--surface-2);padding:9px 13px;text-align:left;font-size:.71rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-3);border-bottom:1px solid var(--border)}
.admin-table td{padding:9px 13px;border-bottom:1px solid var(--border);vertical-align:top}
.admin-table tr:last-child td{border-bottom:none}
.admin-table tr:hover td{background:var(--surface-2)}
.admin-table .q-text{max-width:280px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:.82rem}
.admin-table .actions{display:flex;gap:5px;flex-wrap:wrap}
.sub-tabs{display:flex;gap:2px;padding:3px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:16px;width:fit-content}
.tab-btn{padding:7px 16px;border-radius:var(--radius-sm);background:transparent;border:none;font-size:.83rem;font-weight:500;color:var(--ink-3);transition:var(--t);cursor:pointer}
.tab-btn.active{background:var(--surface);color:var(--ink);font-weight:600;box-shadow:var(--shadow-sm)}
.tab-btn:hover:not(.active){color:var(--ink)}
.import-zone{border:2px dashed var(--border);border-radius:var(--radius-lg);padding:32px;text-align:center;background:var(--surface-2);transition:var(--t);cursor:pointer}
.import-zone:hover,.import-zone.drag-over{border-color:var(--accent);background:var(--accent-ghost)}
.import-preview{overflow-x:auto;margin-top:12px;border-radius:var(--radius);border:1px solid var(--border)}
.admin-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:13px;margin-bottom:20px}
.admin-stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;display:flex;flex-direction:column;gap:4px}
.admin-stat-card .stat-val{font-size:1.35rem;font-weight:800}
.admin-stat-card .stat-lbl{font-size:.74rem;color:var(--ink-3)}
/* Reports */
.report-item{padding:14px;border-radius:var(--radius);margin-bottom:9px;background:var(--amber-light);border:1px solid #fde68a;transition:var(--t)}
.report-item.resolved{background:var(--surface-2);border-color:var(--border);opacity:.75}
.report-meta{font-size:.74rem;color:var(--ink-3);margin-bottom:5px;display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.report-question{font-size:.87rem;font-weight:600;margin-bottom:4px}
.report-reason{font-size:.87rem;color:var(--ink-2);margin-bottom:9px;padding:7px 11px;background:rgba(255,255,255,.5);border-radius:var(--radius-sm)}
.report-actions{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.import-preview table{width:100%;border-collapse:collapse;font-size:.77rem}
.import-preview th{background:var(--surface-2);padding:7px 9px;text-align:left;font-size:.69rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--ink-3);border-bottom:1px solid var(--border);white-space:nowrap}
.import-preview td{padding:6px 9px;border-bottom:1px solid var(--border);color:var(--ink-2);max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.import-preview tr:last-child td{border-bottom:none}

/* Profile floating menu */
.profile-menu{position:fixed;bottom:20px;right:20px;z-index:200}
.profile-trigger{width:42px;height:42px;border-radius:50%;border:2px solid var(--border);background:var(--surface);box-shadow:var(--shadow);overflow:hidden;position:relative;transition:var(--t);display:flex;align-items:center;justify-content:center;cursor:pointer}
.profile-trigger:hover{box-shadow:var(--shadow-lg);transform:scale(1.05)}
.profile-link-img{width:100%;height:100%;object-fit:cover}
.profile-badge{position:absolute;top:-2px;right:-2px;min-width:15px;height:15px;background:var(--red);color:#fff;border-radius:99px;font-size:.6rem;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 3px;border:2px solid var(--surface)}
.profile-badge.hidden{display:none}
.profile-menu-list{position:absolute;bottom:calc(100% + 10px);right:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);overflow:hidden;min-width:160px;animation:slideUp .15s ease}
.profile-menu-list.hidden{display:none}
.profile-menu-item{display:flex;align-items:center;gap:9px;padding:9px 14px;font-size:.87rem;color:var(--ink-2);background:transparent;border:none;width:100%;text-align:left;cursor:pointer;transition:var(--t)}
.profile-menu-item:hover{background:var(--surface-2);color:var(--ink)}
.profile-menu-item.logout{color:var(--red)}
.profile-menu-item.logout:hover{background:var(--red-light)}

/* â•â•â• RESPONSIVE â€” Tablet â•â•â• */
@media(max-width:900px){
  .hero{grid-template-columns:1fr;padding-top:calc(var(--nav-h) + 32px);min-height:auto;gap:28px}
  .hero-card{display:none}
  .feature-grid{grid-template-columns:1fr 1fr}
  .container.auth{grid-template-columns:1fr}
  .auth-hero{padding:48px 32px;min-height:auto}
  .auth-card{padding:40px 32px}
  .profile-sidebar{width:200px;padding:14px 8px}
  .profile-sections{padding:20px}
  .stat-grid{grid-template-columns:1fr 1fr}
  .stat-grid-extra{grid-template-columns:repeat(3,1fr)}
  .analytics-grid{grid-template-columns:1fr 1fr}
  .stats-charts-row{grid-template-columns:1fr 1fr}
  .module-bar-row{grid-template-columns:minmax(0,130px) 1fr auto auto}
  .result-header,.result-row{grid-template-columns:2fr 1fr 1fr}
  .result-header>*:nth-child(4),.result-row>*:nth-child(4){display:none}
  .qcm-sidebar{display:none}
  .qcm-body{padding:16px}
  .qcm-card{padding:20px}
  .admin-content{padding:20px}
  .filters-row.three{grid-template-columns:1fr 1fr}
  .principal-class-cards{grid-template-columns:1fr 1fr}
  .principal-source-pills{grid-template-columns:1fr}
}

/* â•â•â• RESPONSIVE â€” Mobile â•â•â• */
@media(max-width:640px){
  :root{--nav-h:52px}
  .nav{padding:0 14px}
  .hero{padding:calc(var(--nav-h) + 22px) 14px 36px}
  .hero-actions{flex-direction:column}
  .hero-actions .btn,.hero-actions a.btn{width:100%;justify-content:center}
  .feature-grid{grid-template-columns:1fr;padding:28px 14px 44px}
  .container.auth{grid-template-columns:1fr}
  .auth-hero{padding:36px 18px 24px;justify-content:flex-end}
  .auth-hero p{display:none}
  .auth-card{padding:22px 18px}
  .dashboard-main{padding:16px 12px 40px}
  .mode-cards{grid-template-columns:1fr}
  .filters-row{grid-template-columns:1fr}
  .filters-row.three{grid-template-columns:1fr}
  .dash-panel{padding:14px}
  .principal-filter-head{flex-direction:column;align-items:stretch}
  .principal-class-cards{grid-template-columns:1fr}
  .filter-mode-switch{width:100%}
  .mode-pill{flex:1;text-align:center}
  .delay-row{flex-direction:column;align-items:stretch}
  .delay-input-wrap input{width:100%}
  .qcm-topbar{padding:0 12px;height:46px}
  .qcm-body{padding:10px}
  .qcm-card{padding:14px;border-radius:var(--radius-lg)}
  .question-text{font-size:.97rem}
  .btn-prev .prev-text{display:none}
  .result-wrap{padding:14px 10px 40px;align-items:flex-start}
  .result-meta{grid-template-columns:1fr 1fr}
  .result-meta-item:last-child{grid-column:1 / -1}
  .rr-row{grid-template-columns:30px 1fr auto}
  .rr-chevron{display:none}
  .profile-app{flex-direction:column}
  .profile-sidebar{width:100%;min-height:auto;position:sticky;top:0;z-index:50;max-height:none;flex-direction:row;flex-wrap:nowrap;padding:7px;gap:3px;border-right:none;border-bottom:1px solid var(--border);overflow-x:auto;align-items:center}
  .profile-sidebar-top{display:none}
  .sidebar-back{margin-bottom:0;flex-shrink:0}
  .profile-tab{padding:6px 10px;white-space:nowrap;font-size:.77rem;width:auto;flex-shrink:0}
  .profile-tab-logout{margin-top:0;padding-top:6px;border-top:none;border-left:1px solid var(--border);padding-left:10px;margin-left:auto}
  .profile-sections{padding:13px}
  .stat-grid{grid-template-columns:1fr 1fr}
  .stat-grid-extra{grid-template-columns:repeat(2,1fr)}
  .analytics-grid{grid-template-columns:1fr}
  .stats-charts-row{grid-template-columns:1fr}
  .radar-chart-wrap{height:220px}
  .module-bar-row{grid-template-columns:1fr auto auto}
  .module-bar-label{max-width:none}
  .failed-card-header{grid-template-columns:1fr auto auto}
  .failed-card-count{display:none}
  .info-grid{grid-template-columns:1fr}
  .result-header,.result-row{grid-template-columns:1fr 1fr;font-size:.77rem;padding:8px 10px;gap:7px}
  .result-header>*:nth-child(n+3),.result-row>*:nth-child(n+3){display:none}
  .avatar-stack{flex-direction:column;align-items:flex-start;gap:12px}
  .admin-layout{flex-direction:column}
  .admin-sidebar{width:100%;min-height:auto;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;padding:7px;gap:3px;position:sticky;top:0;z-index:100;max-height:none}
  .admin-brand,.admin-sep{display:none}
  .admin-tab{white-space:nowrap;padding:7px 10px;font-size:.77rem;flex-shrink:0;width:auto}
  .admin-content{padding:13px}
  .admin-header{flex-direction:column;align-items:flex-start;gap:8px}
  .admin-header h2{font-size:1.15rem}
  .admin-table{font-size:.77rem}
  .admin-table th,.admin-table td{padding:7px 9px}
  .admin-stats{grid-template-columns:1fr 1fr}
  .comment-panel{position:fixed;bottom:0;left:0;right:0;max-height:72vh;border-radius:var(--radius-lg) var(--radius-lg) 0 0;border:none;border-top:1px solid var(--border);z-index:500;box-shadow:var(--shadow-xl)}
}
@media(max-width:380px){
  .mode-card{padding:12px}
  .qcm-card{padding:12px}
  .result-score-circle{width:115px;height:115px}
  .admin-stats{grid-template-columns:1fr}
}

/* QCM old-look override (scoped) */
.qcm-wrap .qcm-card{
  background: var(--card);
  width: min(560px, 92vw);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(15, 23, 18, 0.12);
}

.qcm-wrap #question{line-height:1.4;margin-bottom:20px}

.qcm-wrap .tag-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.qcm-wrap .course-tag{
  font-size:12px;
  font-weight:600;
  letter-spacing:.3px;
  text-transform:uppercase;
  color:var(--accent-2);
  background:#e8f5f4;
  border-radius:999px;
  padding:6px 10px;
}

.qcm-wrap .option{
  display:flex;
  align-items:center;
  padding:12px;
  margin-bottom:12px;
  background:var(--soft);
  border:1px solid transparent;
  border-radius:12px;
  transition:all .2s ease;
}
.qcm-wrap .option:hover{background:#eef2ef;border-color:#dde3df;transform:translateY(-1px)}
.qcm-wrap .option input{margin-right:12px;transform:scale(1.2)}

.qcm-wrap .explanation{
  margin-top:16px;
  padding:12px;
  background:#f3fbfb;
  border-left:4px solid var(--accent);
  border-radius:8px;
}

.qcm-wrap .q-nav{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.qcm-wrap .q-nav button{margin-top:0}

.qcm-wrap .comment-panel{
  background:var(--card);
  width:min(560px, 92vw);
  margin:16px auto 0;
  padding:20px;
  border-radius:16px;
  border:1px solid rgba(18, 24, 28, 0.08);
  box-shadow:0 14px 30px rgba(15, 23, 18, 0.1);
}

@media (max-width: 560px){
  .qcm-wrap .qcm-card,
  .qcm-wrap .comment-panel{width:min(720px,96vw);padding:16px}
  .qcm-wrap .q-nav{grid-template-columns:1fr}
}

:root[data-theme="dark"] .profile-menu-list {
  background: #0f172a;
  border-color: #334155;
}

.auth-card button,
.profile-section button:not(.btn-inline):not(.profile-tab):not(.profile-tab-logout):not(.fav-expand-btn),
.dashboard-card > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  transition: var(--t);
}

.auth-card button:hover,
.profile-section button:not(.btn-inline):not(.profile-tab):not(.profile-tab-logout):not(.fav-expand-btn):hover,
.dashboard-card > button:hover {
  background: var(--accent-2);
}

.favorite-title-btn {
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.favorite-preview {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

/* ── Favorites v2 cards ── */
.fav-card.favorite-item{padding:0;display:block;gap:0;border:1.5px solid var(--border);background:var(--surface-2);border-radius:var(--radius);margin-bottom:10px;overflow:hidden}
.fav-card.favorite-item:hover{border-color:var(--accent);box-shadow:0 4px 18px rgba(13,148,136,.09)}
.fav-card-top{display:flex;align-items:flex-start}
.fav-expand-btn{flex:1;min-width:0;display:flex;align-items:flex-start;gap:10px;padding:14px 14px 10px;background:none;border:none;cursor:pointer;text-align:left;color:var(--ink);transition:background var(--t)}
.fav-expand-btn:hover{background:rgba(13,148,136,.05)}
.fav-heart{font-size:.95rem;color:var(--accent);flex-shrink:0;margin-top:2px;line-height:1}
.fav-question{flex:1;font-size:.88rem;font-weight:500;line-height:1.55;color:var(--ink)}
.fav-chevron{font-size:1rem;color:var(--ink-3);flex-shrink:0;margin-top:1px;transition:transform var(--t),color var(--t)}
.fav-card.expanded .fav-chevron{transform:rotate(180deg);color:var(--accent)}
.fav-date{font-size:.71rem;color:var(--ink-3);padding:15px 14px 0 0;white-space:nowrap;flex-shrink:0}
.fav-card-meta{display:flex;flex-wrap:wrap;gap:5px;padding:0 14px 10px;align-items:center}
.fav-tag{display:inline-flex;align-items:center;padding:2px 9px;border-radius:99px;font-size:.7rem;font-weight:600;background:rgba(13,148,136,.1);border:1px solid rgba(13,148,136,.22);color:var(--accent)}
.fav-no-tags{font-size:.74rem;color:var(--ink-3)}
.fav-detail{border-top:1.5px solid var(--border);background:var(--surface)}
.fav-detail-inner{padding:16px;display:flex;flex-direction:column;gap:14px}
.fav-detail-chips{display:flex;flex-wrap:wrap;gap:6px}
.fav-detail-section{display:flex;flex-direction:column;gap:7px}
.fav-section-label{font-size:.69rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--ink-3)}
.fav-opts{display:flex;flex-direction:column;gap:6px}
.fav-opt{display:flex;align-items:flex-start;gap:10px;padding:8px 12px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface-2);font-size:.84rem;color:var(--ink-2)}
.fav-opt-correct{background:rgba(22,163,74,.07);border-color:rgba(22,163,74,.3);color:var(--ink)}
.fav-opt-letter{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;font-size:.71rem;font-weight:700;flex-shrink:0;background:var(--surface);border:1px solid var(--border);color:var(--ink-2)}
.fav-opt-letter-correct{background:#16a34a;border-color:#16a34a;color:#fff}
.fav-opt-text{flex:1;line-height:1.45}
.fav-opt-check{margin-left:auto;color:#16a34a;font-weight:800;flex-shrink:0;font-size:.9rem}
.fav-explanation{font-size:.84rem;color:var(--ink-2);line-height:1.65;background:var(--surface-2);padding:10px 13px;border-radius:var(--radius-sm);border-left:3px solid var(--accent)}
.fav-note-text{font-size:.84rem;color:var(--ink-2);line-height:1.65;background:rgba(99,102,241,.05);padding:10px 13px;border-radius:var(--radius-sm);border-left:3px solid #6366f1;white-space:pre-wrap}
.fav-comment{padding:9px 12px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);margin-bottom:6px}
.fav-comment:last-child{margin-bottom:0}
.fav-comment-header{display:flex;justify-content:space-between;gap:8px;margin-bottom:4px;font-size:.77rem}
.fav-comment-body{font-size:.83rem;color:var(--ink-2);line-height:1.5}
.fav-card-actions{display:flex;gap:8px;padding:9px 14px;border-top:1px dashed var(--border);background:var(--surface)}

.favorite-preview-q {
  font-size: .84rem;
  color: var(--ink-2);
}

.result-save-box {
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.rr-history-actions {
  margin-top: 10px;
}

.rr-attempt-history {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.attempt-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .8rem;
  color: var(--ink-2);
  background: var(--surface);
}

.favorite-detail-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 6px 12px;
  font-size: .82rem;
  color: var(--ink-2);
}

.favorite-detail-block {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: .82rem;
}

.favorite-opt {
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.favorite-opt:last-child {
  border-bottom: none;
}

.favorite-comment {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.favorite-comment:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.dash-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-panel-title #questionsCount {
  margin-left: auto;
}

.filters-count-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.brand-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  padding: 5px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.9), rgba(255,255,255,.1) 55%),
    linear-gradient(145deg, #d7f3ee, #c2ebe4);
  box-shadow:
    0 6px 14px rgba(15,118,110,.16),
    inset 0 1px 0 rgba(255,255,255,.7);
  object-fit: contain;
  display: block;
}

.auth-brand {
  color: #ffffff;
  font-weight: 700;
  opacity: 0.95;
  font-size: 1.06rem;
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(204, 251, 241, 0.24);
  background: linear-gradient(135deg, rgba(20,184,166,.22), rgba(13,148,136,.12));
  box-shadow: 0 12px 28px rgba(8, 47, 73, 0.22);
  width: fit-content;
}

.auth-brand .brand-icon {
  width: 46px;
  height: 46px;
  padding: 10px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,.98), rgba(255,255,255,.72) 58%, rgba(236,253,245,.55)),
    linear-gradient(150deg, #ecfeff, #ccfbf1);
  box-shadow:
    0 10px 20px rgba(6,95,70,.25),
    inset 0 1px 0 rgba(255,255,255,.85);
}

.profile-brand-mini {
  margin-bottom: 10px;
  color: #2d3c38;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.62);
  border: 1px solid #d7e8e2;
}

.dash-brand.brand-with-icon .brand-icon,
.nav .brand-with-icon .brand-icon,
.admin-header .brand-with-icon .brand-icon {
  width: 28px;
  height: 28px;
  padding: 6px;
}

.dash-brand.brand-with-icon span,
.nav .brand-with-icon span,
.admin-header .brand-with-icon span {
  letter-spacing: -0.02em;
}

/* Logo reset: cleaner/minimal integration */
.brand-with-icon {
  gap: 8px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-brand {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  margin-bottom: 10px;
}

.auth-brand .brand-icon {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-brand-mini {
  padding: 0;
  border: 0;
  background: transparent;
}

/* Login artistic centered logo block */
.auth-hero {
  align-items: center;
  text-align: center;
}

.auth-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.auth-logo-mark {
  width: clamp(92px, 11vw, 144px);
  height: clamp(92px, 11vw, 144px);
  object-fit: contain;
}

.auth-logo-word {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-transform: lowercase;
}

.auth-hero .pill {
  align-self: center;
}

.auth-hero p {
  max-width: 40ch;
}

@media (max-width: 768px) {
  .auth-logo-mark {
    width: clamp(74px, 26vw, 104px);
    height: clamp(74px, 26vw, 104px);
  }

  .auth-logo-word {
    font-size: clamp(2.4rem, 11vw, 3.8rem);
  }
}

/* ══════════════════════════════════════════════════
   RANGE SLIDER — override original qcount rules
══════════════════════════════════════════════════ */

/* Wrap layout */
.qcount-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Label + big value row */
.slider-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.slider-header > span {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-3);
}
.slider-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.slider-count strong {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.04em;
  line-height: 1;
}
.slider-count strong span {
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-4);
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Track: override the original 6px solid-thumb rule ── */
.qcount-slider-wrap input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 18px;
  background: transparent !important;
  border: 0;
  outline: none;
}

/* ── Thumb: hollow circle instead of solid teal ── */
.qcount-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--surface);          /* hollow — shows the page bg */
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(13,148,136,.15);
  transition: transform .15s ease, box-shadow .15s ease;
  margin-top: -7px;
}
.qcount-slider-wrap input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.18);
  box-shadow: 0 0 0 5px rgba(13,148,136,.18);
}
.qcount-slider-wrap input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.28);
  box-shadow: 0 0 0 7px rgba(13,148,136,.2);
}
.qcount-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(13,148,136,.15);
  transition: transform .15s ease;
}

:root[data-theme="dark"] .qcount-slider-wrap input[type="range"] {
  background: transparent !important;
}

.qcount-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) var(--pct, 0%),
    color-mix(in srgb, var(--ink-4) 40%, transparent) var(--pct, 0%),
    color-mix(in srgb, var(--ink-4) 40%, transparent) 100%
  );
}

.qcount-slider-wrap input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-4) 40%, transparent);
}

.qcount-slider-wrap input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

:root[data-theme="dark"] .qcount-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(
    90deg,
    #16c7bb 0%,
    #16c7bb var(--pct, 0%),
    #334155 var(--pct, 0%),
    #334155 100%
  );
}

/* Min/max end labels */
.slider-ends {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  color: var(--ink-4);
  font-weight: 500;
  margin-top: -4px;
}

/* Top bar logo-only consistency */
.topbar-logo {
  display: inline-flex;
  align-items: center;
}
.topbar-logo .brand-icon {
  width: 40px !important;
  height: 40px !important;
}

/* ══════════════════════════════════════════
   ADMIN — STATS PANEL
══════════════════════════════════════════ */

/* Period bar */
.stats-period-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.stats-period-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.stats-preset {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.stats-preset:hover { background: var(--surface-2); }
.stats-preset.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.stats-period-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.stats-period-custom input[type="date"] {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .82rem;
}
.stats-period-arrow { color: var(--ink-4); font-size: .9rem; }

/* KPI cards */
.stats-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stats-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stats-kpi-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-ghost);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stats-kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.04em;
  line-height: 1;
}
.stats-kpi-label {
  font-size: .73rem;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 3px;
}

/* Chart cards */
.stats-chart-card { margin-bottom: 20px; }
.stats-chart-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.stats-chart-wrap {
  position: relative;
  height: 240px;
}

/* Two-column layout */
.stats-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media(max-width:900px){ .stats-two-col { grid-template-columns: 1fr; } }

/* Failed questions filters */
.stats-failed-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.stats-filter-sel {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .8rem;
  flex: 1;
  min-width: 140px;
}

/* Stats tables */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.stats-table th {
  text-align: left;
  color: var(--ink-4);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.stats-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  vertical-align: middle;
}
.stats-table tr:last-child td { border-bottom: none; }
.stats-table tr:hover td { background: var(--surface-2); }
.stats-rank { font-weight: 700; color: var(--ink-4); width: 28px; }
.stats-name { font-weight: 600; color: var(--ink); }
.stats-q-text { max-width: 340px; line-height: 1.4; }
.stats-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-ghost);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 600;
}
.stats-tag--course { background: rgba(99,102,241,.1); color: #818cf8; }
.stats-tag--source { background: rgba(234,179,8,.1);  color: #ca8a04; }

/* Score pill */
.stats-score-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}
.stats-score-pill.good { background: rgba(34,197,94,.15);  color: #16a34a; }
.stats-score-pill.mid  { background: rgba(234,179,8,.15);  color: #ca8a04; }
.stats-score-pill.bad  { background: rgba(239,68,68,.15);  color: #dc2626; }

/* Fail bar */
.stats-fail-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.stats-fail-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--red);
  min-width: 2px;
  max-width: 80px;
  flex-shrink: 0;
}
.stats-fail-bar-wrap span { font-weight: 700; color: var(--red); font-size: .8rem; }
