@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #0C0C12;
  --sb: #13131A;
  --card: #1A1A24;
  --card2: #20202C;
  --bg4: #2A2A38;
  --bdr: #2A2A38;
  
  --gold: #C4A35A;
  --goldl: #DFC07A;
  --goldd: rgba(196,163,90,0.15);
  
  --text: #E4E1D8;
  --text2: #8A889A;
  --text3: #4A4860;
  --dim: #8A889A;
  --faint: #3A3850;
  
  --grn: #4A9D6E;
  --grnd: rgba(74,157,110,0.12);
  --red: #C45A5A;
  --redd: rgba(196,90,90,0.12);
  --blu: #5A7EC4;
  --blud: rgba(90,126,196,0.12);
  --amb: #C4883A;
  --ambd: rgba(196,136,58,0.12);
  --pur: #8A5AC4;
  --purd: rgba(138,90,196,0.08);

  --radius: 12px;
  --radius-sm: 8px;
  --r: 8px;
  --sw: 272px;
  --sidebar-hover-zone: 34px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --tr: 0.18s ease;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

body.has-header {
  padding-top: 48px;
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--bdr);
  border-radius: 3px;
}
::selection {
  background: rgba(196, 163, 90, 0.25);
}

/* APP HEADER */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--sb);
  border-bottom: 1px solid var(--bdr);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  transition: transform var(--transition);
}

.ah-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--goldl);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ah-spacer {
  flex: 1;
}

.ah-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text2);
  margin-left: 20px;
  font-family: 'DM Mono', monospace;
}

.ah-val {
  font-weight: 700;
  color: var(--text);
}

.ah-countdown {
  background: var(--redd);
  border: 1px solid rgba(196, 90, 90, 0.2);
  padding: 2px 10px;
  border-radius: 20px;
  color: var(--red);
  font-weight: 600;
}

.ah-countdown.safe {
  background: var(--goldd);
  border-color: rgba(196, 163, 90, 0.2);
  color: var(--goldl);
}

.ah-bocconi {
  background: var(--goldd);
  border: 1px solid rgba(196, 163, 90, 0.25);
  color: var(--goldl);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.ah-focus-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--bdr);
  color: var(--text2);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 20px;
  transition: all var(--tr);
}
.ah-focus-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--goldd);
}

/* SIDEBAR — masquée par défaut, se déplie au survol du hotspot ou de la barre */
.sidebar {
  position: fixed;
  left: 0;
  top: 48px;
  bottom: 0;
  width: var(--sw);
  background: var(--sb);
  border-right: 1px solid var(--bdr);
  z-index: 500;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(-1 * var(--sw) - 2px));
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s ease;
  will-change: transform;
}
body.sidebar-visible .sidebar,
.sidebar.open,
.sidebar:focus-within {
  transform: translateX(0) !important;
  box-shadow: 18px 0 36px rgba(0,0,0,0.42);
}
/* Hotspot : bande invisible sur le bord gauche qui déclenche l'ouverture */
.sidebar-hotspot {
  position: fixed;
  left: 0;
  top: 48px;
  bottom: 0;
  width: var(--sidebar-hover-zone);
  z-index: 90;
  pointer-events: auto;
}
/* Indicateur visuel discret pour découvrir le hotspot */
.sidebar-hotspot::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  opacity: 0.35;
  transition: opacity 0.25s, width 0.25s;
  pointer-events: none;
}
.sidebar-hotspot:hover::before { opacity: 1; width: 5px; }
body.sidebar-visible .sidebar-hotspot::before { opacity: 0; }

.sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--bdr);
}

.sidebar-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.sidebar-header p {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-top: 4px;
}

.sb-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bdr);
}

.sb-search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: 7px 10px 7px 32px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color var(--tr);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%238A889A' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 9px center;
}

.sb-search input:focus {
  border-color: var(--gold);
}

.nav-section {
  padding: 8px 0;
}

.nav-section-title {
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  padding: 14px 18px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 8px 18px 8px 30px;
  color: var(--dim);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: all var(--tr);
  cursor: pointer;
  position: relative;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}

.nav-link::before {
  content: '—';
  position: absolute;
  left: 15px;
  color: var(--faint);
  font-size: 10px;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--goldd);
}

.nav-link.h {
  padding-left: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-left: none;
  background: none;
}

.nav-link.h::before {
  display: none;
}

.nav-link.h:hover {
  color: var(--gold);
  background: none;
  border-left: none;
}

.nav-link.ex {
  color: var(--amb);
}

.nav-link.ex:hover, .nav-link.ex.active {
  color: var(--amb);
  border-left-color: var(--amb);
  background: var(--ambd);
}

.progress-container {
  padding: 16px 20px;
  border-top: 1px solid var(--bdr);
  margin-top: auto;
}

.progress-label {
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.progress-bar {
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grn), var(--goldl));
  border-radius: 3px;
  transition: width var(--transition);
}

.progress-text {
  font-size: 11px;
  color: var(--dim);
  margin-top: 6px;
}

/* MAIN CONTENT — sidebar en overlay, contenu centré */
.main {
  margin: 0 auto;
  flex: 1;
  max-width: 1100px;
  padding: 40px 48px 80px;
  transition: max-width 0.25s ease, padding 0.25s ease;
}

.section,
section.ps {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.section.active,
section.ps.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--dim);
  font-size: 14px;
  margin-bottom: 0;
}

.div {
  width: 36px;
  height: 2px;
  background: var(--gold);
  margin: 14px 0 28px;
}

/* CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  transition: all var(--tr);
}

.card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(196, 163, 90, 0.06);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
}

.card-icon {
  font-size: 22px;
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.card-toggle {
  color: var(--dim);
  font-size: 14px;
  transition: transform var(--tr);
}

.card.collapsed .card-body {
  display: none;
}

.card.collapsed .card-toggle {
  transform: rotate(-90deg);
}

/* HERO BANNER */
.hero-banner {
  background: linear-gradient(135deg, rgba(196, 163, 90, 0.1), rgba(90, 126, 196, 0.05));
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.hero-banner h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.hero-banner p {
  color: var(--dim);
  font-size: 14px;
}

.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stat {
  background: rgba(12, 12, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
  min-width: 90px;
}

.hs-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--goldl);
  font-family: 'DM Mono', monospace;
}

