/* ═══ CCNA Exam Simulator — Flashcard Screen & FC Modal Styles ══════════ */
.fc-main {
  max-width: 700px; margin: 0 auto; padding: 24px 16px;
  display: flex; flex-direction: column; gap: 20px;
  min-height: calc(100vh - 72px);
}

/* ─── Progress row ───────────────────────────────────────────────────── */
.fc-progress {
  display: flex; align-items: center; gap: 12px;
}
#fc-counter { white-space: nowrap; font-size: 0.9rem; color: var(--text-dim); min-width: 58px; }
.fc-stats   { white-space: nowrap; font-size: 0.88rem; min-width: 70px; text-align: right; }

/* ─── 3D flip card ───────────────────────────────────────────────────── */
.fc-card {
  perspective: 1200px; cursor: pointer;
  user-select: none;
}
.fc-inner {
  position: relative; width: 100%;
  transition: transform 0.5s cubic-bezier(.4,0,.2,1);
  transform-style: preserve-3d;
}
.fc-inner.flipped { transform: rotateY(180deg); }

/* Recto : en flux normal — détermine la hauteur du conteneur */
.fc-front {
  position: relative; width: 100%; box-sizing: border-box;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 28px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 240px;
}

/* Verso : positionné sur le recto, peut dépasser → JS ajuste minHeight */
.fc-back {
  position: absolute; top: 0; left: 0; width: 100%; box-sizing: border-box;
  min-height: 100%;
  background: var(--card); border: 1px solid rgba(0,212,255,.3);
  border-radius: var(--radius-lg); padding: 22px 28px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; gap: 10px;
  transform: rotateY(180deg);
}

/* ─── Card content ───────────────────────────────────────────────────── */
.fc-type-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fc-question-text { font-size: 1.15rem; line-height: 1.65; color: var(--text); flex: 1; }
.fc-tap-hint {
  margin-top: auto; color: var(--text-dim); font-size: 0.78rem;
  text-align: center; opacity: .6; letter-spacing: .03em;
}
.fc-answer-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--cyan); font-weight: 700;
}
.fc-answer-text {
  font-size: 1.05rem; color: var(--green); font-weight: 600;
  white-space: pre-line; line-height: 1.55;
}
.fc-explanation {
  border-top: 1px solid var(--border); padding-top: 12px;
  font-size: 0.85rem; color: var(--text-dim); line-height: 1.55;
}

/* ─── Action buttons ─────────────────────────────────────────────────── */
.fc-actions { display: flex; gap: 16px; justify-content: center; }
.fc-btn-know, .fc-btn-dunno {
  flex: 1; max-width: 220px; padding: 14px 20px;
  font-size: 1.05rem; font-weight: 700; border-radius: var(--radius-lg);
  cursor: pointer; transition: all .15s; border-width: 2px; border-style: solid;
}
.fc-btn-know  { background: rgba(0,232,122,.1); border-color: var(--green); color: var(--green); }
.fc-btn-dunno { background: rgba(255,51,102,.1); border-color: var(--red);   color: var(--red);   }
.fc-btn-know:hover  { background: rgba(0,232,122,.22); }
.fc-btn-dunno:hover { background: rgba(255,51,102,.22); }

/* ─── End-of-session summary ─────────────────────────────────────────── */
.fc-summary { flex: 1; display: flex; align-items: center; justify-content: center; }
.fc-summary-card {
  max-width: 460px; width: 100%; text-align: center; padding: 2rem 2.5rem;
}
.fc-summary-card h2 { margin-bottom: 1rem; }
.fc-result-grid {
  display: flex; justify-content: center; gap: 2rem; margin: 1.5rem 0;
}
.fc-result-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fc-result-num { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.fc-result-lbl { font-size: 0.78rem; color: var(--text-dim); }
.fc-result-item.green .fc-result-num { color: var(--green); }
.fc-result-item.red   .fc-result-num { color: var(--red);   }
.fc-result-item.cyan  .fc-result-num { color: var(--cyan);  }
.fc-summary-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* ─── Flashcard recto : simlet / dragdrop ────────────────────────────── */
.fc-dd-front-hint { font-size: .78rem; color: var(--text-dim); margin-bottom: 8px; }
.fc-dd-cols { display: flex; gap: 16px; }
.fc-dd-col  { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.fc-dd-cats { border-left: 1px dashed var(--border); padding-left: 16px; }
.fc-dd-chip {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 10px;
  font-size: .8rem; color: var(--text);
}
.fc-dd-chip-cat { border-style: dashed; color: var(--text-dim); }

/* ─── Flashcard verso : choices review ───────────────────────────────── */
.fc-choices-review { display: flex; flex-direction: column; gap: 6px; }
.fc-choice-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg2);
  font-size: .88rem; color: var(--text-dim);
}
.fc-choice-row.correct {
  border-color: rgba(0,232,122,.4); background: rgba(0,232,122,.08);
  color: var(--text); font-weight: 600;
}
.fc-choice-letter {
  font-weight: 700; color: var(--cyan); min-width: 18px; flex-shrink: 0;
}
.fc-choice-row.correct .fc-choice-letter { color: var(--green); }

