/* ============================================================
   ULTRALEARNING ENGINE v1.5 — App Styles
   ============================================================ */

/* ── App Shell ── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Nav ── */
#topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--s-6);
  gap: var(--s-6);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}
.brand-icon {
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.brand-version {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--accent-muted);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.nav-links {
  display: flex;
  gap: var(--s-2);
}
.nav-links a {
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-links a:hover { color: var(--text-primary); background: var(--border); }
.nav-links a.nav-active { color: var(--accent); background: var(--accent-muted); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  position: relative;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--border-solid);
  cursor: pointer;
  transition: background var(--dur-fast);
  background: var(--bg-elevated);
}
.user-chip:hover { background: var(--accent-hover); }

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--free-deep);
  font-weight: 800;
  font-size: var(--text-sm);
  display: flex; align-items: center; justify-content: center;
}
.user-name-chip {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.chevron { font-size: 10px; color: var(--text-muted); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 48px;
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-3);
  display: none;
  z-index: 200;
}
.dropdown-menu.open { display: block; }
.dropdown-header {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
  padding: var(--s-2) var(--s-3);
}
.dropdown-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: 0 var(--s-3) var(--s-2);
}
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: var(--s-2) 0; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.dropdown-item:hover { background: var(--accent-hover); color: var(--text-primary); }

.btn-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.btn-icon:hover { background: var(--accent-hover); color: var(--accent); }

/* ── Main Content ── */
#main-content { flex: 1; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.footer-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--s-3) var(--s-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.footer-brand-compact {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
}
.footer-tagline {
  font-weight: 400;
  color: var(--text-muted);
  font-size: var(--text-xs);
}
.footer-bar-links {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.footer-bar-links a {
  font-size: var(--text-xs);
  color: var(--text-muted);
  transition: color var(--dur-fast);
}
.footer-bar-links a:hover { color: var(--accent); }
.footer-copy {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding-left: var(--s-2);
  border-left: 1px solid var(--border);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2); height: 44px; padding: 0 var(--s-6);
  border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--text-sm);
  letter-spacing: -0.01em; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background var(--dur-base);
  cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: var(--free-deep); }
.btn-primary:hover { box-shadow: var(--accent-glow); }
[data-theme="light"] .btn-primary { color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-solid);
}
.btn-ghost:hover { background: var(--accent-hover); color: var(--text-primary); border-color: var(--accent); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { box-shadow: 0 0 30px rgba(255,68,85,0.35); }

.btn-sm { height: 34px; padding: 0 var(--s-4); font-size: var(--text-xs); }
.btn-full { width: 100%; }
.btn-link { background: none; color: var(--accent); font-size: var(--text-sm); padding: 0; cursor: pointer; border: none; }
.btn-link:hover { text-decoration: underline; }

/* ── Inputs ── */
.input {
  display: block; width: 100%; height: 44px;
  padding: 0 var(--s-4);
  border: 1.5px solid var(--input-border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: border-color var(--dur-base);
  appearance: none;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.input::placeholder { color: var(--text-muted); }
textarea.input { height: auto; min-height: 90px; padding: var(--s-3) var(--s-4); resize: vertical; }
.input-sm { height: 36px; font-size: var(--text-xs); }
input[type="range"].input {
  height: 6px; padding: 0; border: none;
  background: var(--border-solid);
  border-radius: var(--r-pill);
  cursor: pointer;
  accent-color: var(--accent);
}
input[type="range"].input:focus { box-shadow: none; }
.range-display {
  font-size: var(--text-lg); font-weight: 800;
  font-family: var(--font-display);
  color: var(--accent); margin-top: var(--s-2);
}

.label {
  display: block; font-size: var(--text-xs); font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--s-2); letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-group { margin-bottom: var(--s-5); }
.form-row { display: flex; gap: var(--s-4); align-items: flex-end; flex-wrap: wrap; }
.field-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--s-2); }

/* ── Badge / Pill ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: var(--r-pill);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.03em;
}
.version-pill {
  display: inline-block;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--accent-muted);
  color: var(--accent);
  font-size: var(--text-sm); font-weight: 700;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  transition: box-shadow var(--dur-base);
}
.card:hover { box-shadow: var(--shadow-md); }

/* ── Container ── */
.container {
  max-width: 1400px; margin: 0 auto;
  padding: 0 var(--s-6);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  border-radius: var(--r-2xl);
  width: 100%; max-width: 540px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-6);
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-weight: 800; font-size: var(--text-xl); }
.modal-body { padding: var(--s-6); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: var(--s-3);
  padding: var(--s-5) var(--s-6);
  border-top: 1px solid var(--border);
}
.textarea { height: auto; min-height: 90px; padding: var(--s-3) var(--s-4); resize: vertical; }

/* ── Toggle Switch ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-solid);
  border-radius: var(--r-pill);
  transition: background var(--dur-base);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; left: 3px; top: 3px;
  transition: transform var(--dur-base) var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Progress Ring ── */
.progress-ring { flex-shrink: 0; }