.hs-label {
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* BOCCONI CIBLE */
.bocconi-target {
  background: linear-gradient(90deg, var(--goldd), transparent);
  border: 1px solid rgba(196, 163, 90, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.bt-icon {
  font-size: 24px;
}

.bt-content {
  flex: 1;
  min-width: 200px;
}

.bt-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--goldl);
}

.bt-sub {
  font-size: 12px;
  color: var(--dim);
  margin-top: 2px;
}

.bt-bar {
  flex: 2;
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
  min-width: 150px;
}

.bt-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--goldl));
  border-radius: 3px;
  transition: width 1s ease-out;
}

.bt-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--goldl);
  font-family: 'DM Mono', monospace;
}

/* AUTOPILOT */
.autopilot-card {
  background: linear-gradient(135deg, var(--card), var(--card2));
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(196, 163, 90, 0.05);
}

.ac-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
}

.ac-suggestion {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 10px 0 6px;
}

.ac-reason {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5;
  margin-bottom: 18px;
}

.ac-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ac-btn {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: opacity var(--tr);
}

.ac-btn:hover {
  opacity: 0.85;
}

.ac-btn-secondary {
  background: var(--bg4);
  color: var(--text);
  border: 1px solid var(--bdr);
}

.ac-btn-secondary:hover {
  border-color: var(--gold);
}

/* WEEKLY STATS */
.weekly-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.weekly-stat-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.wsc-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-family: 'DM Mono', monospace;
}

.wsc-label {
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* COMMIT CHART */
.commit-chart-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.cc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
}

.cc-title {
  font-weight: 600;
  color: var(--text);
}

.cc-stats {
  color: var(--dim);
  font-family: 'DM Mono', monospace;
}

.commit-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.commit-day-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: var(--faint);
  padding: 4px 0;
  min-width: 14px;
}

.commit-grid {
  display: grid;
  grid-template-flow: column;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 10px);
  gap: 3px;
}

.commit-cell {
  width: 10px;
  height: 10px;
  background: var(--bg);
  border-radius: 2px;
  cursor: pointer;
}

.commit-cell.l1 { background: rgba(74, 157, 110, 0.25); }
.commit-cell.l2 { background: rgba(74, 157, 110, 0.5); }
.commit-cell.l3 { background: rgba(74, 157, 110, 0.75); }
.commit-cell.l4 { background: #4A9D6E; }

.commit-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10px;
  color: var(--faint);
  margin-top: 10px;
}

.commit-legend .commit-cell {
  cursor: default;
}

/* HOME ACTION GRID */
.home-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.home-action-grid .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 140px;
  cursor: pointer;
  padding: 20px;
}

.home-action-grid .card > div:first-child {
  font-size: 26px;
  margin-bottom: 8px;
}

.home-action-grid .card > div:nth-child(2) {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

.home-action-grid .card > div:nth-child(3) {
  font-size: 12px;
  color: var(--dim);
}

/* 17-DAY CALENDAR */
.cal-control {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.cal-control input[type="date"] {
  background: var(--bg);
  border: 1px solid var(--bdr);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  font-size: 13px;
}

.cal-countdown {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  font-family: 'DM Mono', monospace;
  background: var(--redd);
  padding: 4px 12px;
  border-radius: 20px;
}

.cal-sync-info {
  background: var(--grnd);
  border-left: 3px solid var(--grn);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-progress-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.cal-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: hidden;
}

.cal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grn), var(--gold));
  border-radius: 4px;
  transition: width 0.3s;
}

.cal-stats {
  font-size: 13px;
  font-weight: 700;
  color: var(--goldl);
  font-family: 'DM Mono', monospace;
}

.cal-week-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--goldl);
  margin: 28px 0 14px;
  border-bottom: 1px solid var(--bdr);
  padding-bottom: 6px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.cal-day {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all var(--tr);
  position: relative;
}

.cal-day:hover {
  border-color: var(--gold);
}

.cal-day.completed {
  border-color: var(--grn);
  background: linear-gradient(135deg, var(--card), var(--grnd));
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.day-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  background: var(--goldd);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
}

.cal-day.completed .day-num {
  color: var(--grn);
  background: var(--grnd);
}

.day-date {
  font-size: 11px;
  color: var(--faint);
  font-family: 'DM Mono', monospace;
}

.day-status {
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}

.day-theme {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.day-tasks {
  padding-left: 16px;
  margin-bottom: 14px;
  flex: 1;
}

.day-tasks li {
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 4px;
}

.day-duration {
  font-size: 11px;
  color: var(--faint);
  font-family: 'DM Mono', monospace;
  margin-top: auto;
}

.day-link {
  font-size: 11px;
  color: var(--goldl);
  cursor: pointer;
  text-decoration: underline;
  margin-top: 8px;
  display: inline-block;
  align-self: flex-start;
}

/* PATH TO 20/20 */
.p2020-hero {
  background: linear-gradient(135deg, rgba(196, 163, 90, 0.1), rgba(138, 90, 196, 0.05));
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.p2020-hero h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

.p2020-message {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.p2020-message .badge {
  background: var(--goldd);
  color: var(--goldl);
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.p2020-message .text {
  font-size: 13.5px;
  color: var(--dim);
}

.p2020-grade-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.p2020-grade-bar .label {
  font-size: 12px;
  color: var(--dim);
}

.p2020-grade-bar .bar {
  flex: 1;
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: visible;
  position: relative;
  min-width: 150px;
}

.p2020-grade-bar .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--grn));
  border-radius: 3px;
}

.p2020-grade-bar .bar-marker {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--goldl);
  border: 2px solid var(--bg);
  transform: translateX(-50%);
}

.p2020-grade-bar .grade {
  font-size: 15px;
  font-weight: 700;
  color: var(--goldl);
  font-family: 'DM Mono', monospace;
}

table.p2020-coverage {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 14px 0;
}

table.p2020-coverage th, table.p2020-coverage td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bdr);
  text-align: left;
}

table.p2020-coverage th {
  color: var(--goldl);
  font-weight: 600;
  background: var(--card2);
}

table.p2020-coverage td.ch {
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  color: var(--gold);
}

table.p2020-coverage td.v-rich { color: var(--grn); font-weight: 600; }
table.p2020-coverage td.v-mid { color: var(--amb); font-weight: 600; }
table.p2020-coverage td.v-thin { color: var(--red); font-weight: 600; }

/* L'ESSENTIEL EN 30S */
.essentiel {
  background: linear-gradient(135deg, rgba(196, 163, 90, 0.12), rgba(196, 163, 90, 0.04));
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 0 24px;
  position: relative;
}

.essentiel::before {
  content: '⚡ L\'ESSENTIEL EN 30 SECONDES';
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--gold);
  color: var(--bg);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 2px 10px;
  border-radius: 4px;
}

.essentiel ul {
  padding-left: 18px;
  margin: 8px 0 0;
}