/* ─── Flashcard verso : dragdrop mappings ────────────────────────────── */
.fc-dd-review-back { display: flex; flex-direction: column; gap: 6px; }
.fc-dd-map-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--radius);
  background: rgba(0,232,122,.07); border: 1px solid rgba(0,232,122,.25);
  font-size: .88rem;
}
.fc-dd-item-lbl { font-weight: 600; color: var(--text); flex: 1; }
.fc-dd-arrow    { color: var(--green); font-weight: 700; }
.fc-dd-cat-lbl  { color: var(--green); flex: 1; text-align: right; }

/* ═══════════════════════════════════════════ FC PROGRESS MODAL ═════════ */
.fc-prog-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.fc-prog-stat {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; text-align: center;
}
.fc-prog-stat .stat-val   { font-size: 1.4rem; font-weight: 700; color: var(--cyan); display: block; }
.fc-prog-stat .stat-label { font-size: 0.72rem; color: var(--text-dim); display: block; margin-top: 2px; }

/* ─── Heatmap ─────────────────────────────────────────────────────────── */
/* Calendar heatmap */
.fc-heatmap-wrap {
  display: flex; gap: 5px; margin-bottom: 4px; overflow-x: auto;
}
.fc-heatmap-dow {
  display: grid; grid-template-rows: repeat(7, 14px);
  gap: 3px; flex-shrink: 0; padding-top: 0;
}
.heat-dow-label {
  font-size: .58rem; color: var(--text-dim);
  display: flex; align-items: center; height: 14px; width: 10px;
}
.fc-heatmap-cal {
  display: grid; grid-template-rows: repeat(7, 14px);
  grid-auto-columns: 14px; grid-auto-flow: column;
  gap: 3px;
}
.heat-cell {
  width: 14px; height: 14px; border-radius: 2px; cursor: default;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 1px 2px; flex-shrink: 0;
}
.heat-future { background: transparent; }
.heat-legend {
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.heat-legend-lbl { font-size: .7rem; color: var(--text-dim); }
.heat-0     { background: var(--bg2); border: 1px solid var(--border); }
.heat-bad   { background: rgba(255,51,102,.55); }
.heat-ok    { background: rgba(255,193,7,.55); }
.heat-good  { background: rgba(0,232,122,.5); }
.heat-great { background: rgba(0,232,122,.9); }
.heat-today { outline: 2px solid var(--cyan); outline-offset: 1px; }
.heat-day { font-size: .55rem; color: rgba(255,255,255,.35); line-height: 1; pointer-events: none; }

/* ─── Monthly calendar heatmap ────────────────────────────────────────── */
.fc-heatmap-month-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 8px;
}
.fc-heatmap-month-title {
  font-size: .9rem; font-weight: 600; color: var(--text);
  min-width: 155px; text-align: center;
}
.fc-heatmap-month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin-bottom: 6px;
}
.heat-dow-hdr {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--cyan); text-align: center; padding: 0 0 6px;
}
.heat-cell-month {
  border-radius: 4px; cursor: default;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; min-height: 22px; max-height: 38px;
}
.heat-cell-month.heat-today { outline: 2px solid var(--cyan); outline-offset: 1px; }
.heat-cell-month.heat-dim   { opacity: 0.22; }
.heat-day-num { font-size: .72rem; color: rgba(255,255,255,.7); line-height: 1; pointer-events: none; }
.heat-day-num.heat-day-dim  { color: rgba(255,255,255,.3); }