/* ── BFP Bar ── */
.bfp-bar {
  display: flex; height: 8px; border-radius: var(--r-pill);
  overflow: hidden; gap: 2px; margin: var(--s-4) 0 var(--s-2);
}
.bfp-segment { border-radius: var(--r-pill); transition: width var(--dur-slow) var(--ease-out); }
.bfp-b { background: var(--free-accent); }
.bfp-f { background: var(--core-accent); }
.bfp-p { background: var(--elite-accent); }
.bfp-legend { display: flex; gap: var(--s-4); font-size: var(--text-xs); color: var(--text-muted); align-items: center; }
.bfp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.bfp-b-dot { background: var(--free-accent); }
.bfp-f-dot { background: var(--core-accent); }
.bfp-p-dot { background: var(--elite-accent); }
.bfp-edit-row { margin-top: var(--s-4); }
.bfp-sliders .form-group { margin-bottom: var(--s-4); }

/* ── View: Login ── */
.view-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
}
@media (max-width: 900px) { .view-login { grid-template-columns: 1fr; } }

.login-hero {
  background: var(--free-deep);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-20);
  position: relative; overflow: hidden;
}
.login-hero::before {
  content: '◈';
  position: absolute;
  font-size: 40vw; font-weight: 800;
  color: rgba(0,191,255,0.04);
  right: -10vw; top: 50%; transform: translateY(-50%);
  pointer-events: none; line-height: 1;
  font-family: var(--font-display);
}
.brand-hero { position: relative; z-index: 1; }
.brand-icon-xl { font-size: 80px; color: var(--free-accent); line-height: 1; margin-bottom: var(--s-6); }
.brand-hero h1 { color: var(--free-cream); margin-bottom: var(--s-4); }
.brand-hero .lede { color: rgba(232,246,251,0.65); margin-bottom: var(--s-6); }

.login-panel {
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  padding: var(--s-12) var(--s-10);
  display: flex; flex-direction: column; justify-content: center;
  overflow-y: auto;
}
.login-section-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: var(--text-xl);
  margin-bottom: var(--s-5);
}
.user-grid { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-6); }
.user-card {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border: 1.5px solid var(--border-solid);
  border-radius: var(--r-xl); cursor: pointer;
  background: var(--bg-elevated);
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}
.user-card:hover { border-color: var(--accent); background: var(--accent-hover); transform: translateY(-2px); }
.user-card-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: var(--free-deep);
  font-weight: 800; font-size: var(--text-xl);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: var(--font-display);
}
.user-card-name { font-weight: 700; font-size: var(--text-md); color: var(--text-primary); }
.user-card-sub { font-size: var(--text-sm); color: var(--text-muted); }
.user-card-meta { font-size: var(--text-xs); color: var(--accent); margin-top: 2px; }
.user-card-arrow { margin-left: auto; color: var(--text-muted); font-size: var(--text-lg); }
.user-card-info { flex: 1; min-width: 0; }
.divider-line {
  display: flex; align-items: center; gap: var(--s-4);
  color: var(--text-muted); font-size: var(--text-sm);
  margin: var(--s-5) 0;
}
.divider-line::before, .divider-line::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.new-user-form {
  margin-top: var(--s-6); padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--bg-elevated);
}
.new-user-form h3 { font-weight: 800; font-size: var(--text-xl); margin-bottom: var(--s-5); }
.empty-users { text-align: center; padding: var(--s-10) 0; color: var(--text-muted); }

/* ── View: Dashboard ── */
.view-dashboard { padding: var(--s-10) 0 var(--s-16); }
.dashboard-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--s-8); gap: var(--s-4);
}
.dashboard-header h1 { color: var(--text-primary); }
.dashboard-header p { color: var(--text-muted); margin-top: var(--s-2); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-10);
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  text-align: center;
}
.stat-card .stat-num {
  font-family: var(--font-display);
  font-weight: 800; font-size: var(--text-4xl);
  line-height: 0.9; letter-spacing: -0.04em;
  color: var(--accent);
}
.stat-card .stat-label { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--s-2); font-weight: 600; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-5);
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  cursor: pointer;
  transition: border-color var(--dur-fast), transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--s-4); gap: var(--s-3); }
.project-card-name { font-weight: 800; font-size: var(--text-lg); color: var(--text-primary); letter-spacing: -0.01em; }
.project-card-domain { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--s-1); }
.project-card-progress { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.progress-bar-wrap { flex: 1; height: 6px; background: var(--border-solid); border-radius: var(--r-pill); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width var(--dur-slow) var(--ease-out); }
.progress-pct { font-size: var(--text-xs); font-weight: 700; color: var(--accent); flex-shrink: 0; min-width: 32px; }
.project-card-footer { display: flex; justify-content: space-between; margin-top: var(--s-4); }

.project-card-new {
  background: var(--bg-card);
  border: 2px dashed var(--border-solid);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-3); min-height: 180px;
  color: var(--text-muted); font-weight: 600; font-size: var(--text-sm);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.project-card-new:hover { border-color: var(--accent); color: var(--accent); }
.new-card-icon { font-size: 40px; line-height: 1; }

.empty-state {
  text-align: center; padding: var(--s-24) var(--s-6);
  color: var(--text-muted);
}
.empty-icon { font-size: 56px; margin-bottom: var(--s-4); color: var(--accent); opacity: 0.4; }
.empty-state h3 { font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl); color: var(--text-primary); margin-bottom: var(--s-3); }
.empty-state p { margin-bottom: var(--s-6); }