.essentiel ul li {
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.5;
}

.essentiel ul li strong {
  color: var(--goldl);
}

/* MINI-QUIZ INTEGRATED */
.mini-quiz {
  background: linear-gradient(135deg, var(--card2), var(--card));
  border: 1px solid var(--bdr);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.mini-quiz-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.mini-quiz-icon {
  font-size: 16px;
}

.mini-quiz-label {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.mini-quiz-question {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
  font-weight: 500;
}

.mini-quiz-answer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bdr);
}

.mini-quiz-reveal {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5;
  margin-bottom: 8px;
  font-style: italic;
}

.mini-quiz-btn {
  background: var(--grn);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
}

.mini-quiz-btn:hover {
  background: var(--grn);
  transform: translateY(-1px);
}

.mini-quiz-reveal-btn {
  background: var(--blu);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
}

.mini-quiz-reveal-btn:hover {
  background: #4a6bb3;
  transform: translateY(-1px);
}

/* BOXES */
.box {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 12px 0;
  border-left: 3px solid;
}

.box .bl {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}

.bf { background: var(--grnd); border-color: var(--grn); }
.bf .bl { color: var(--grn); }
.bf .fm { font-family: 'DM Mono', monospace; font-size: 13px; color: #7DDA9C; line-height: 1.9; }

.bd { background: var(--blud); border-color: var(--blu); }
.bd .bl { color: var(--blu); }

.bw { background: var(--redd); border-color: var(--red); }
.bw .bl { color: var(--red); }

.bm { background: var(--ambd); border-color: var(--amb); }
.bm .bl { color: var(--amb); }

.be { background: var(--purd); border-color: var(--pur); }
.be .bl { color: var(--pur); }

.bex {
  background: rgba(196,136,58,0.06);
  border: 1px solid var(--bdr);
  border-left: 3px solid var(--amb);
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 12px 0;
}

.bex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--card2);
  border-radius: var(--radius-sm);
  transition: background var(--tr);
}

.bex-head:hover {
  background: var(--card);
}

.bex-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--amb);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bex-icon {
  width: 18px;
  height: 18px;
  color: var(--amb);
  transition: transform var(--tr);
  flex-shrink: 0;
}

.bex-head.open .bex-icon {
  transform: rotate(180deg);
}

.bex-body {
  display: none;
  padding: 14px 16px;
  background: var(--bg);
  border-top: 1px solid var(--bdr);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.bex-body.open {
  display: block;
}

/* TABLES */
.tw {
  overflow-x: auto;
  margin: 14px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: var(--card2);
  color: var(--goldl);
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 2px solid var(--gold);
  font-size: 11.5px;
  letter-spacing: .3px;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--bdr);
  color: var(--text);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--card);
}

.tdf {
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  color: #7DDA9C;
}

.tdh {
  font-weight: 600;
  color: var(--goldl);
}

.tdc {
  text-align: center;
}

/* BILAN GRID */
.bg2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--bdr);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 14px 0;
}

.bc {
  background: var(--card);
  padding: 0;
}

.bh {
  background: var(--card2);
  padding: 7px 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
}

.br {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid var(--bdr);
  font-size: 12.5px;
}

.br:last-child {
  border-bottom: none;
}

.br .lbl {
  color: var(--text);
}

.br .ab {
  color: var(--dim);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
}

.br.sh {
  background: var(--card2);
}

.br.sh .lbl {
  color: var(--goldl);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .4px;
}

/* ACCORDIONS */
.acc {
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  margin: 10px 0;
  overflow: hidden;
}

.acc-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  cursor: pointer;
  background: var(--card);
  transition: background var(--tr);
  user-select: none;
}

.acc-h:hover {
  background: var(--card2);
}

.acc-t {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}

.acc-ic {
  width: 18px;
  height: 18px;
  color: var(--gold);
  transition: transform var(--tr);
  flex-shrink: 0;
}

.acc-h.op .acc-ic {
  transform: rotate(180deg);
}

.acc-b {
  display: none;
  padding: 14px 18px;
  background: var(--bg);
  border-top: 1px solid var(--bdr);
}

.acc-b.op {
  display: block;
}

/* FLASHCARDS SRS & NORMAL */
.fcg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.fc-wrap {
  margin: 18px 0;
}

.fc-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.fc-stat {
  font-size: 11px;
  color: var(--dim);
  font-family: 'DM Mono', monospace;
  background: var(--card);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--bdr);
}

.fc-stat span {
  color: var(--goldl);
  font-weight: 700;
}

.fc-nav {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  padding: 6px 14px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--tr);
}

.fc-nav:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.fc-single {
  perspective: 1000px;
  height: 180px;
  max-width: 560px;
  margin: 0 auto;
  cursor: pointer;
}

.fc-single .fci {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
}

.fc-single.fl .fci {
  transform: rotateY(180deg);
}

.fcf, .fcb {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
}

.fcf {
  background: var(--card);
  border: 1px solid var(--bdr);
}

.fcb {
  background: var(--card2);
  border: 1px solid var(--gold);
  transform: rotateY(180deg);
}

.fcf .ql, .fcb .al {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.fcf .ql { color: var(--faint); }
.fcb .al { color: var(--gold); }

.fcf .qt {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.fcb .at {
  font-size: 13px;
  color: var(--goldl);
  font-family: 'DM Mono', monospace;
  line-height: 1.5;
}

.fc-answer-btns {
  display: none;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.fc-single.fl ~ .fc-answer-btns {
  display: flex;
}

.fc-know, .fc-retry, .fc-hard, .fc-easy {
  border-radius: 6px;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--tr);
}

.fc-know small, .fc-retry small, .fc-hard small, .fc-easy small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.72;
  margin-top: 2px;
}

.fc-know {
  background: var(--grnd);
  border: 1px solid var(--grn);
  color: var(--grn);
}

.fc-know:hover {
  background: var(--grn);
  color: var(--bg);
}

.fc-retry {
  background: var(--redd);
  border: 1px solid var(--red);
  color: var(--red);
}

.fc-retry:hover {
  background: var(--red);
  color: #fff;
}

.fc-hard {
  background: var(--ambd);
  border: 1px solid var(--amb);
  color: var(--amb);
}

.fc-hard:hover {
  background: var(--amb);
  color: var(--bg);
}

.fc-easy {
  background: var(--blud);
  border: 1px solid var(--blu);
  color: var(--blu);
}

.fc-easy:hover {
  background: var(--blu);
  color: #fff;
}

.srs-session-line {
  max-width: 620px;
  margin: 0 auto 14px;
  padding: 10px 12px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}

.srs-session-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 7px;
}