/* ─── SRS upcoming schedule ───────────────────────────────────────────── */
.srs-sched { display: flex; flex-direction: column; gap: 2px; }
.srs-sched-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.srs-sched-row:last-child { border-bottom: none; }
.srs-sched-date  { font-size: .8rem; min-width: 78px; color: var(--text-dim); }
.srs-sched-bar-wrap { flex: 1; height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.srs-sched-bar   { height: 100%; background: var(--cyan); border-radius: 2px; transition: width .3s; }
.srs-sched-count { font-size: .8rem; min-width: 68px; text-align: right; color: var(--text-dim); }
.srs-sched-row.srs-has-cards .srs-sched-date  { color: var(--text); font-weight: 600; }
.srs-sched-row.srs-has-cards .srs-sched-count { color: var(--cyan); font-weight: 700; }
.srs-sched-row.srs-today .srs-sched-date  { color: var(--green); }
.srs-sched-row.srs-today .srs-sched-count { color: var(--green); }

/* ─── Domain rows ─────────────────────────────────────────────────────── */
.fc-prog-domains { display: flex; flex-direction: column; gap: 8px; }
.fc-prog-dom-row {
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem;
}

/* ─── FC source selection modal ──────────────────────────────────────── */
.fc-source-options { display: flex; flex-direction: column; gap: 10px; }
.fc-source-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 18px;
  cursor: pointer; text-align: left; transition: all .15s; width: 100%;
}
.fc-source-btn:hover { border-color: var(--cyan); background: rgba(0,212,255,.06); }
.fc-source-icon { font-size: 1.6rem; flex-shrink: 0; }
.fc-source-title { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.fc-source-desc  { font-size: 0.78rem; color: var(--text-dim); }

/* ─── Anki domain filter in fc modal ─────────────────────────────────── */
.fc-anki-domain-filter {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 14px;
  background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border);
}
.fc-anki-domain-filter label {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
}

/* ─── FC source badge (during session) ───────────────────────────────── */
.fc-source-badge {
  font-size: 0.75rem; color: var(--text-dim);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 99px; padding: 3px 10px; align-self: flex-start;
}

/* ─── Leitner box indicator (flashcard recto) ─────────────────────────── */
.fc-box-indicator {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: auto; cursor: default;
}
.box-dot        { color: var(--bg3); font-size: 0.6rem; line-height: 1; }
.box-dot.filled { color: var(--cyan); }

/* ─── Leitner box distribution rows ──────────────────────────────────── */
.fc-box-dist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.fc-box-row  { display: flex; align-items: center; gap: 10px; font-size: .82rem; }
.fc-box-num      { min-width: 52px; color: var(--text-dim); }
.fc-box-interval { min-width: 22px; font-size: .72rem; color: var(--cyan-dim); text-align: right; }
.fc-box-count    { min-width: 26px; text-align: right; font-weight: 600; color: var(--text); }

/* ─── Keybinding config modal ─────────────────────────────────────────── */
.kb-config-body { display: flex; flex-direction: column; }
.kb-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.kb-label { font-size: 0.88rem; color: var(--text); }
.kb-key-btn {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--cyan); font-weight: 700;
  font-size: 0.88rem; padding: 4px 16px; cursor: pointer;
  min-width: 80px; text-align: center; transition: all .15s;
}
.kb-key-btn:hover { border-color: var(--cyan); }
.kb-key-btn.capturing {
  border-color: var(--yellow); color: var(--yellow);
  animation: pulse-kb 0.8s ease-in-out infinite;
}
@keyframes pulse-kb {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,193,7,.5); }
  50%       { box-shadow: 0 0 0 5px rgba(255,193,7,.0); }
}

/* ─── Stats bar (dashboard) ───────────────────────────────────────────── */
.stats-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 24px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.stat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 99px; padding: 5px 14px; cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap; flex-shrink: 0;
}
.stat-chip:hover { border-color: var(--cyan); background: var(--card2); }
.stat-chip--empty { opacity: .45; cursor: not-allowed; }
.stat-chip--empty:hover { border-color: var(--border); background: var(--bg3); }
.stat-chip--display { cursor: default; }
.stat-chip--display:hover { border-color: var(--border); background: var(--bg3); }
.stat-icon { font-size: 0.9rem; }
.stat-val  { font-weight: 700; font-size: 0.88rem; color: var(--cyan); }
.stat-lbl  { font-size: 0.75rem; color: var(--text-dim); }