/* ── View: Project ── */
.view-project { display: flex; flex-direction: column; min-height: calc(100vh - 64px); }
.project-shell { display: flex; flex: 1; }

.project-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: var(--s-6);
  position: sticky; top: 64px;
  align-self: flex-start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s-3);
  z-index: 50;
}
.sidebar-header {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--text-sm); color: var(--text-muted);
  font-weight: 600; padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
  transition: color var(--dur-fast);
}
.sidebar-header:hover { color: var(--accent); }
.back-arrow { font-size: var(--text-lg); }
.sidebar-project-name { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); color: var(--text-primary); letter-spacing: -0.02em; }
.sidebar-domain { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--s-2); }

.sidebar-nav { display: flex; flex-direction: column; gap: var(--s-1); margin: var(--s-3) 0; }
.sidebar-link {
  display: block; padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md); font-size: var(--text-sm);
  font-weight: 600; color: var(--text-secondary);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.sidebar-link:hover { background: var(--accent-hover); color: var(--text-primary); }
.sidebar-link-active { background: var(--accent-muted); color: var(--accent); }

.sidebar-principles { margin-top: var(--s-4); }
.sidebar-section-title { font-size: var(--text-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--s-3); }
.sidebar-principle { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) 0; }
.sp-name { font-size: var(--text-xs); color: var(--text-muted); width: 72px; flex-shrink: 0; }
.sp-bar { flex: 1; height: 4px; background: var(--border-solid); border-radius: var(--r-pill); overflow: hidden; }
.sp-fill { height: 100%; border-radius: var(--r-pill); transition: width var(--dur-slow) var(--ease-out); }
.sp-pct { font-size: var(--text-xs); color: var(--text-muted); width: 28px; text-align: right; }

.project-main { flex: 1; padding: var(--s-8) var(--s-10); min-width: 0; }

.tab-content { max-width: 900px; }
.tab-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-8); gap: var(--s-4); flex-wrap: wrap; }
.tab-title-row h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--text-3xl); letter-spacing: -0.025em; }
.title-actions { display: flex; gap: var(--s-3); }

/* Overview tab */
.overview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5); margin-bottom: var(--s-6); }
.overview-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--s-6);
}
.card-accent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.oc-title { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: var(--s-4); }
.oc-big-progress { display: flex; justify-content: center; padding: var(--s-4) 0; }
.oc-sub { text-align: center; font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--s-3); }
.bottleneck-value { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--accent); margin-bottom: var(--s-3); }
.goal-text { font-size: var(--text-md); color: var(--text-primary); line-height: 1.5; }

.section-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--s-6);
  margin-bottom: var(--s-5);
}
.sc-title { font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: var(--s-4); }
.sc-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-4); }
.sc-body { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.7; }

/* Frictie log */
.frictie-list { display: flex; flex-direction: column; gap: var(--s-3); }
.frictie-item {
  padding: var(--s-4); border-radius: var(--r-lg);
  background: var(--bg-elevated); border: 1px solid var(--border);
}
.frictie-item.resolved { opacity: 0.5; }
.fi-badges { display: flex; gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); }
.fi-principle { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); }
.fi-desc { font-size: var(--text-sm); color: var(--text-primary); margin-bottom: var(--s-2); }
.fi-actions { display: flex; justify-content: space-between; align-items: center; }
.empty-frictie { text-align: center; padding: var(--s-6); color: var(--text-muted); font-size: var(--text-sm); }
.add-frictie-form, .add-session-form { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--border); }

/* Sessions */
.sessions-list { display: flex; flex-direction: column; gap: var(--s-4); }
.session-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--s-6);
}
.session-header { display: flex; gap: var(--s-4); align-items: center; margin-bottom: var(--s-4); flex-wrap: wrap; }
.session-date { font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); }
.session-duration { font-size: var(--text-xs); background: var(--accent-muted); color: var(--accent); padding: 2px 8px; border-radius: var(--r-pill); font-weight: 600; }
.session-num { font-size: var(--text-xs); color: var(--text-muted); margin-left: auto; }
.session-notes { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; margin-bottom: var(--s-4); }
.session-achievements { display: flex; flex-direction: column; gap: var(--s-2); }
.achievement-item { font-size: var(--text-sm); color: var(--success); font-weight: 600; }
.add-session-form { background: var(--bg-elevated); border-radius: var(--r-xl); padding: var(--s-6); border: 1px solid var(--border); margin-bottom: var(--s-6); }
.add-session-form h3 { font-weight: 800; font-size: var(--text-xl); margin-bottom: var(--s-5); }