.srs-session-meta strong {
  color: var(--goldl);
  font-family: 'DM Mono', monospace;
}

.srs-session-meta.muted {
  margin: 7px 0 0;
  color: var(--dim);
}

.srs-session-track {
  height: 5px;
  background: var(--bdr);
  border-radius: 999px;
  overflow: hidden;
}

.srs-session-track div {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--grn));
  border-radius: inherit;
  transition: width .2s ease;
}

.srs-done-card {
  text-align: center;
  padding: 40px;
  border-color: rgba(196,163,90,0.75);
}

.srs-done-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  color: var(--goldl);
  margin-bottom: 8px;
}

.srs-done-card p {
  color: var(--text2);
  font-size: 14px;
  max-width: 640px;
  margin: 0 auto 16px;
}

.srs-done-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.srs-session-summary, .srs-empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.srs-session-summary {
  margin: 14px 0 18px;
}

.srs-session-summary span {
  border: 1px solid var(--bdr);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--text2);
  font-size: 12px;
}

.fc-progress {
  height: 4px;
  background: var(--bdr);
  border-radius: 2px;
  margin: 12px auto 0;
  max-width: 560px;
}

.fc-progress-fill {
  height: 100%;
  background: var(--grn);
  border-radius: 2px;
  transition: width .3s;
}

/* QUIZ */
.qi {
  margin: 18px 0;
}

.qq {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13.5px;
}

.qq span {
  display: inline-block;
  background: var(--goldd);
  color: var(--gold);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-right: 7px;
  text-transform: uppercase;
}

.qo {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.qb {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--dim);
  transition: all var(--tr);
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  width: 100%;
}

.qb:hover {
  border-color: var(--gold);
  color: var(--text);
}

.qb.ok {
  background: var(--grnd);
  border-color: var(--grn);
  color: #7DDA9C;
}

.qb.ko {
  background: var(--redd);
  border-color: var(--red);
  color: #E88888;
}

.qb.dis {
  pointer-events: none;
  opacity: 0.6;
}

.qexp {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--card2);
  border-radius: 6px;
  border-left: 3px solid var(--grn);
  font-size: 12.5px;
  color: var(--dim);
}

.qexp.show {
  display: block;
}

/* FORMULAS INDEX */
.fg {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}

.fcard {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  transition: border-color var(--tr);
}

.fcard:hover {
  border-color: var(--grn);
}

.fcard .fn {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.fcard .feq {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #7DDA9C;
  line-height: 1.6;
}

.fcard .ftag {
  font-size: 9.5px;
  letter-spacing: 1px;
  background: var(--grnd);
  color: var(--grn);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* STEPS */
.steps {
  counter-reset: stp;
  margin: 14px 0;
}

.stp {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  padding: 11px 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--bdr);
}

.stp::before {
  counter-increment: stp;
  content: counter(stp);
  min-width: 26px;
  height: 26px;
  background: var(--goldd);
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.stp-c {
  color: var(--text);
  font-size: 13px;
}

.stp-c strong {
  display: block;
  margin-bottom: 2px;
}

/* HUB TABS */
.hub-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--bdr);
  margin: 24px 0 32px;
}

.hub-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  color: var(--dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  font-family: 'DM Sans', sans-serif;
  border-radius: 6px 6px 0 0;
}

.hub-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: var(--goldd);
}

.hub-tab:hover {
  color: var(--gold);
  background: rgba(196,163,90,0.05);
}

.hub-tab-content {
  display: none;
}

.hub-tab-content.active {
  display: block;
}

.hg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.hc {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--tr);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hc:hover {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(196, 163, 90, 0.05);
  transform: translateY(-2px);
}

.hc .ic {
  font-size: 26px;
  margin-bottom: 10px;
}

.hc .tt {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

.hc .ds {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.4;
}

/* BADGES */
.badge {
  display: inline-block;
  font-size: 9.5px;
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin: 2px;
}

.badge.bg { background: var(--goldd); color: var(--gold); }
.badge.bgr { background: var(--grnd); color: var(--grn); }
.badge.brd { background: var(--redd); color: var(--red); }
.badge.bbl { background: var(--blud); color: var(--blu); }
.badge.bab { background: var(--ambd); color: var(--amb); }

/* EXERCICES AND ANSWER ACCORDIONS */
.exframe {
  border: 1px solid var(--amb);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 16px 0;
}

.exhead {
  background: var(--ambd);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exhead .exbadge {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--amb);
  font-weight: 700;
  background: rgba(196,136,58,0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.exhead .extitle {
  font-weight: 600;
  font-size: 13px;
  color: var(--amb);
}

.exbody {
  padding: 14px 16px;
  background: var(--bg);
}

.extable {
  overflow-x: auto;
  margin: 10px 0;
  font-size: 12px;
}

.extable table thead th {
  background: rgba(196,136,58,0.15);
  color: var(--amb);
  border-bottom: 1px solid var(--amb);
  padding: 6px 10px;
  font-size: 11px;
}

.extable table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--bdr);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

.ans {
  border: 1px solid var(--grn);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 8px 0 18px;
}

.ans-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--grnd);
  border-radius: var(--radius-sm);
  transition: background var(--tr);
}

.ans-head:hover {
  background: rgba(74,157,110,0.18);
}

.ans-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--grn);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ans-icon {
  width: 18px;
  height: 18px;
  color: var(--grn);
  transition: transform var(--tr);
  flex-shrink: 0;
}

.ans-head.open .ans-icon {
  transform: rotate(180deg);
}

.ans-body {
  display: none;
  padding: 14px 16px;
  background: var(--bg);
  border-top: 1px solid var(--grn);
}

.ans-body.open {
  display: block;
}

/* BACK TO TOP */
#bktop {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 38px;
  height: 38px;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all var(--tr);
  z-index: 50;
}

#bktop.show {
  opacity: 1;
}

#bktop:hover {
  border-color: var(--gold);
}

#bktop svg {
  color: var(--gold);
}

/* PROGRESS BAR STICKY — pleine largeur, sidebar en overlay */
#progbar {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--sb);
  border-bottom: 1px solid var(--bdr);
  padding: 8px 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  transition: left 0.3s ease;
}

.prog-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  white-space: nowrap;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.prog-track {
  flex: 1;
  height: 6px;
  background: var(--bdr);
  border-radius: 3px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grn), var(--goldl));
  border-radius: 3px;
  transition: width .4s ease;
}

.prog-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--goldl);
  min-width: 32px;
  text-align: right;
  font-family: 'DM Mono', monospace;
}