/* ─── Settings card: action section ──────────────────────────────────── */
.action-section {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.fc-launch-row {
  display: flex; gap: 8px;
}
.btn-outline {
  flex: 1;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 0.88rem;
  padding: 8px 12px; cursor: pointer; transition: border-color .15s, color .15s;
  text-align: center;
}
.btn-outline:hover  { border-color: var(--cyan); color: var(--cyan); }
.btn-outline:disabled { opacity: .45; cursor: not-allowed; }
.hist-links {
  display: flex; justify-content: center; gap: 20px;
}
.btn-link {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.82rem;
  text-decoration: underline dotted; padding: 0;
  transition: color .15s;
}
.btn-link:hover { color: var(--cyan); }

/* ─── Domain legend collapsible ───────────────────────────────────────── */
.domain-legend-details {
  margin-top: 10px;
}
.domain-legend-details summary {
  cursor: pointer; font-size: 0.88rem; font-weight: 600;
  color: var(--text-dim); list-style: none; padding: 6px 0;
  user-select: none;
}
.domain-legend-details summary::before { content: '▶ '; font-size: .7rem; }
.domain-legend-details[open] summary::before { content: '▼ '; }
.domain-legend-details ul { padding: 6px 0 2px 14px; }
.domain-legend-details li { font-size: 0.83rem; color: var(--text-dim); margin-bottom: 3px; }

/* ─── FC day filter (in source modal) ────────────────────────────────── */
.fc-day-filter-section {
  margin-top: 12px; padding: 10px 14px;
  background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border);
}
.fc-filter-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.fc-filter-header > span {
  font-size: .82rem; color: var(--text-dim); font-weight: 600; flex: 1; min-width: 100px;
}
.fc-filter-count {
  font-size: .75rem; color: var(--cyan-dim); font-weight: 400;
  margin-left: 4px;
}

/* Domain chips row */
.fc-domain-chips {
  display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap;
}

/* Day chips grid */
.fc-day-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 130px; overflow-y: auto;
}

/* Base chip style (shared by domain + day chips) */
.fc-day-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px; cursor: pointer;
  font-size: 0.75rem; border: 1px solid var(--border);
  background: var(--bg3); color: var(--text-dim);
  transition: border-color .12s, color .12s, background .12s;
  user-select: none;
}
.fc-day-chip:has(input:checked) {
  border-color: var(--cyan); color: var(--cyan); background: rgba(0,212,255,.1);
}
/* Indeterminate domain chip (some days checked) */
.fc-day-chip.indeterminate {
  border-color: var(--cyan-dim); color: var(--cyan-dim);
  background: rgba(0,136,170,.08); border-style: dashed;
}
.fc-day-chip input { position: absolute; opacity: 0; width: 0; height: 0; }

/* Domain chips slightly bigger */
.fc-dom-chip { font-weight: 700; font-size: 0.78rem; padding: 4px 12px; }

/* ── Chip performance colors (uniquement quand non coché / non indéterminé) ── */
.fc-day-chip.fc-chip-bad:not(:has(input:checked)):not(.indeterminate)   { border-color: rgba(255,51,102,.65);  color: rgba(255,110,130,.9); }
.fc-day-chip.fc-chip-ok:not(:has(input:checked)):not(.indeterminate)    { border-color: rgba(255,193,7,.65);   color: rgba(255,200,80,.9); }
.fc-day-chip.fc-chip-good:not(:has(input:checked)):not(.indeterminate)  { border-color: rgba(0,232,122,.65);   color: rgba(60,220,130,.9); }
.fc-day-chip.fc-chip-great:not(:has(input:checked)):not(.indeterminate) { border-color: var(--green); color: var(--green); }

/* ─── Advice / Recommendations panel ─────────────────────────────────── */
.advice-panel {
  margin: 0 24px 12px;
  max-width: 1300px;
  width: calc(100% - 48px);
  align-self: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.advice-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .82rem; font-weight: 700; color: var(--text-dim);
}
/* Study day control (inline in advice header) */
.study-day-ctrl {
  display: flex; align-items: center; gap: 6px;
  font-weight: 400; font-size: .8rem;
}
.study-day-lbl { color: var(--text-dim); }
.study-day-input {
  width: 52px; padding: 2px 6px; border-radius: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--cyan); font-size: .85rem; font-weight: 700;
  text-align: center; -moz-appearance: textfield;
}
.study-day-input::-webkit-outer-spin-button,
.study-day-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.study-day-input:focus { outline: none; border-color: var(--cyan); }
.study-day-max { color: var(--text-dim); font-size: .78rem; }
.study-day-sep { color: var(--border); font-size: 1rem; margin: 0 4px; }

.advice-items { display: flex; flex-direction: column; }
.advice-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  font-size: .83rem;
}
.advice-item:last-child { border-bottom: none; }
.advice-icon { font-size: 1rem; flex-shrink: 0; }
.advice-text { flex: 1; line-height: 1.4; }
.advice-btn  { flex-shrink: 0; white-space: nowrap; }

/* accent bar à gauche selon type */
.advice-urgent  { border-left: 3px solid var(--cyan); }
.advice-weak    { border-left: 3px solid var(--red); }
.advice-exam    { border-left: 3px solid var(--yellow); }
.advice-good    { border-left: 3px solid var(--green); }
.advice-next    { border-left: 3px solid var(--purple); }
.advice-neutral { border-left: 3px solid var(--border); }