/* Progress tab */
.principles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.principle-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--s-6);
  cursor: pointer;
  transition: border-color var(--dur-fast), transform var(--dur-base) var(--ease-spring);
  display: flex; align-items: center; gap: var(--s-4);
}
.principle-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pc-ring { flex-shrink: 0; }
.pc-name { font-weight: 800; font-size: var(--text-md); color: var(--text-primary); letter-spacing: -0.01em; }
.pc-kernvraag { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--s-1); line-height: 1.5; }

/* Anki tab */
.anki-table-wrap { overflow-x: auto; border-radius: var(--r-xl); border: 1px solid var(--border); }
.anki-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.anki-table th, .anki-table td {
  padding: var(--s-3) var(--s-4);
  text-align: left; border-bottom: 1px solid var(--border);
}
.anki-table th { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--bg-elevated); }
.anki-table tr:last-child td { border-bottom: none; }
.anki-table tr:hover td { background: var(--accent-hover); }
.add-anki-form { background: var(--bg-elevated); border-radius: var(--r-xl); padding: var(--s-6); border: 1px solid var(--border); margin-bottom: var(--s-6); }
.add-anki-form h3 { font-weight: 800; font-size: var(--text-xl); margin-bottom: var(--s-5); }

/* Project settings */
.settings-section { margin-bottom: var(--s-8); padding-bottom: var(--s-8); border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: none; }
.settings-section-title { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); margin-bottom: var(--s-5); }
.danger-zone { border: 1px solid var(--danger-muted); border-radius: var(--r-xl); padding: var(--s-6); }
.danger-title { color: var(--danger); }
.bfp-defaults-row { display: flex; gap: var(--s-4); }
.bfp-default-item { flex: 1; }

/* ── View: Global Progress ── */
.view-progress { padding: var(--s-10) 0 var(--s-16); }
.view-progress h1 { margin-bottom: var(--s-2); }
.view-progress .lede { margin-bottom: var(--s-10); }
.progress-project-block { margin-bottom: var(--s-10); }
.ppb-header { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); }
.ppb-header h3 { font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl); }
.principles-grid-compact { display: grid; grid-template-columns: repeat(9, 1fr); gap: var(--s-3); }
.ppc-item { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); }
.ppc-name { font-size: var(--text-xs); color: var(--text-muted); text-align: center; font-weight: 600; }

/* ── View: Settings ── */
.view-settings { padding: var(--s-10) 0 var(--s-16); }
.view-settings h1 { margin-bottom: var(--s-8); }

.settings-tabs {
  display: flex; gap: var(--s-2);
  margin-bottom: var(--s-8);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--s-2);
  flex-wrap: wrap;
}
.settings-tab {
  padding: var(--s-2) var(--s-5);
  border-radius: var(--r-pill);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.settings-tab:hover { color: var(--text-primary); background: var(--bg-elevated); }
.settings-tab.active { color: var(--accent); background: var(--accent-muted); }

.settings-panel { display: none; }
.settings-panel.active { display: block; }

.option-row { display: flex; gap: var(--s-4); margin-bottom: var(--s-4); }
.option-card {
  flex: 1; border: 2px solid var(--border-solid);
  border-radius: var(--r-xl); padding: var(--s-5);
  cursor: pointer; text-align: center;
  transition: border-color var(--dur-fast);
  font-weight: 600; font-size: var(--text-sm);
  color: var(--text-secondary);
}
.option-card:hover { border-color: var(--accent); }
.option-card.option-active { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); }
.option-preview {
  height: 64px; border-radius: var(--r-md); margin-bottom: var(--s-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl);
}
.dark-preview { background: #0A0F12; color: #00BFFF; }
.light-preview { background: #F0F2F4; color: #0080FF; }

.user-list-compact { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-4); }
.ulc-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--bg-elevated);
}
.ulc-item.ulc-active { border-color: var(--accent); }
.ulc-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--free-deep);
  font-weight: 800; font-size: var(--text-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: var(--font-display);
}
.ulc-name { font-weight: 700; font-size: var(--text-sm); }
.ulc-info { flex: 1; min-width: 0; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }

/* ── Sidebar principle fill color (missing in original) ── */
.sp-fill { background: var(--accent); }

/* ── Meta-leersessie tab ── */
.meta-progress-track {
  height: 6px;
  background: var(--border-solid);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: var(--s-3);
}
.meta-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width var(--dur-slow) var(--ease-out);
}
.meta-progress-label {
  display: flex; align-items: center; gap: var(--s-4);
  font-size: var(--text-sm); color: var(--text-muted);
  margin-bottom: var(--s-6);
}
.meta-complete-badge {
  background: var(--success-muted, rgba(0,200,100,0.12));
  color: var(--success);
  padding: 2px 10px; border-radius: var(--r-pill);
  font-size: var(--text-xs); font-weight: 700;
}