.prog-dots {
  display: flex;
  gap: 5px;
}

.prog-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bdr);
  cursor: pointer;
  transition: background .2s;
  border: none;
  padding: 0;
}

.prog-dot.done {
  background: var(--grn);
}

.prog-dot.act {
  background: var(--gold);
}

.prog-dot:hover {
  transform: scale(1.3);
}

/* STICKY NAV PRINT BUTTON */
#printBtn {
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

#printBtn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* DIALOGS / ANALYTICS PANEL */
#statsModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

#statsModal.show {
  display: flex;
}

.stats-content {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}

.stats-header {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-close {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
}

.stats-close:hover {
  color: var(--gold);
}

.stats-section {
  margin-bottom: 18px;
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
  border-left: 3px solid var(--faint);
}

.stats-section.strong { border-left-color: var(--grn); }
.stats-section.medium { border-left-color: var(--amb); }
.stats-section.weak { border-left-color: var(--red); }

.stats-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 13px;
}

.stats-bar {
  width: 100%;
  height: 8px;
  background: var(--bdr);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.stats-bar-fill {
  height: 100%;
  background: var(--grn);
  transition: width .3s ease;
}

.stats-bar-fill.medium { background: var(--amb); }
.stats-bar-fill.weak { background: var(--red); }

.stats-info {
  font-size: 11px;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
}

/* READING TIME BADGE */
.nav-link .rt {
  font-size: 9px;
  color: var(--faint);
  margin-left: auto;
  font-family: 'DM Mono', monospace;
}

/* GLOSSARY FILTERING */
.gf-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.gf-btn {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 4px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
}

.gf-btn:hover, .gf-btn.on {
  background: var(--goldd);
  border-color: var(--gold);
  color: var(--gold);
}

.gf-row.hidden {
  display: none;
}

/* INTERACTIVE CALCULATOR */
.calc {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
}

.calc h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.calc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.calc-row label {
  font-size: 12px;
  color: var(--dim);
  min-width: 220px;
}

.calc-row input, .calc-row select {
  background: var(--card2);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  width: 110px;
  outline: none;
  transition: border-color .15s;
}

.calc-row input:focus {
  border-color: var(--gold);
}

.calc-btn {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: .5px;
  transition: opacity .15s;
  margin-top: 6px;
}

.calc-btn:hover {
  opacity: .85;
}

.calc-out {
  background: var(--bg);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 10px;
  display: none;
}

.calc-out.show {
  display: block;
}

.calc-out .fm {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #7DDA9C;
  line-height: 1.9;
}

/* DRILLS LAYOUT */
.drill-workspace {
  background: var(--card2);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 24px;
  margin: 18px 0;
}

.drill-question-box {
  background: var(--bg);
  border-left: 4px solid var(--gold);
  padding: 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.drill-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.drill-input-row input {
  background: var(--bg);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  width: 140px;
  outline: none;
  transition: border-color var(--tr);
}

.drill-input-row input:focus {
  border-color: var(--gold);
}

.drill-feedback {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  display: none;
  font-size: 14px;
}

.drill-feedback.correct {
  display: block;
  background: var(--grnd);
  border: 1px solid var(--grn);
  color: #7DDA9C;
}

.drill-feedback.wrong {
  display: block;
  background: var(--redd);
  border: 1px solid var(--red);
  color: #E88888;
}

.drill-steps {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--bdr);
  font-family: 'DM Sans', sans-serif;
  color: var(--dim);
  line-height: 1.7;
}

.drill-steps strong {
  color: var(--text);
}

.drill-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* HEATMAPS */
.heatmap-cell {
  width: 10px;
  height: 10px;
  background: var(--bg4);
  border-radius: 2px;
}

/* SECTION NAVIGATION BUTTONS */
.sec-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 8px;
  margin-top: 32px;
  border-top: 1px solid var(--bdr);
}

.snbtn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--tr);
  text-decoration: none;
}

.snbtn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.snbtn .snlabel {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 2px;
}

.snbtn-r {
  text-align: right;
}

/* MOBILE RESPONSIVE ADAPTATIONS */
.sidebar-trigger {
  display: none;
}

.nav-toggle {
  display: none;
  position: fixed;
  top: 7px;
  left: 7px;
  z-index: 1100;
  width: 34px;
  height: 34px;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
}

@media(max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    top: 0;
    height: 100vh;
    padding-top: 48px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 18px 0 36px rgba(0,0,0,0.5);
  }
  .nav-toggle {
    display: flex;
  }
  .main {
    margin-left: 0;
    padding: 24px 20px 60px;
  }
  #progbar {
    left: 0;
    padding: 8px 14px 8px 56px;
  }
  .bg2 {
    grid-template-columns: 1fr;
  }
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* FOCUS MODE EXCLUSIF */
body.focus-mode .app-header {
  transform: translateY(-100%);
}
body.focus-mode .sidebar {
  transform: translateX(-100%);
}
body.focus-mode #progbar {
  transform: translateY(-44px);
}
body.focus-mode .main {
  margin-left: 0 !important;
  max-width: 800px;
  margin: 0 auto;
  padding-top: 40px;
}
body.focus-mode .focus-exit-hint {
  display: block;
}

.focus-exit-hint {
  display: none;
  position: fixed;
  top: 12px;
  right: 20px;
  background: var(--card);
  border: 1px solid var(--gold);
  color: var(--goldl);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 1200;
  font-family: 'DM Sans', sans-serif;
  pointer-events: none;
  box-shadow: var(--shadow);
}

/* NOTIFICATIONS */
.subtle-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: 'DM Sans', sans-serif;
}

.subtle-notification.show {
  transform: translateX(-50%) translateY(0);
}

.subtle-notification.success { background: #4A9D6E; }
.subtle-notification.warning { background: #C4883A; }
.subtle-notification.error { background: #C45A5A; }

/* METHOD CARDS */
.mcard {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 10px 0;
}

.mcard .mtitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--goldl);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcard ol {
  padding-left: 18px;
  margin: 0;
}

.mcard ol li {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.5;
}

.mcard ol li strong {
  color: var(--goldl);
}

.mcard .mkey {
  display: inline-block;
  background: var(--goldd);
  color: var(--gold);
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  padding: 1px 6px;
  border-radius: 3px;
  margin: 0 2px;
}

/* TABLES FINANCIÈRES */
.tbl-fin {
  overflow-x: auto;
  margin: 12px 0;
}

.tbl-fin table {
  font-size: 11.5px;
  border-collapse: collapse;
  min-width: 500px;
}

.tbl-fin table thead th {
  background: var(--card2);
  color: var(--goldl);
  font-weight: 700;
  padding: 6px 10px;
  border: 1px solid var(--bdr);
  font-size: 10px;
  letter-spacing: .3px;
}

.tbl-fin table tbody td {
  padding: 5px 10px;
  border: 1px solid var(--bdr);
  text-align: right;
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
}

.tbl-fin table tbody td:first-child {
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  color: var(--goldl);
  background: var(--card);
}

/* SEARCH OVERLAY (Ctrl+K) */
#searchOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 3000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

#searchOverlay.show {
  display: flex;
}

.search-modal {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: searchSlideIn 0.2s ease-out;
}

@keyframes searchSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-input-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bdr);
  gap: 12px;
}