/* ─── FC wrong cards list (in session summary) ────────────────────────── */
.fc-wrong-details {
  margin: 12px 0 4px; text-align: left;
}
.fc-wrong-details summary {
  cursor: pointer; font-size: .85rem; font-weight: 600;
  color: var(--red); user-select: none; padding: 4px 0;
}
.fc-wrong-items {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px; max-height: 200px; overflow-y: auto;
}
.fc-wrong-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; background: var(--bg2);
  border-radius: var(--radius); border: 1px solid var(--border);
}
.fc-wrong-topic { font-size: .72rem; color: var(--text-dim); white-space: nowrap; }
.fc-wrong-front { font-size: .8rem; color: var(--text); flex: 1; }

/* ══════════════════════════════════════ STUDY PLAN TRACKER */

/* Boutons dans le header Conseils */
.sp-open-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text); font-size: .8rem; cursor: pointer;
  transition: border-color .15s; font-family: inherit;
}
.sp-open-btn:hover { border-color: var(--cyan); }
.sp-count { font-weight: 700; color: var(--cyan); }

/* Overlay */
.sp-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .72);
  z-index: 800;
  display: flex; align-items: flex-end; justify-content: center;
}

/* Panel — bottom-sheet mobile, centré desktop */
.sp-panel {
  background: var(--bg2); width: 100%; max-width: 900px;
  max-height: 88vh; display: flex; flex-direction: column;
  overflow: hidden; border-radius: 14px 14px 0 0;
  border: 1px solid var(--border);
}
@media (min-height: 600px) and (min-width: 600px) {
  .sp-overlay { align-items: center; padding: 20px; }
  .sp-panel   { border-radius: 14px; max-height: 85vh; }
}

/* En-tête modal */
.sp-modal-hdr {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sp-modal-top {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 8px;
}
.sp-tabs { display: flex; gap: 5px; }
.sp-tab {
  padding: 4px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); font-size: .8rem; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.sp-tab.active {
  background: var(--cyan); border-color: var(--cyan);
  color: #000; font-weight: 700;
}
.sp-prog-text { font-size: .75rem; color: var(--text-dim); margin-bottom: 5px; }
.sp-prog-bar  { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.sp-prog-fill { height: 100%; background: var(--cyan); border-radius: 3px; transition: width .4s; }

/* Corps scrollable */
.sp-body { overflow-y: auto; flex: 1; padding: 10px 12px 28px; scroll-behavior: smooth; }

/* Bloc semaine */
.sp-week  { margin-bottom: 14px; }
.sp-wk-lbl {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; color: var(--text-dim);
  letter-spacing: .06em; margin-bottom: 5px; padding-left: 2px;
}
.sp-wk-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* Cellules */
.sp-cell {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 5px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  min-height: 68px; transition: border-color .15s, background .15s;
  overflow: hidden; user-select: none;
}
.sp-cell:hover:not(.sp-rest) { border-color: var(--cyan); }
.sp-cell.done {
  background: rgba(0, 212, 255, .07);
  border-color: rgba(0, 212, 255, .3);
}
.sp-cell.nxt {
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 1px var(--cyan);
}
.sp-cell.sp-rest {
  cursor: default; opacity: .32; border-style: dashed;
  justify-content: center; align-items: center; text-align: center;
}

.sp-cell-lbl {
  font-size: .67rem; font-weight: 700;
  color: var(--text-dim); line-height: 1.2; flex-shrink: 0;
}
.sp-cell.done .sp-cell-lbl,
.sp-cell.nxt  .sp-cell-lbl { color: var(--cyan); }

.sp-cell-topic {
  font-size: .62rem; color: var(--text); line-height: 1.3; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.sp-cell.done .sp-cell-topic { color: var(--text-dim); }

.sp-cell-date {
  font-size: .58rem; color: var(--cyan); font-weight: 600;
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
  flex-shrink: 0;
}
.sp-nxt-lbl { color: var(--purple) !important; }

.sp-edit-btn {
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; font-size: .62rem; padding: 0 1px;
  opacity: .5; transition: opacity .15s; font-family: inherit; line-height: 1;
}
.sp-edit-btn:hover { opacity: 1; color: var(--cyan); }

/* Petits écrans */
@media (max-width: 500px) {
  .sp-cell       { min-height: 52px; padding: 4px 3px; }
  .sp-cell-lbl   { font-size: .6rem; }
  .sp-cell-topic { font-size: .56rem; }
  .sp-cell-date  { font-size: .54rem; }
}