.meta-q-pills {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-bottom: var(--s-6);
}
.meta-q-pill {
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: var(--text-xs); font-weight: 700;
  border: 2px solid var(--border-solid);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.meta-q-pill:hover { border-color: var(--accent); color: var(--accent); }
.meta-q-pill.answered { background: var(--accent-muted); border-color: var(--accent); color: var(--accent); }
.meta-q-pill.current { background: var(--accent); border-color: var(--accent); color: var(--free-deep); }

.meta-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--s-8);
  margin-bottom: var(--s-6);
}
.meta-q-meta {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.meta-q-num {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.meta-q-principle {
  font-size: var(--text-xs); color: var(--text-muted);
  border: 1px solid var(--border-solid);
  padding: 2px 8px; border-radius: var(--r-pill);
}
.meta-q-text {
  font-family: var(--font-display);
  font-weight: 800; font-size: var(--text-2xl);
  letter-spacing: -0.02em; color: var(--text-primary);
  margin-bottom: var(--s-4); line-height: 1.3;
}
.meta-q-hint {
  display: flex; gap: var(--s-3); align-items: flex-start;
  background: var(--accent-muted);
  border-radius: var(--r-lg);
  padding: var(--s-4); margin-bottom: var(--s-5);
  font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6;
}
.meta-hint-icon { flex-shrink: 0; font-size: 16px; }
.meta-q-textarea { min-height: 140px; font-size: var(--text-md); margin-bottom: var(--s-5); }
.meta-q-nav {
  display: flex; justify-content: space-between; align-items: center;
}

.meta-complete-section {
  display: flex; align-items: center; gap: var(--s-6);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--r-2xl);
  padding: var(--s-7);
  margin-top: var(--s-4);
}
.meta-complete-icon {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 50%; background: var(--accent);
  color: var(--free-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
}
.meta-complete-body h3 {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--text-xl); margin-bottom: var(--s-1);
}
.meta-complete-body { flex: 1; }

/* ── Bronnen tab ── */
.add-resource-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  margin-bottom: var(--s-6);
}
.add-resource-form h3 { font-weight: 800; font-size: var(--text-xl); margin-bottom: var(--s-5); }

.resources-list { display: flex; flex-direction: column; gap: var(--s-4); }
.resource-card {
  display: flex; align-items: flex-start; gap: var(--s-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-5);
  transition: border-color var(--dur-fast);
}
.resource-card:hover { border-color: var(--accent); }
.rc-icon { font-size: 28px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.rc-info { flex: 1; min-width: 0; }
.rc-name { font-weight: 700; font-size: var(--text-md); color: var(--text-primary); margin-bottom: var(--s-2); word-break: break-word; }
.rc-meta { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-2); }
.rc-link {
  display: inline-block; font-size: var(--text-xs); color: var(--accent);
  word-break: break-all; margin-top: var(--s-1);
}
.rc-link:hover { text-decoration: underline; }
.rc-preview {
  font-size: var(--text-sm); color: var(--text-muted); line-height: 1.6;
  margin-top: var(--s-2);
  white-space: pre-wrap; overflow: hidden;
  max-height: 80px;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* ── AI Response Component ── */
.meta-ai-wrap {
  display: none;
  margin: var(--s-4) 0 var(--s-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--accent);
  border-opacity: 0.3;
}
.meta-ai-wrap.visible { display: block; }
.meta-ai-label {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em;
  padding: var(--s-2) var(--s-4);
  background: var(--accent-muted);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.meta-ai-text {
  font-size: var(--text-sm); line-height: 1.75; color: var(--text-secondary);
  padding: var(--s-4);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-surface));
}
.meta-ai-loading {
  text-align: center; font-size: 22px; color: var(--accent);
  padding: var(--s-5);
  animation: ai-pulse 1.2s ease-in-out infinite;
}
.meta-ai-error {
  font-size: var(--text-sm); color: #ef4444;
  padding: var(--s-4);
  background: rgba(239,68,68,0.08);
}
@keyframes ai-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .view-login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { padding: var(--s-8) var(--s-6); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .principles-grid { grid-template-columns: repeat(2, 1fr); }
  .principles-grid-compact { grid-template-columns: repeat(3, 1fr); }
  .project-sidebar { display: none; }
  .project-main { padding: var(--s-6); margin-left: 0; }
  .footer-bar { flex-direction: column; align-items: flex-start; }
  .footer-tagline { display: none; }
  .meta-complete-section { flex-direction: column; text-align: center; }
  .meta-q-pills { gap: var(--s-1); }
}

/* ── Brand name full ── */
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

/* ── Meta analysis status ── */
.meta-analysis-status {
  display: none;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--accent-muted);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: var(--s-4);
  border: 1px solid var(--accent)30;
}
.meta-analysis-status.visible { display: block; }

/* ── Principle checklist ── */
.principle-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-2);
}
.pr-check {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border-solid);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
  user-select: none;
}
.pr-check:hover { border-color: var(--accent); color: var(--accent); }
.pr-check input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }
.pr-check:has(input:checked) { background: var(--accent-muted); border-color: var(--accent); color: var(--accent); }

/* ── Quality rating ── */
.qual-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
}
.qual-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--border-solid);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--dur-fast), transform var(--dur-fast);
}
.qual-btn:hover, .qual-btn.qual-active { color: var(--accent); }
.qual-btn:hover { transform: scale(1.15); }
.qual-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: var(--s-2);
}