.search-icon {
  font-size: 18px;
  color: var(--dim);
}

#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  outline: none;
}

.search-kbd {
  background: var(--card2);
  border: 1px solid var(--bdr);
  color: var(--dim);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px 0;
}

.search-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: all var(--tr);
}

.search-item:hover, .search-item.selected {
  background: var(--goldd);
}

.search-item-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--goldl);
  margin-bottom: 2px;
}

.search-item-preview {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-footer {
  background: var(--card2);
  border-top: 1px solid var(--bdr);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--faint);
}

.search-shortcut {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-shortcut span {
  margin-right: 8px;
}

/* SKELETON LOADING */
.skeleton-loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.sk-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bdr);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: sk-spin 1s linear infinite;
}

@keyframes sk-spin {
  to { transform: rotate(360deg); }
}

/* ANCHORED STREAK GLOW */
.progress-glow {
  box-shadow: 0 0 10px var(--goldd);
}

/* PRINT MEDIA */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12px;
  }
  .app-header, .sidebar, #progbar, #bktop, .hub-tabs, .gf-bar, .snbtn, .nav-toggle {
    display: none !important;
  }
  .main {
    margin-left: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .section {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    page-break-after: always;
  }
  .card, .calc, .drill-workspace, .mini-quiz {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .ptitle, .section-title {
    color: #000 !important;
  }
  .essentiel {
    border: 2px solid #000 !important;
    background: #fff !important;
  }
  .essentiel::before {
    background: #000 !important;
    color: #fff !important;
  }
}

/* ============================================================
   PHASE 3-6 · Modules transverses (Due Today, Star, Exam Sim,
   Mock History, Weakness, Exam Eve, Settings, Cmd+K palette)
   ============================================================ */

/* Badge dans la sidebar (Due / Starred counters) */
.nav-badge {
  display: inline-block;
  margin-left: auto;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--bg);
  background: var(--gold);
  border-radius: 10px;
  vertical-align: middle;
}
.nav-link[onclick*="duetoday"] .nav-badge { background: var(--grn); color: #fff; }
.nav-link[onclick*="starred"] .nav-badge { background: var(--gold); color: #1a1a24; }
.nav-badge.empty { background: rgba(255,255,255,0.08); color: var(--text2); }

/* Tuile section Due Today */
.due-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.due-tile {
  background: linear-gradient(140deg, rgba(74,157,110,0.15), rgba(20,22,30,0.5));
  border: 1px solid rgba(74,157,110,0.35);
  border-radius: 12px;
  padding: 18px 16px;
  position: relative;
}
.due-tile .dt-icon { font-size: 22px; margin-bottom: 6px; }
.due-tile .dt-num { font-family:'JetBrains Mono', monospace; font-size: 30px; font-weight: 700; color: var(--grn); line-height: 1; }
.due-tile .dt-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 4px; }
.due-tile.zero { opacity: 0.55; border-color: rgba(255,255,255,0.08); background: rgba(20,22,30,0.4); }
.due-tile.zero .dt-num { color: var(--dim); }

.due-action-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  background: linear-gradient(135deg, var(--grn), #2b6c4a);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.4px;
}
.due-action-btn:hover { filter: brightness(1.1); }
.due-action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
}

.due-list { list-style: none; padding: 0; margin: 16px 0 0 0; }
.due-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.due-list li:hover { background: rgba(255,255,255,0.07); }
.due-list .due-type {
  display: inline-block; min-width: 65px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--gold);
}
.due-list .due-arrow { margin-left: auto; color: var(--dim); }
.due-empty {
  text-align: center; padding: 40px 20px;
  border: 1px dashed var(--border); border-radius: 12px;
  color: var(--text2);
}
.due-empty .de-emoji { font-size: 48px; margin-bottom: 10px; }