/* ── Documentation Page ── */
.docs-page { max-width: 800px; padding-bottom: var(--s-20); }
.docs-toc {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-6);
  margin-bottom: var(--s-10);
}
.docs-toc strong {
  display: block;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--s-3);
}
.docs-toc ol { margin: 0; padding-left: var(--s-5); }
.docs-toc li { margin-bottom: var(--s-1); }
.docs-toc a { color: var(--accent); text-decoration: none; font-size: var(--text-sm); }
.docs-toc a:hover { text-decoration: underline; }
.docs-section { margin-bottom: var(--s-12); scroll-margin-top: 80px; }
.docs-section h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}
.docs-section h3 {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-secondary);
  margin: var(--s-5) 0 var(--s-2);
}
.docs-section p { line-height: 1.75; color: var(--text-secondary); margin-bottom: var(--s-3); }
.docs-section ul, .docs-section ol { padding-left: var(--s-5); margin-bottom: var(--s-3); }
.docs-section li { line-height: 1.75; color: var(--text-secondary); margin-bottom: var(--s-1); }
.docs-tip {
  background: var(--accent-muted);
  border: 1px solid rgba(0,191,255,0.20);
  border-radius: var(--r-sm);
  padding: var(--s-4);
  margin: var(--s-4) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}
.docs-faq { display: flex; flex-direction: column; gap: var(--s-3); }
.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--s-4);
}
.faq-q { font-weight: 600; color: var(--text-primary); margin-bottom: var(--s-2); font-size: var(--text-sm); }
.faq-a { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.65; }
.docs-section code {
  background: var(--bg-elevated);
  border-radius: var(--r-xs);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
}

/* ── Pomodoro Timer ── */
.pomo-fab {
  position: fixed;
  bottom: var(--s-6);
  right: var(--s-6);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-solid);
  border-radius: var(--r-pill);
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  transition: border-color 0.18s, color 0.18s, transform 0.18s, background 0.18s;
  font-size: var(--text-sm);
}
.pomo-fab:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.pomo-fab.pomo-running {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
  box-shadow: 0 4px 20px rgba(0,191,255,0.15);
}
.pomo-fab-icon { font-size: 18px; line-height: 1; }
.pomo-fab-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  min-width: 42px;
  text-align: center;
}

.pomo-panel {
  position: fixed;
  bottom: calc(var(--s-6) + 52px);
  right: var(--s-6);
  width: 272px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-solid);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 901;
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.20s ease, transform 0.20s ease;
}
.pomo-panel.pomo-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.pomo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pomo-title { font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); }

.pomo-phase-label {
  font-size: var(--text-xs);
  text-align: center;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  min-height: 16px;
}
.pomo-phase-label.pomo-phase-work       { color: var(--accent); }
.pomo-phase-label.pomo-phase-break      { color: var(--free-accent-soft); }
.pomo-phase-label.pomo-phase-long-break { color: var(--core-accent); }

.pomo-time-display {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.pomo-cup-wrap { display: flex; justify-content: center; padding: var(--s-1) 0; }
.pomo-svg { width: 110px; height: auto; overflow: visible; }

/* Steam */
.pomo-steam-1, .pomo-steam-2, .pomo-steam-3 {
  animation: pomo-steam-rise 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}
.pomo-steam-2 { animation-delay: 0.9s; }
.pomo-steam-3 { animation-delay: 1.8s; }
@keyframes pomo-steam-rise {
  0%    { opacity: 0;   transform: translateY(0)    scaleX(1);    }
  25%   { opacity: 0.75; }
  80%   { opacity: 0.2; }
  100%  { opacity: 0;   transform: translateY(-9px) scaleX(1.12); }
}

/* Wave */
.pomo-wave { animation: pomo-wave-float 2.6s ease-in-out infinite; }
@keyframes pomo-wave-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-1.5px); }
}

/* Cycle dots */
.pomo-cycles-row { display: flex; justify-content: center; gap: var(--s-3); }
.pomo-cycle-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border-solid);
  background: transparent;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.pomo-cycle-dot.pomo-dot-done {
  background: var(--accent);
  border-color: var(--accent);
}
.pomo-cycle-dot.pomo-dot-active {
  border-color: var(--accent);
  animation: pomo-dot-pulse 1.4s ease-in-out infinite;
}
@keyframes pomo-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0   var(--accent-muted); }
  50%       { box-shadow: 0 0 0 5px var(--accent-muted); }
}

/* Controls */
.pomo-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
}
.pomo-main-btn { min-width: 108px; }
.pomo-ctrl-btn { font-size: 15px; }

.pomo-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Flashcards ──────────────────────────────────────────────── */

/* Viewer overlay */
.fc-viewer {
  position: fixed; inset: 0; z-index: 500;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.fc-viewer.fc-open { display: flex; }

.fc-viewer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88);
}

.fc-viewer-container {
  position: relative; z-index: 1;
  width: min(600px, 100%);
  display: flex; flex-direction: column; gap: 16px;
}

.fc-viewer-header {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.fc-viewer-counter { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-secondary); }
.fc-viewer-hint    { font-size: 11px; color: var(--text-muted); flex: 1; }
.fc-viewer-close   { margin-left: auto; }

/* 3D flip card */
.fc-card-wrap { perspective: 1200px; }

.fc-card {
  width: 100%; min-height: 280px;
  cursor: pointer; position: relative;
}

.fc-card-inner {
  position: relative; width: 100%; min-height: 280px;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(.4,0,.2,1);
  border-radius: var(--r-lg);
}

.fc-card.fc-flipped .fc-card-inner { transform: rotateY(180deg); }

.fc-front, .fc-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 28px 32px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; text-align: center;
}

.fc-back {
  transform: rotateY(180deg);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.fc-card-text {
  font-size: 1.1rem; font-weight: 500; line-height: 1.55;
  white-space: pre-wrap; max-width: 100%;
}

.fc-card-img {
  max-height: 150px; max-width: 100%;
  border-radius: 8px; object-fit: contain;
}

.fc-card-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); margin-top: auto;
}

.fc-card-meta { display: flex; gap: 8px; align-items: center; }

.fc-viewer-nav {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}

/* Flashcard grid (thumbnail view) */
.fc-controls {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}

.fc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.fc-card-thumb {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 90px;
}
.fc-card-thumb:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.fc-thumb-img {
  max-height: 70px; object-fit: contain; border-radius: 4px;
}

.fc-thumb-front {
  font-size: 0.85rem; font-weight: 500;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-height: 1.4;
}

.fc-thumb-meta {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: auto;
}

/* Forms */
.add-fc-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 20px;
}

.fc-form-sides {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 640px) { .fc-form-sides { grid-template-columns: 1fr; } }

.fc-form-side h4 {
  margin: 0 0 8px; font-size: 0.82rem;
  font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em;
}

.fc-img-upload {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; flex-wrap: wrap;
}

.fc-img-preview { display: flex; align-items: center; gap: 6px; }
.fc-img-preview img { max-height: 60px; border-radius: 4px; }

.btn-xs {
  padding: 3px 10px; font-size: 12px;
  border-radius: var(--r-pill); border: 1px solid var(--border);
  background: none; cursor: pointer; color: var(--text-secondary);
}
.btn-xs:hover { border-color: var(--accent); color: var(--accent); }

/* AI status + preview */
.fc-ai-status {
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 8px 0;
}

.fc-ai-preview {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  max-height: 320px; overflow-y: auto;
}

.fc-preview-list { display: flex; flex-direction: column; gap: 8px; }

.fc-preview-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; background: var(--bg-card);
  border-radius: var(--r-sm); cursor: pointer;
  transition: background .1s;
}
.fc-preview-item:hover { background: var(--bg-hover); }
.fc-preview-item input { margin-top: 3px; flex-shrink: 0; accent-color: var(--accent); }
.fc-preview-item strong { font-size: 0.875rem; }

.fc-preview-item-ro {
  padding: 8px 10px; background: var(--bg-card); border-radius: var(--r-sm);
}
.fc-preview-item-ro strong { font-size: 0.875rem; }

/* Import tabs */
.fc-import-tabs {
  display: flex; gap: 4px; margin-bottom: 14px;
}

.fc-itab {
  padding: 5px 14px; border: 1px solid var(--border);
  background: none; border-radius: var(--r-pill);
  color: var(--text-secondary); font-size: 0.8rem; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.fc-itab.active {
  background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600;
}
.fc-itab:not(.active):hover { border-color: var(--accent); color: var(--accent); }

/* ── Coach tab ─────────────────────────────────────────────── */
.coach-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.coach-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.coach-notice {
  background: var(--accent-muted, rgba(0,200,200,.08));
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: .9rem;
}
.coach-result {
  margin-top: 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  font-size: .9rem;
  line-height: 1.6;
}
.coach-result.hidden { display: none; }
.coach-ai-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 16px;
  background: var(--accent-muted);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.coach-ai-text {
  line-height: 1.75;
  color: var(--text-secondary);
  padding: 16px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-surface));
}