/* Étoiles favoris */
.star-btn {
  cursor: pointer;
  font-size: 20px;
  background: none;
  border: none;
  color: var(--dim);
  transition: color 0.15s, transform 0.15s;
  padding: 4px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.star-btn:hover { transform: scale(1.2); }
.star-btn.on { color: var(--gold); text-shadow: 0 0 12px rgba(196,163,90,0.5); }

.starred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.starred-card {
  padding: 14px 16px;
  background: linear-gradient(140deg, rgba(196,163,90,0.12), rgba(20,22,30,0.5));
  border: 1px solid rgba(196,163,90,0.35);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s;
}
.starred-card:hover { transform: translateY(-2px); }
.starred-card .sc-eyebrow { font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.8px; }
.starred-card .sc-title { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 4px; }
.starred-card .sc-meta { font-size: 11px; color: var(--text2); margin-top: 6px; }

/* Simulateur d'examen */
.exam-config-card { padding: 24px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 14px; max-width: 600px; margin: 0 auto 24px; }
.exam-config-card h3 { font-family:'Cormorant Garamond', serif; font-size: 22px; color: var(--goldl); margin-bottom: 14px; }
.exam-config-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; }
.exam-config-row label { color: var(--text2); }
.exam-timer-bar {
  position: sticky; top: 64px; z-index: 70;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; margin-bottom: 16px;
  background: rgba(15,16,22,0.95);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
}
.exam-timer-clock { font-size: 22px; font-weight: 700; color: var(--gold); letter-spacing: 1px; }
.exam-timer-clock.warning { color: var(--orange); }
.exam-timer-clock.danger { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% {opacity:1;} 50% {opacity:0.55;} }
.exam-q-card { padding: 18px; margin-bottom: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; }
.exam-q-card .q-num { display: inline-block; padding: 3px 9px; background: var(--gold); color: #1a1a24; border-radius: 6px; font-size: 11px; font-weight: 700; margin-right: 8px; }
.exam-result-card { padding: 28px; text-align: center; background: linear-gradient(140deg, rgba(74,157,110,0.15), rgba(20,22,30,0.4)); border: 1px solid var(--grn); border-radius: 14px; margin-bottom: 18px; }
.exam-result-card.fail { background: linear-gradient(140deg, rgba(220,80,80,0.15), rgba(20,22,30,0.4)); border-color: var(--red); }
.exam-result-card .er-score { font-family:'JetBrains Mono', monospace; font-size: 56px; font-weight: 700; color: var(--gold); }
.exam-result-card .er-label { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.8px; }

/* Historique mocks */
.mock-history-table { width: 100%; border-collapse: collapse; }
.mock-history-table th, .mock-history-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; text-align: left; }
.mock-history-table th { color: var(--text2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; }
.mock-history-table .pos { color: var(--grn); }
.mock-history-table .neg { color: var(--red); }
.mock-canvas-wrap { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 20px; }

/* Faiblesses */
.weakness-card { padding: 16px; background: linear-gradient(140deg, rgba(220,80,80,0.12), rgba(20,22,30,0.4)); border: 1px solid rgba(220,80,80,0.35); border-radius: 10px; margin-bottom: 10px; }
.weakness-card .wc-title { font-size: 15px; font-weight: 700; color: var(--red); }
.weakness-card .wc-detail { font-size: 12px; color: var(--text2); margin-top: 4px; }
.weakness-card .wc-action { margin-top: 10px; display: inline-block; padding: 7px 12px; background: var(--red); color: #fff; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; }

/* Veille d'examen */
.eve-step { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 10px; background: rgba(255,255,255,0.03); border-left: 3px solid var(--gold); border-radius: 8px; }
.eve-step .step-num { font-family:'JetBrains Mono', monospace; font-size: 24px; font-weight: 700; color: var(--gold); min-width: 36px; }
.eve-step .step-text { flex: 1; }
.eve-step .step-title { font-size: 15px; font-weight: 600; color: var(--text); }
.eve-step .step-desc { font-size: 12px; color: var(--text2); margin-top: 3px; }
.eve-step.done { opacity: 0.55; border-left-color: var(--grn); }
.eve-check { font-size: 22px; cursor: pointer; color: var(--dim); }
.eve-check.on { color: var(--grn); }

/* Paramètres */
.settings-section { margin-bottom: 26px; }
.settings-section h3 { font-family:'Cormorant Garamond', serif; font-size: 20px; color: var(--goldl); margin-bottom: 10px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(255,255,255,0.03); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.settings-row select, .settings-row input[type="range"] { background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
.settings-danger-btn { padding: 9px 14px; background: rgba(220,80,80,0.15); color: var(--red); border: 1px solid var(--red); border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; }

/* Skeleton on nav */
.section.skeleton-loading::before {
  content: '';
  display: block;
  height: 200px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 12px;
  margin-bottom: 20px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Onboarding modal */
.onb-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.onb-card {
  max-width: 520px; width: 100%;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px;
  position: relative;
}
.onb-card h2 { font-family:'Cormorant Garamond', serif; font-size: 28px; color: var(--gold); margin-bottom: 6px; }
.onb-card p { color: var(--text2); font-size: 14px; line-height: 1.6; }
.onb-progress { display: flex; gap: 6px; margin: 20px 0 24px; }
.onb-dot { flex: 1; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; }
.onb-dot.on { background: var(--gold); }
.onb-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Palette Cmd+K command rows */
.search-item.command-row { border-left: 3px solid var(--gold); }
.search-item .cmd-kbd { font-family:'JetBrains Mono', monospace; font-size: 10px; padding: 2px 6px; background: rgba(255,255,255,0.08); border-radius: 4px; color: var(--text2); margin-left: 10px; }


/* ============================================================
   POMODORO BAR (parité Macro) — focus 25 min + pause 5 min
   ============================================================ */
.pomodoro-bar {
  position: fixed; top: 64px; right: 16px; z-index: 9000;
  background: var(--card, #1a1a24);
  border: 1px solid rgba(196,163,90,0.55);
  border-radius: 12px;
  padding: 8px 12px;
  display: none; align-items: center; gap: 10px;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(196,163,90,0.35);
  transition: all 0.2s ease;
  user-select: none;
}
.pomodoro-bar.visible { display: flex; }
.pomodoro-bar.break {
  border-color: var(--grn);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px var(--grn);
  background: linear-gradient(135deg, var(--card, #1a1a24), rgba(74,157,110,0.18));
}
.pomodoro-bar .pb-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px; font-weight: 700;
  color: var(--gold);
  min-width: 56px; text-align: center;
}
.pomodoro-bar.break .pb-time { color: var(--grn); }
.pomodoro-bar .pb-label {
  color: var(--text2); font-size: 9px;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}
.pomodoro-bar button {
  background: transparent; border: 1px solid var(--bdr);
  color: var(--text2); padding: 3px 8px;
  border-radius: 6px; cursor: pointer; font-size: 11px;
  transition: all 0.15s ease;
}
.pomodoro-bar button:hover { color: var(--text); border-color: var(--gold); transform: scale(1.1); }
body.focus-mode .pomodoro-bar { top: 16px; right: 16px; }
@media (max-width: 700px) {
  .pomodoro-bar { padding: 6px 10px; gap: 8px; right: 8px; top: 56px; }
  .pomodoro-bar .pb-time { font-size: 14px; min-width: 44px; }
  .pomodoro-bar .pb-label { display: none; }
}
.pomodoro-bar.visible::before {
  content: ''; position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  animation: pomoPulse 2s infinite;
}
.pomodoro-bar.break.visible::before { background: var(--grn); }
@keyframes pomoPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.5; }
}

/* Bouton Pomodoro sur Due Today + flashcards */
.pomo-launch-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 6px;
}
.pomo-launch-btn {
  flex: 1; min-width: 140px;
  padding: 11px 14px;
  background: linear-gradient(135deg, rgba(196,163,90,0.18), rgba(20,22,30,0.5));
  border: 1px solid rgba(196,163,90,0.45);
  color: var(--text);
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.pomo-launch-btn:hover { transform: translateY(-2px); border-color: var(--gold); }
.pomo-launch-btn .pl-time { font-family:'JetBrains Mono', monospace; color: var(--gold); margin-left: 6px; }


/* ============================================================
   COMMIT DAY DETAIL MODAL (clic sur grille 90j)
   ============================================================ */
.commit-cell { cursor: pointer; transition: transform 0.1s; }
.commit-cell:hover { transform: scale(1.4); outline: 1px solid var(--gold); }

.commit-day-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 2500;
  display: none;
  align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
  backdrop-filter: blur(3px);
}
.commit-day-overlay.visible { display: flex; }

.cdd-card {
  width: 100%; max-width: 760px;
  background: var(--bg2, #1a1a24);
  border: 1px solid rgba(196,163,90,0.45);
  border-radius: 16px;
  padding: 28px 32px;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.cdd-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 26px;
  color: var(--text2); cursor: pointer; line-height: 1;
}
.cdd-close:hover { color: var(--gold); }
.cdd-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; color: var(--gold); margin: 0 0 4px;
  text-transform: capitalize;
}
.cdd-sub {
  font-size: 12px; color: var(--text2); text-transform: uppercase;
  letter-spacing: 1.5px; margin-bottom: 22px;
}
.cdd-body { font-size: 13px; }

.cdd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.cdd-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--bdr);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.cdd-stat strong {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px; font-weight: 700;
  color: var(--gold);
}
.cdd-stat span {
  display: block;
  font-size: 10px; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-top: 4px;
}

.cdd-block { margin-bottom: 22px; }
.cdd-block h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; color: var(--goldl, var(--gold));
  margin-bottom: 10px;
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}
.cdd-empty {
  padding: 14px; text-align: center;
  color: var(--text2); font-size: 12px; font-style: italic;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--bdr); border-radius: 8px;
}
.cdd-timeline {
  display: flex; flex-direction: column; gap: 6px;
}
.cdd-event {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--bdr);
  border-radius: 6px;
  font-size: 12.5px;
}
.cdd-event.k-visit  { border-left-color: #5A7EC4; }
.cdd-event.k-srs    { border-left-color: #C4A35A; }
.cdd-event.k-drill  { border-left-color: #4A9D6E; }
.cdd-event.k-quiz   { border-left-color: #9C73C4; }
.cdd-event.k-pomo_start, .cdd-event.k-pomo_done { border-left-color: #E37C5C; }
.cdd-event.k-mock   { border-left-color: #D94855; }
.cdd-event.k-cal_validate { border-left-color: #4A9D6E; }
.cdd-event .e-time {
  font-family:'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text2); min-width: 48px;
}
.cdd-event .e-kind {
  display: inline-block; min-width: 70px;
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--gold);
}
.cdd-event .e-detail { flex: 1; color: var(--text); }
.cdd-event .e-meta {
  font-size: 10px; color: var(--text2);
  padding: 2px 6px; background: rgba(255,255,255,0.05);
  border-radius: 4px; font-family:'JetBrains Mono', monospace;
}
.cdd-event .e-meta.ok { color: var(--grn); }
.cdd-event .e-meta.ko { color: var(--red); }
@media (max-width: 600px) {
  .cdd-card { padding: 20px 18px; max-height: 92vh; overflow-y: auto; }
  .cdd-event { flex-wrap: wrap; }
  .cdd-event .e-kind { min-width: auto; }
}


/* ============================================================
   SRS DECK PICKER (boutons par séance)
   ============================================================ */
.srs-deck-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}
.srs-deck-btn {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--bdr);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column; gap: 2px;
  transition: all 0.15s ease;
}
.srs-deck-btn:hover { border-color: var(--gold); color: var(--text); }
.srs-deck-btn.on {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(196,163,90,0.18), rgba(20,22,30,0.4));
  color: var(--text);
}
.srs-deck-btn .dk-icon { font-size: 18px; }
.srs-deck-btn .dk-label { font-weight: 600; font-size: 12px; }
.srs-deck-btn .dk-count {
  font-family:'JetBrains Mono', monospace;
  font-size: 11px; color: var(--gold);
}
.srs-deck-btn .dk-due {
  position: absolute; top: -6px; right: -6px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
}

/* ============================================================
   STREAK WARNING MODAL (22h-23h, rien fait aujourd'hui)
   ============================================================ */
.streak-warning-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 2700;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.streak-warning-overlay.visible { display: flex; }
.swm-card {
  max-width: 460px; width: 100%;
  background: var(--bg2, #1a1a24);
  border: 1px solid var(--red);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(220,80,80,0.4), 0 0 0 1px rgba(220,80,80,0.4);
  animation: swmPulse 1.6s infinite;
}
@keyframes swmPulse {
  0%, 100% { box-shadow: 0 20px 60px rgba(220,80,80,0.4), 0 0 0 1px rgba(220,80,80,0.4); }
  50%      { box-shadow: 0 20px 60px rgba(220,80,80,0.6), 0 0 0 3px rgba(220,80,80,0.6); }
}
.swm-icon { font-size: 56px; margin-bottom: 6px; }
.swm-streak {
  font-family:'JetBrains Mono', monospace;
  font-size: 44px; font-weight: 700;
  color: var(--red);
}
.swm-title {
  font-family:'Cormorant Garamond', serif;
  font-size: 22px; color: var(--text);
  margin-bottom: 8px;
}
.swm-text {
  font-size: 13px; color: var(--text2);
  line-height: 1.6; margin-bottom: 24px;
}
.swm-actions {
  display: flex; gap: 10px; justify-content: center;
}
.swm-skip {
  background: transparent; border: 1px solid var(--bdr);
  color: var(--text2); padding: 9px 16px;
  border-radius: 8px; font-size: 12px; cursor: pointer;
}
.swm-go {
  background: linear-gradient(135deg, var(--red), #962a2a);
  color: #fff; border: none; padding: 9px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer;
}

/* ============================================================
   GRAPHIQUES INTERACTIFS (Canvas + sliders)
   ============================================================ */
.gf-graph-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--bdr);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 22px;
}
.gf-graph-card h3 {
  font-family:'Cormorant Garamond', serif;
  font-size: 22px; color: var(--gold);
  margin-bottom: 4px;
}
.gf-graph-explain {
  font-size: 12px; color: var(--text2);
  margin-bottom: 14px; line-height: 1.6;
}
.gf-graph-row {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 800px) {
  .gf-graph-row { grid-template-columns: 1fr; }
}
.gf-graph-row canvas {
  width: 100%; max-width: 640px; height: auto;
  background: #0e0f13;
  border: 1px solid var(--bdr);
  border-radius: 10px;
}
.gf-controls {
  display: flex; flex-direction: column; gap: 12px;
  font-size: 12px;
}
.gf-controls label {
  display: block;
  color: var(--text2);
}
.gf-controls label .val {
  color: var(--gold);
  font-family:'JetBrains Mono', monospace;
  font-weight: 700; float: right;
}
.gf-controls input[type=range] {
  width: 100%; margin-top: 6px;
  accent-color: var(--gold);
}
.gf-graph-readout {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(196,163,90,0.08);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-family:'JetBrains Mono', monospace;
  font-size: 11.5px; color: var(--text);
}