/* Meta-sessie done state in sidebar */
.sidebar-link-done {
  opacity: 0.55;
}
.sidebar-link-done:not(.sidebar-link-active) {
  color: var(--success, #4caf50) !important;
}

/* ── Flashcard practice verbeteringen ──────────────────────── */
.fc-stack-badge {
  display: inline-block;
  font-size: .65rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  margin-top: 4px;
}
.fc-stack-header {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.fc-stack-collapsible {
  cursor: pointer;
  user-select: none;
}
.fc-stack-collapsible:hover { color: var(--text-primary); }
.fc-stack-chevron { display: inline-block; width: 1em; font-style: normal; }
.fc-grid-collapsed { display: none; }
.fc-stack-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 12px 0;
}
.fc-stack-checkboxes label {
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fc-card-stack-label {
  font-size: .7rem;
  color: var(--accent);
  opacity: .7;
  margin-top: 6px;
}
.fc-box-label {
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: .05em;
}
.fc-stat-correct { color: #4caf50; font-weight: 600; }
.fc-stat-incorrect { color: #ef4444; font-weight: 600; }

/* Practice done screen */
.fc-practice-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  text-align: center;
  gap: 16px;
}
.fc-done-icon { font-size: 64px; }
.fc-done-stats {
  display: flex;
  gap: 24px;
  margin: 8px 0;
  flex-wrap: wrap;
  justify-content: center;
}
.fc-done-stat {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
}
.fc-done-stat.correct { color: #4caf50; border-color: #4caf5040; }
.fc-done-stat.incorrect { color: #ef4444; border-color: #ef444440; }

/* Correct/incorrect buttons */
.btn-success {
  background: #4caf50; color: #fff; border: none;
  padding: var(--s-2) var(--s-5);
  border-radius: var(--r-md);
  font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.btn-success:hover { opacity: .85; }
kbd {
  font-size: .7rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono, monospace);
}

/* ── Template management ─────────────────────────────────── */
.fc-tpl-list { display:flex; flex-direction:column; gap:8px; margin:8px 0 12px; }
.fc-tpl-item { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:10px 12px; background:var(--bg-secondary,#17171c); border-radius:var(--r-md); border:1px solid var(--border); }
.fc-tpl-info { flex:1; min-width:0; }
.fc-tpl-info strong { display:block; font-size:var(--text-sm,.875rem); margin-bottom:3px; }
.fc-tpl-actions { display:flex; gap:4px; flex-shrink:0; align-items:center; }

/* ── Compression warning banner ──────────────────────────── */
.fc-compress-banner { display:flex; align-items:center; gap:12px; flex-wrap:wrap; background:rgba(247,160,74,.1); border:1px solid rgba(247,160,74,.35); border-radius:var(--r-md); padding:10px 14px; margin-bottom:12px; font-size:var(--text-sm,.875rem); color:var(--text-primary); }

/* ── Stack-change dropdown op kaart-thumbnail ────────────── */
.fc-stack-select {
  font-size: 11px;
  background: var(--bg-elevated, #1e1e26);
  color: var(--text-secondary, #9090a8);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--r-sm, 6px);
  padding: 2px 4px;
  cursor: pointer;
  max-width: 110px;
  flex-shrink: 1;
  min-width: 0;
}
.fc-stack-select:hover { border-color: var(--accent, #7c6aff); color: var(--text-primary); }
.fc-stack-select:focus { outline: none; border-color: var(--accent, #7c6aff); }

/* ── Category management panel ───────────────────────────── */
.fc-cat-list { display:flex; flex-direction:column; gap:6px; margin:8px 0 4px; }
.fc-cat-item { display:flex; align-items:center; gap:8px; padding:8px 12px; background:var(--bg-secondary,#17171c); border-radius:var(--r-md); border:1px solid var(--border); }
.fc-cat-name { font-size:var(--text-sm,.875rem); font-weight:500; flex:1; }

/* ── Principe button-groep in sessieform ─────────────────── */
.pr-btn-group { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.pr-btn {
  padding: 6px 14px;
  border-radius: var(--r-full, 999px);
  border: 1px solid var(--border);
  background: var(--bg-secondary, #17171c);
  color: var(--text-secondary);
  font-size: var(--text-sm, .875rem);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.pr-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.pr-btn.active {
  background: var(--accent-muted, rgba(124,106,255,.15));
  border-color: var(--accent, #7c6aff);
  color: var(--accent, #7c6aff);
  font-weight: 600;
}

/* ── Principe badges in sessielijst ──────────────────────── */
.session-principles { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 4px; }
.session-pr-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-full, 999px);
  background: var(--accent-muted, rgba(124,106,255,.12));
  color: var(--accent, #7c6aff);
  border: 1px solid rgba(124,106,255,.25);
}

/* ── Drag-and-drop dropzone ──────────────────────────────── */
.fc-drop-zone {
  border: 1px dashed var(--border, rgba(255,255,255,0.1));
  border-radius: var(--r-md, 8px);
  padding: 6px 8px;
  transition: border-color .15s, background .15s;
  min-height: 36px;
}
.fc-drop-zone.dragover {
  border-color: var(--accent, #7c6aff);
  background: rgba(124,106,255,.07);
}

/* ── Quiz antwoorden ─────────────────────────────────────── */
.quiz-actions { display:flex; align-items:center; gap:16px; margin:10px 0 4px; flex-wrap:wrap; }
.quiz-answers { margin-top:12px; border-top:1px solid var(--border); padding-top:12px; }
.quiz-answers-label { font-size:var(--text-xs); font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); margin-bottom:8px; }

/* ── Auth scherm (login / magic link) ────────────────────── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: var(--s-6);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  border-radius: var(--r-xl, 16px);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 12px;
  line-height: 1;
}
.auth-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: 28px;
}
.auth-msg {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 12px;
  min-height: 20px;
}
.auth-sent { padding: 16px 0; }
