/* Règle de fond : l'attribut hidden gagne TOUJOURS, même si l'élément a un
   display: flex/grid ailleurs dans la feuille (sinon il reste visible —
   bug déjà rencontré 2× : sous-onglets .settings-group, grille d'inscription). */
[hidden] {
  display: none !important;
}

/* Verrou d'accès (beta privée) */
.access-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0f766e, #1e293b);
}
.access-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 10px;
  max-width: 360px;
  padding: 28px 26px;
  width: 100%;
}

/* Espace « Mon compte » */
.account-gate,
.plan-gate {
  align-items: flex-start;
  overflow-y: auto;
}
.account-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  margin: auto;
  max-width: 460px;
  width: 100%;
}
.account-head {
  align-items: center;
  border-bottom: 1px solid var(--line, #e8edf3);
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}
.account-head h2 {
  font-size: 19px;
  margin: 0;
}
.account-body {
  display: grid;
  gap: 18px;
  max-height: 75vh;
  overflow-y: auto;
  padding: 18px 20px 22px;
}
.account-section {
  display: grid;
  gap: 8px;
}
.account-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.account-section h3 {
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0;
  text-transform: uppercase;
}
.account-email {
  font-size: 14px;
  margin: 0 0 2px;
}
.account-section .secondary-button,
.account-section .danger-button {
  justify-self: start;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.account-msg {
  color: #e11d48;
  font-size: 13px;
  font-weight: 700;
  margin: 2px 0 0;
}
.account-msg.is-ok {
  color: #0d9488;
}

/* Footer + pages légales / tarifs */
.app-footer {
  align-items: center;
  border-top: 1px solid var(--line, #e8edf3);
  color: var(--muted, #64748b);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 28px;
  padding: 16px 4px 8px;
}
.footer-link {
  background: none;
  border: none;
  color: var(--muted, #64748b);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 2px 0;
}
.footer-link:hover {
  color: var(--teal, #0d9488);
  text-decoration: underline;
}
.footer-cta {
  color: var(--teal, #0d9488);
  font-weight: 800;
}
.footer-copy {
  color: var(--muted, #64748b);
  font-size: 12px;
  margin-left: auto;
}

.doc-modal {
  max-width: 640px;
}
.doc-body h3 {
  font-size: 15px;
  margin: 16px 0 4px;
}
.doc-body p {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 8px;
}
.doc-update {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-style: italic;
}
.doc-lead {
  font-size: 15px;
  font-weight: 700;
}
.doc-note,
.doc-disclaimer {
  background: #fff7ed;
  border-radius: 8px;
  font-size: 13px;
  padding: 8px 10px;
}
.doc-disclaimer {
  color: #92400e;
}

.price-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 6px 0 14px;
}
.price-card {
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  padding: 16px;
  position: relative;
}
.price-card.is-highlight {
  border-color: var(--teal, #0d9488);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.15);
}
.price-badge {
  background: var(--teal, #0d9488);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  position: absolute;
  right: 12px;
  top: -10px;
}
.price-card h3 {
  font-size: 16px;
  margin: 0;
}
.price-amount {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}
.price-amount span {
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 600;
}
.price-amount .price-was {
  color: var(--muted, #94a3b8);
  font-size: 16px;
  font-weight: 600;
  margin-right: 4px;
}
.price-amount .price-now {
  color: var(--teal, #0d9488);
}
.price-amount .price-promo-tag {
  background: #fde68a;
  border-radius: 999px;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  margin-left: 6px;
  padding: 2px 8px;
  vertical-align: middle;
}
.launch-promo-banner {
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  border-radius: 12px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  margin: 4px 0 12px;
  padding: 10px 14px;
  text-align: center;
}
.price-tagline {
  color: var(--muted, #64748b);
  font-size: 13px;
  margin: 0;
}
.price-features {
  display: grid;
  font-size: 13px;
  gap: 4px;
  list-style: none;
  margin: 4px 0;
  padding: 0;
}
.price-cta {
  margin-top: 6px;
}
.promo-row {
  align-items: end;
  border-top: 1px dashed var(--line, #e8edf3);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
}
.access-eyebrow {
  color: #0d9488;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}
.access-card h1 {
  font-size: 22px;
  margin: 0;
}
.access-hint {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 4px;
}
.access-input {
  border: 1px solid #e8edf3;
  border-radius: 10px;
  font: inherit;
  padding: 12px 14px;
  width: 100%;
}
.access-input:focus {
  border-color: #0d9488;
  outline: none;
}
.access-error {
  color: #e11d48;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}
.access-btn {
  background: #0d9488;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  padding: 12px;
}
.access-btn:hover {
  background: #0b7d72;
}
.access-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.access-error.is-ok {
  color: #0d9488;
}
/* Écran de connexion par compte (e-mail + mot de passe) */
.auth-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin: 4px 0 6px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #64748b;
  padding: 8px 6px;
}
.auth-tab.is-active {
  background: #fff;
  color: #0d9488;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.auth-field {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.auth-claim-note {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  color: #065f46;
  font-size: 13px;
  margin: 0;
  padding: 10px 12px;
}
.auth-forgot {
  background: none;
  border: none;
  color: #0d9488;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 2px;
  text-align: center;
}
.auth-forgot:hover {
  text-decoration: underline;
}
/* Mot de passe : champ + œil afficher/masquer */
.auth-password-wrap {
  align-items: center;
  display: flex;
  gap: 6px;
}
.auth-password-wrap .access-input {
  flex: 1;
}
.auth-eye {
  background: #f1f5f9;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  min-height: 42px;
  min-width: 44px;
}
.auth-eye:hover {
  background: #e2e8f0;
}
/* Case « Rester connecté » */
.auth-remember {
  align-items: center;
  color: #475569;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
}
.auth-remember input {
  accent-color: #0d9488;
  height: 16px;
  width: 16px;
}
/* Inscription : grille des informations demandées */
.auth-signup-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.auth-signup-grid .auth-field-full {
  grid-column: 1 / -1;
}
@media (max-width: 520px) {
  .auth-signup-grid {
    grid-template-columns: 1fr;
  }
}

/* Présentation animée de première connexion */
.intro-overlay {
  align-items: center;
  background: linear-gradient(160deg, #1d2233, #10131d 70%);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 300;
}
@supports (height: 100dvh) {
  .intro-overlay {
    height: 100dvh;
  }
}
.intro-card {
  display: grid;
  gap: 22px;
  max-width: 560px;
  text-align: center;
  width: 100%;
}
.intro-slide {
  animation: intro-in 0.55s ease both;
  display: grid;
  gap: 14px;
  justify-items: center;
  min-height: 250px;
}
@keyframes intro-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.intro-icon {
  animation: intro-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.1s;
  font-size: 64px;
}
@keyframes intro-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.intro-slide h2 {
  color: #f1f5f9;
  font-size: 26px;
  margin: 0;
}
.intro-slide p {
  color: #b7c0d4;
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
  max-width: 480px;
}
.intro-slide p strong {
  color: #5eead4;
}
.intro-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.intro-dot {
  background: #3a4157;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  height: 10px;
  padding: 0;
  transition: background 0.25s, width 0.25s;
  width: 10px;
}
.intro-dot.is-active {
  background: #2dd4bf;
  width: 26px;
}
.intro-actions {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: center;
}
.intro-skip {
  background: none;
  border: none;
  color: #8b96ad;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.intro-skip:hover {
  color: #cbd5e1;
}
.intro-next {
  font-size: 16px;
  min-width: 150px;
  padding: 12px 22px;
}
/* Page admin : table des signalements */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line, #e8edf3);
  font-size: 13px;
  vertical-align: top;
}
.admin-table th {
  font-weight: 800;
  color: #475569;
}
.admin-qcell {
  max-width: 360px;
}
.admin-subtitle {
  font-size: 14px;
  margin: 16px 0 6px;
}
.sub-badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  text-transform: capitalize;
}
.sub-active,
.sub-trialing {
  background: #ecfdf5;
  color: #065f46;
}
.sub-past_due,
.sub-incomplete,
.sub-unpaid {
  background: #fef3c7;
  color: #92400e;
}
.sub-canceled {
  background: #fee2e2;
  color: #991b1b;
}

.admin-shell {
  display: grid;
  gap: 14px;
}
.admin-test-zone {
  border: 1px solid #fbcfe8;
  background: #fff5f8;
}
.admin-reset-btn {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
  font-weight: 700;
}
.admin-reset-btn:hover {
  background: #fecaca;
}
.secondary-button.mini {
  font-size: 12px;
  padding: 4px 10px;
}

/* Forum de suggestions */
.feedback-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.feedback-item {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}
.fb-vote {
  align-items: center;
  background: #f4f6fb;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  min-width: 42px;
  padding: 6px 4px;
}
.fb-vote.is-voted {
  background: var(--teal-soft, #ccfbf1);
  border-color: #99f6e4;
  color: var(--teal, #0d9488);
}
.fb-vote span {
  font-size: 13px;
  margin-top: 3px;
}
.fb-body {
  flex: 1;
}
.fb-message {
  font-size: 14px;
  margin: 0 0 4px;
}
.fb-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fb-status {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
}
.fb-nouveau { background: #eef2ff; color: #3730a3; }
.fb-prevu { background: #fef3c7; color: #92400e; }
.fb-fait { background: #ecfdf5; color: #065f46; }
.fb-refuse { background: #fee2e2; color: #991b1b; }
.fb-status-select {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  font-size: 12px;
  padding: 3px 6px;
}
.review-options {
  display: grid;
  gap: 4px;
  list-style: none;
  padding: 0;
}
.review-options li {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  font-size: 13px;
  padding: 6px 10px;
}
.review-options li.is-correct {
  background: #ecfdf5;
  border-color: #99f6e4;
  font-weight: 700;
}

:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e8edf3;
  --paper: #f4f6f9;
  --surface: #ffffff;
  --navy: #1e293b;
  --teal: #0d9488;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #e11d48;
  --rose: #fce7f3;
  --teal-soft: #d6f3ee;
  --blue-soft: #e7efff;
  --amber-soft: #fdf0d9;
  --red-soft: #fde8ec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, Aptos, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  align-items: center;
  background: linear-gradient(135deg, #1e293b 0%, #273449 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 22px;
}

.eyebrow {
  color: #b7efe6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 2px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 19px;
  line-height: 1.1;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
}

h3 {
  font-size: 14px;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button,
.tab,
.primary-button,
.secondary-button,
.danger-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 34px;
  padding: 8px 14px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.icon-button:hover {
  box-shadow: var(--shadow-sm);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.icon-button {
  background: #f8fafc;
  color: var(--navy);
}

.file-button input {
  display: none;
}

.tab-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 5px 12px;
}

.tab {
  font-size: 13px;
  min-height: 34px;
}

.tab.is-active {
  box-shadow: inset 0 -2px 0 var(--teal);
}

.tab {
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.tab.is-active {
  background: var(--teal-soft);
  color: var(--teal);
}

body[data-interface-mode="Simple"] .tab[data-view="items"] {
  display: none;
}

body[data-interface-mode="Simple"] .expert-panel {
  display: none;
}

.tab-bar {
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

main {
  padding: 18px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.page-grid {
  display: grid;
  gap: 16px;
}

.simple-mode-note,
.load-more-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 13px 16px;
}

.panel-body {
  padding: 16px;
}

.panel-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  position: relative;
}

.kpi::before {
  background: var(--muted);
  border-radius: 999px;
  content: "";
  height: 8px;
  left: 16px;
  position: absolute;
  top: 18px;
  width: 8px;
}

.kpi-good::before {
  background: var(--green);
}

.kpi-mid::before {
  background: var(--amber);
}

.kpi-low::before {
  background: var(--red);
}

.kpi-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding-left: 16px;
  text-transform: uppercase;
}

.kpi-value {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.kpi-foot {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.priority-overview {
  display: grid;
  gap: 14px;
}

.priority-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.priority-summary-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 10px;
}

.priority-summary-card span,
.priority-rule-main em,
.priority-weight small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.priority-summary-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.priority-rules {
  display: grid;
  gap: 8px;
}

.priority-rule {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr) minmax(92px, 0.22fr);
  padding: 10px;
}

.priority-rule-rank {
  align-items: center;
  background: var(--navy);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.priority-rule-main {
  display: grid;
  gap: 4px;
}

.priority-rule-main span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.priority-rule-meter {
  background: #e5e7eb;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.priority-rule-meter span {
  background: var(--teal);
  display: block;
  height: 100%;
}

.priority-weights {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.priority-weight {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 9px;
}

.priority-weight span {
  color: var(--teal);
  font-size: 18px;
  font-weight: 800;
}

.priority-tuning {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.priority-tuning-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.priority-tuning-head h3 {
  font-size: 15px;
  margin: 0;
}

.priority-weights-edit {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.priority-weight-edit {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.priority-weight-edit .pw-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.priority-weight-edit .pw-head em {
  color: var(--teal);
  font-size: 16px;
  font-style: normal;
  font-weight: 800;
}

.priority-weight-edit input[type="range"] {
  width: 100%;
}

.priority-weight-edit small,
.priority-guarantee-edit small {
  color: var(--muted);
}

.priority-guarantees-edit {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.priority-guarantee-edit {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.priority-guarantee-edit input[type="number"] {
  width: 100%;
}

.context-followup {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr);
}

.context-source,
.context-suggestion {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.context-source span,
.context-source small,
.context-suggestion span,
.context-suggestion small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.context-source strong,
.context-suggestion strong {
  line-height: 1.3;
}

.context-suggestions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.annale-focus {
  display: grid;
  gap: 14px;
}

.annale-focus-items {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.annale-focus-item,
.annale-question-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.annale-focus-item {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.annale-focus-item span,
.annale-focus-item small,
.annale-card-head span,
.annale-card-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.annale-question-list {
  display: grid;
  gap: 12px;
}

.annale-question-list.is-compact {
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.annale-question-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.annale-card-head {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.annale-card-head > div {
  display: grid;
  gap: 4px;
}

.annale-context {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.annale-context summary,
.annale-question-kind {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.annale-context p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 8px;
}

.annale-question-text {
  font-size: 14px;
  line-height: 1.45;
}

.annale-options {
  display: grid;
  gap: 6px;
}

.annale-option {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: 28px minmax(0, 1fr);
  line-height: 1.35;
  padding: 8px;
}

.annale-option span {
  color: var(--blue);
  font-weight: 900;
}

.annale-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-panel {
  border-color: #9ddfd5;
}

.first-entry-guide {
  border-color: #9ddfd5;
  border-left: 4px solid var(--teal);
}

.lateness-banner {
  background: var(--amber-soft);
  border-color: #f3d9a6;
  border-left: 4px solid var(--amber);
}
.fatigue-banner {
  background: #fdf2f8;
  border-color: #f6cfe3;
  border-left: 4px solid #db2777;
}

.lateness-banner .panel-body {
  color: #7c4a05;
}

.first-entry-guide p {
  color: var(--muted);
  margin: 0 0 14px;
}

.cockpit-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.7fr);
}

.cockpit-main,
.cockpit-side,
.cockpit-empty {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.cockpit-main h3 {
  font-size: 18px;
  line-height: 1.25;
}

.cockpit-main p,
.cockpit-side p,
.cockpit-side small,
.cockpit-empty span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cockpit-actions,
.backup-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.reason-chips span {
  background: var(--blue-soft);
  border-radius: 999px;
  color: var(--blue);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  white-space: nowrap;
}

.matiere-summary {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.matiere-summary strong {
  color: var(--ink);
  font-size: 12px;
}

.matiere-summary span,
.matiere-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.matiere-summary .override-note {
  color: var(--teal);
}

.matiere-editor {
  display: grid;
  gap: 7px;
  min-width: 210px;
}

.matiere-editor select {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 34px;
  padding: 6px;
  width: 100%;
}

.tiny-button {
  min-height: 28px;
  padding: 5px 8px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.comfort-toggle label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.comfort-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}
.comfort-launch-note {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Barre de lancement des modifications essentielles */
.launch-bar {
  position: sticky;
  bottom: 10px;
  z-index: 30;
  margin-top: 16px;
}
.launch-bar-inner {
  background: var(--blue-soft, #e7efff);
  border: 2px solid var(--blue, #2563eb);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}
.launch-bar-head {
  font-weight: 800;
  color: var(--ink, #1e293b);
  margin-bottom: 6px;
}
.launch-bar-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink, #1e293b);
}
.launch-bar-list li {
  margin: 2px 0;
}
.launch-bar-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.launch-cancel {
  background: transparent;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}
.launch-cancel:hover {
  color: var(--ink, #1e293b);
}
.field-pending > label::after {
  content: " • à lancer";
  color: var(--blue, #2563eb);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.feature-lock {
  border: 1px dashed var(--blue, #2563eb);
  background: var(--blue-soft, #e7efff);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.feature-lock p {
  margin: 0 0 8px;
}
.feature-lock .primary-button {
  margin-top: 4px;
}

.reclass-panel {
  background: var(--amber-soft, #fef3c7);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  display: grid;
  gap: 10px;
  margin: 0 16px 12px;
  padding: 14px;
}

.reclass-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.reclass-head > strong {
  color: #92400e;
  font-size: 14px;
}

.reclass-count {
  background: #f59e0b;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
}

.reclass-head > span:last-child {
  color: #92400e;
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.reclass-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.reclass-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 11px 12px;
}

.reclass-card-head {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.reclass-card-head > strong {
  font-size: 13px;
  line-height: 1.3;
}

.reclass-badge {
  background: var(--amber-soft, #fef3c7);
  border: 1px solid #fcd34d;
  border-radius: 999px;
  color: #92400e;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  white-space: nowrap;
}

.reclass-current {
  display: grid;
  gap: 1px;
}

.reclass-current-main {
  font-size: 12px;
}

.reclass-current-main strong {
  color: var(--teal, #0d9488);
}

.reclass-current-ref {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.reclass-pick {
  display: grid;
  gap: 6px;
}

.reclass-pick-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.reclass-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reclass-chip {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.reclass-chip:hover {
  border-color: var(--teal, #0d9488);
}

.reclass-chip.is-active {
  background: var(--teal-soft, #ccfbf1);
  border-color: var(--teal, #0d9488);
  color: #0f766e;
}

.reclass-other {
  font-size: 12px;
}

.reclass-other summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.reclass-other select {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 6px;
  min-height: 34px;
  padding: 6px;
  width: 100%;
}

.reclass-history {
  margin: 0 16px 12px;
}

.reclass-history > summary {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.reclass-history > summary .reclass-count {
  background: var(--muted);
}

.reclass-history-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.reclass-history-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: space-between;
  padding: 8px 11px;
}

.reclass-history-main {
  display: grid;
  gap: 2px;
}

.reclass-history-main > strong {
  font-size: 12px;
  line-height: 1.3;
}

.reclass-history-change {
  color: var(--muted);
  font-size: 12px;
}

.reclass-history-change strong {
  color: var(--teal, #0d9488);
}

.reclass-history-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 700;
  gap: 6px 10px;
}

.reclass-history-revert {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal, #0d9488);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
}

.reclass-history-revert:hover {
  background: var(--teal, #0d9488);
  color: #fff;
}

.backup-panel,
.backup-list {
  display: grid;
  gap: 10px;
}

.lca-dashboard {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.lca-dashboard > div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 84px;
  padding: 10px;
}

.lca-dashboard strong {
  font-size: 18px;
}

.lca-dashboard span,
.lca-day-picker strong,
.lca-override-box strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lca-settings {
  display: grid;
  gap: 14px;
}

.focus-settings {
  display: grid;
  gap: 12px;
}

.focus-row {
  border-left: 4px solid var(--teal);
}

.focus-row.is-past {
  opacity: 0.62;
}

.lca-day-picker,
.lca-override-box {
  display: grid;
  gap: 8px;
}

.lca-day-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-pill {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
}

.day-pill input {
  width: auto;
}

.compact-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.schedule-profiles,
.schedule-day-list,
.schedule-block-list {
  display: grid;
  gap: 12px;
}

.schedule-profile-toolbar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.45fr) auto auto;
}

.schedule-history-note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.schedule-history-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.schedule-copy-hint span {
  font-weight: 600;
}

.schedule-templates {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}
.schedule-templates-head {
  display: grid;
  gap: 2px;
}
.schedule-templates-apply,
.schedule-template-save {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.schedule-template-save input {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  flex: 1 1 200px;
  min-height: 34px;
  padding: 6px 10px;
}
.schedule-template-list {
  display: grid;
  gap: 6px;
}
.schedule-template-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
}
.schedule-template-row strong {
  flex: 1 1 auto;
}
.primary-button.mini,
.secondary-button.mini {
  font-size: 12px;
  padding: 4px 10px;
}

.schedule-clipboard-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
}

.schedule-clipboard-bar span {
  color: var(--ink, #1e293b);
  font-size: 14px;
}

.schedule-clipboard-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-day-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 10px;
}

.schedule-day-head {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(110px, 0.4fr) minmax(70px, 0.2fr) repeat(3, minmax(110px, 0.3fr));
}

.schedule-block-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 34px minmax(130px, 0.75fr) minmax(90px, 0.35fr) minmax(130px, 0.55fr) minmax(80px, 0.25fr) minmax(145px, 0.45fr) minmax(70px, 0.2fr) auto;
  padding: 8px;
}

.block-time-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  min-height: 28px;
  padding: 5px 8px;
  white-space: nowrap;
}

.block-time-preview.is-overflow {
  background: var(--red-soft);
  color: var(--red);
}

.mini-check {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.mini-check input {
  width: auto;
}

.backup-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px;
}

.backup-row div {
  display: grid;
  gap: 3px;
}

.backup-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.progress {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
}

.progress span {
  background: var(--teal);
  display: block;
  height: 100%;
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.annale-toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 180px);
}

.field {
  display: grid;
  gap: 5px;
}

.field.is-hidden,
.score-group.is-hidden {
  display: none;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 36px;
  padding: 8px 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
  outline: none;
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.score-preview {
  align-items: center;
  background: #eef8f6;
  border: 1px solid #b9ded8;
  border-radius: 6px;
  color: var(--teal);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  min-height: 36px;
  padding: 8px;
}

.score-group {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 10px;
}

.score-group > strong {
  font-size: 13px;
}

.score-group-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 1fr) minmax(110px, 0.8fr) minmax(90px, 0.6fr) minmax(180px, 1.5fr);
}

.inline-check {
  align-items: center;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  min-height: 36px;
  padding: 8px;
}

.inline-check input {
  width: auto;
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

.secondary-button {
  background: var(--blue-soft);
  color: var(--blue);
}

.danger-button {
  background: var(--red-soft);
  color: var(--red);
}

.table-wrap {
  overflow: auto;
}

.plan-row.status-work td:first-child {
  border-left: 4px solid var(--teal);
}

.plan-row.status-qcm td:first-child {
  border-left: 4px solid var(--blue);
}

.plan-row.status-lca td:first-child {
  border-left: 4px solid var(--amber);
}

.plan-row.status-break td:first-child {
  border-left: 4px solid var(--muted);
}

.plan-row.status-unavailable td:first-child,
.plan-row.status-off td:first-child {
  border-left: 4px solid var(--red);
}

.plan-row {
  cursor: pointer;
}

.plan-row:hover td,
.plan-row:focus td {
  background: #eef8f6;
}

.plan-day-head td {
  background: #f1f6fb;
  border-top: 2px solid var(--line);
  padding: 8px 12px;
}

.plan-day-head .day-head-date {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-right: 12px;
}

.plan-day-head .day-head-matieres {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  vertical-align: middle;
}

.day-matiere-chip {
  background: var(--teal);
  border-radius: 999px;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 10px;
}

.day-matiere-chip.is-empty {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
}

.plan-detail-overlay {
  align-items: center;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 80;
}

.plan-detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  max-height: min(760px, calc(100vh - 36px));
  max-width: 820px;
  overflow: auto;
  width: min(820px, 100%);
}

.plan-detail-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.plan-detail-head > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-detail-main {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.plan-detail-main h2 {
  font-size: 22px;
  line-height: 1.25;
}

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

.detail-meta-grid div,
.detail-instruction {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.detail-meta-grid span,
.detail-instruction p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.detail-occ-list {
  display: grid;
  gap: 3px;
  list-style: none;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  padding: 0;
}
.detail-occ-list li {
  border-radius: 6px;
  font-size: 12.5px;
  padding: 3px 8px;
}
.detail-occ-list li.is-current {
  background: var(--teal-soft, #ccfbf1);
  font-weight: 800;
}
.detail-occ-list .occ-here {
  color: var(--teal, #0d9488);
  font-weight: 800;
}

.plan-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

table {
  border-collapse: collapse;
  min-width: 100%;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f1f5f9;
  border-bottom: 2px solid var(--line);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

td input,
td select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 32px;
  padding: 6px 8px;
  width: 100%;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

tbody tr:hover {
  background: #eef8f6;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.score-cell {
  min-width: 120px;
  text-align: right;
  white-space: normal;
}

.score-cell span {
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  margin-top: 2px;
}

.status-chip {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  white-space: nowrap;
}

.status-work {
  background: var(--rose);
  color: #9d174d;
}

.status-break {
  background: #eef2f7;
  color: var(--muted);
}

.status-qcm {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-lca {
  background: #dcfce7;
  color: #166534;
}

.status-j-due {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-off {
  background: #eef2f7;
  color: var(--muted);
}

.status-unavailable {
  background: var(--red-soft);
  color: var(--red);
}

.status-ccb {
  background: var(--amber-soft);
  color: var(--amber);
}

.item-title-cell {
  align-items: flex-start;
  display: inline-flex;
  gap: 6px;
}

.star-toggle {
  background: transparent;
  border: none;
  color: #cbd5e1;
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}

.star-toggle.is-on {
  color: var(--amber);
}

.bonus-item {
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  max-width: 260px;
}

.score-high {
  color: var(--green);
  font-weight: 800;
}

.score-mid {
  color: var(--amber);
  font-weight: 800;
}

.score-low {
  color: var(--red);
  font-weight: 800;
}

.split {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(310px, 0.9fr) minmax(0, 1.4fr);
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid .wide {
  grid-column: span 2;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.compact-toolbar {
  grid-template-columns: minmax(130px, 1fr);
  min-width: 170px;
}

.agenda-toolbar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px minmax(170px, 1fr) 42px minmax(120px, 0.8fr) minmax(150px, 0.9fr) minmax(110px, auto);
}

.agenda-arrow {
  font-size: 18px;
  min-width: 42px;
  padding-left: 0;
  padding-right: 0;
}

.agenda-period {
  align-items: center;
  display: flex;
  min-height: 36px;
  text-transform: capitalize;
}

.analysis-stack {
  display: grid;
  gap: 16px;
}

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

.week-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.week-card-header {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.week-card-header h3 {
  font-size: 15px;
}

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

.week-metrics div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 8px;
}

.week-metrics strong {
  font-size: 16px;
}

.week-metrics span,
.week-section p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.week-day-overview {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.week-day {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 7px;
}

.week-day strong {
  font-size: 12px;
}

.week-day span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.week-day small {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.week-day.has-fixed {
  background: var(--amber-soft);
}

.week-day.is-empty {
  opacity: 0.62;
}

.day-bars {
  display: flex;
  gap: 2px;
  height: 6px;
  min-width: 0;
}

.day-bars i {
  border-radius: 999px;
  min-width: 3px;
}

.bar-work {
  background: var(--teal);
}

.bar-qcm {
  background: var(--blue);
}

.bar-lca {
  background: var(--amber);
}

.week-section {
  display: grid;
  gap: 4px;
}

.week-section p {
  line-height: 1.4;
}

.agenda-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(120px, 1fr));
  max-height: 620px;
  overflow: auto;
}

.agenda-board.is-day {
  grid-template-columns: 72px minmax(220px, 1fr);
}

.agenda-board-blocks {
  grid-template-columns: 72px repeat(var(--agenda-day-count), minmax(180px, 1fr));
  grid-template-rows: auto var(--agenda-grid-height);
}

.agenda-board-blocks.is-day {
  grid-template-columns: 72px minmax(260px, 1fr);
}

.agenda-corner,
.agenda-day-head,
.agenda-time {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.agenda-corner {
  left: 0;
  z-index: 3;
}

.agenda-day-head {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px;
}

.agenda-day-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.agenda-time {
  align-items: start;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: end;
  left: 0;
  min-height: 44px;
  padding: 6px 8px;
  position: sticky;
  z-index: 1;
}

.agenda-time-column {
  background: #f8fafc;
  border-right: 1px solid var(--line);
  min-height: var(--agenda-grid-height);
  position: sticky;
  left: 0;
  z-index: 1;
}

.agenda-time-label {
  align-items: start;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 48px;
  justify-content: end;
  padding: 6px 8px;
}

.agenda-slot {
  align-content: start;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: grid;
  gap: 3px;
  min-height: 44px;
  padding: 4px;
  text-align: left;
}

.agenda-day-column {
  background:
    repeating-linear-gradient(
      to bottom,
      #fff 0,
      #fff 47px,
      var(--line) 47px,
      var(--line) 48px
    );
  border-right: 1px solid var(--line);
  min-height: var(--agenda-grid-height);
  position: relative;
}

.agenda-slot-cell {
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  height: 48px;
  left: 0;
  padding: 0;
  position: absolute;
  right: 0;
  top: var(--slot-top);
  width: 100%;
}

.agenda-slot-cell:hover {
  background: rgba(8, 127, 114, 0.08);
}

.agenda-prep-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(var(--agenda-day-count), minmax(140px, 1fr));
  margin-bottom: 10px;
}

.agenda-prep-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 9px;
}

.agenda-prep-card.is-today {
  border-color: #9bd7cd;
  box-shadow: inset 0 0 0 1px #9bd7cd;
}

.agenda-prep-card strong {
  font-size: 12px;
}

.agenda-prep-card span,
.agenda-prep-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.agenda-block {
  border: 1px solid transparent;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  height: var(--block-height);
  left: 5px;
  overflow: hidden;
  padding: 5px 6px;
  cursor: pointer;
  pointer-events: auto;
  position: absolute;
  right: 5px;
  top: var(--block-top);
  z-index: 2;
}

.agenda-block strong {
  font-size: 11px;
  line-height: 1.15;
}

.agenda-block span,
.agenda-block small,
.agenda-block em {
  display: block;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-block small,
.agenda-block em {
  color: inherit;
  opacity: 0.78;
}
/* Libellé principal efficace (« QCM · item 285 · Cardiologie ») */
.agenda-block .agenda-block-main {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.18;
  opacity: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Créneau court : on ne garde que le libellé principal (lisible d'un coup d'œil) */
.agenda-block.is-compact {
  gap: 0;
}
.agenda-block.is-compact .agenda-block-time,
.agenda-block.is-compact .agenda-block-sub,
.agenda-block.is-compact .agenda-exam-tag {
  display: none;
}

.agenda-slot:hover,
.agenda-month-day:hover {
  background: var(--teal-soft);
}
.agenda-hint {
  font-size: 12.5px;
  margin: 0 0 8px;
}
/* Mes livres possédés */
.book-master {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}
.book-master input { margin-top: 2px; }
.book-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.book-tobuy {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  font-size: 13px;
  margin-bottom: 10px;
  padding: 8px 12px;
}
.book-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.book-check {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 7px;
  padding: 6px 10px;
}
.book-check.is-owned {
  background: var(--teal-soft, #ccfbf1);
  border-color: var(--teal, #0d9488);
  font-weight: 700;
}
.books-reminder {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  color: #9a3412;
  margin-bottom: 12px;
  padding: 10px 14px;
}
.books-reminder ul { margin: 4px 0 0; padding-left: 20px; }
.books-reminder li { font-size: 13px; }
/* Écran d'attente du 1er calcul : barre animée en transform (bouge même si le JS est occupé) */
.agenda-loading {
  display: grid;
  gap: 12px;
  padding: 48px 20px;
  text-align: center;
}
.agenda-loading-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}
.agenda-loading-bar {
  background: #e8edf3;
  border-radius: 999px;
  height: 10px;
  margin: 0 auto;
  max-width: 420px;
  overflow: hidden;
  position: relative;
  width: 100%;
}
.agenda-loading-bar span {
  background: linear-gradient(90deg, var(--teal, #0d9488), #14b8a6);
  border-radius: 999px;
  bottom: 0;
  left: 0;
  position: absolute;
  top: 0;
  width: 40%;
  animation: agenda-load 1.1s ease-in-out infinite;
  will-change: transform;
}
@keyframes agenda-load {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}
.agenda-loading-note {
  margin: 0 auto;
  max-width: 520px;
}
/* Créneaux de révision colorés selon l'examen (partiel/CC) qu'ils préparent */
.plan-row.has-exam > td {
  background: color-mix(in srgb, var(--exam-color) 14%, transparent);
}
.plan-row.has-exam > td:first-child {
  box-shadow: inset 4px 0 0 var(--exam-color);
}
/* Bloc agenda (semaine/jour) préparant un examen : teinte de sa couleur */
.agenda-block.has-exam {
  background: color-mix(in srgb, var(--exam-color) 20%, #fff);
  border-color: var(--exam-color);
  box-shadow: inset 4px 0 0 var(--exam-color);
}
.agenda-exam-tag {
  color: var(--exam-color);
  font-weight: 700;
}
/* Pastilles plan (vue mois) préparant un examen : même couleur, teintée */
.agenda-event.has-exam {
  background: color-mix(in srgb, var(--exam-color) 24%, #fff);
  border: 1px solid var(--exam-color);
  color: #0f172a;
}
/* JOUR du partiel/CC : bloc plein-jour, couleur VIVE */
.agenda-event.is-partiel-day {
  background: var(--exam-color);
  border-radius: 6px;
  color: #fff;
  display: block;
  font-weight: 800;
  padding: 3px 8px;
  text-align: center;
}
.agenda-event.is-partiel-start {
  background: color-mix(in srgb, var(--exam-color) 18%, #fff);
  border: 1px dashed var(--exam-color);
  color: #0f172a;
  font-weight: 700;
}
.exam-chip {
  background: var(--exam-color, #2563eb);
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  margin-left: 6px;
  padding: 1px 7px;
  white-space: nowrap;
}
.exam-dot {
  background: var(--exam-color, #2563eb);
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  margin-right: 6px;
  vertical-align: middle;
  width: 10px;
}
.exam-recap {
  background: #f8fafc;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  padding: 8px 12px;
}
.exam-recap > summary {
  cursor: pointer;
  font-weight: 800;
}
.exam-recap-table {
  font-size: 12.5px;
  width: 100%;
}
.agenda-range-banner {
  align-items: center;
  background: #ecfeff;
  border: 1px solid var(--teal, #0d9488);
  border-radius: 10px;
  color: #0f766e;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 12px;
}
[data-agenda-slot].is-range-anchor {
  background: var(--teal, #0d9488) !important;
  box-shadow: inset 0 0 0 2px #0f766e;
}

.agenda-all-day {
  display: grid;
  gap: 3px;
}

.agenda-event {
  border-radius: 5px;
  display: block;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  padding: 3px 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-event.is-work,
.agenda-event:not(.is-off):not(.is-unavailable):not(.is-ccb):not(.is-lca) {
  background: var(--teal-soft);
  color: var(--teal);
}

.agenda-event.is-off {
  background: #eef2f7;
  color: var(--muted);
}

.agenda-event.is-unavailable {
  background: var(--red-soft);
  color: var(--red);
}

.agenda-event.is-ccb {
  background: var(--amber-soft);
  color: var(--amber);
}

.agenda-event.is-plan {
  background: var(--teal-soft);
  color: var(--teal);
}

.agenda-event.is-stage {
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 800;
}

.agenda-block.is-stage {
  background: repeating-linear-gradient(45deg, #eef2ff, #eef2ff 7px, #e0e7ff 7px, #e0e7ff 14px);
  border-color: #c7d2fe;
  color: #3730a3;
}

.agenda-block.is-plan,
.agenda-block.is-work {
  background: var(--teal-soft);
  border-color: #a7ded7;
  color: var(--teal);
}

.agenda-event.is-break {
  background: #eef2f7;
  color: var(--muted);
}

.agenda-block.is-break {
  background: #eef2f7;
  border-color: #d7dee8;
  color: var(--muted);
}

.agenda-event.is-qcm {
  background: var(--blue-soft);
  color: var(--blue);
}

.agenda-block.is-qcm {
  background: var(--blue-soft);
  border-color: #bad0ff;
  color: var(--blue);
}

.agenda-event.is-lca {
  background: #dcfce7;
  color: #166534;
}

.agenda-block.is-lca {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.agenda-block.is-off {
  background: #eef2f7;
  border-color: #d7dee8;
  color: var(--muted);
}

.agenda-block.is-unavailable {
  background: var(--red-soft);
  border-color: #f3b7b7;
  color: var(--red);
}

.agenda-block.is-ccb {
  background: var(--amber-soft);
  border-color: #f4d191;
  color: var(--amber);
}

.agenda-month {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.agenda-month h3 {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-transform: capitalize;
}

.agenda-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-month-day {
  align-content: start;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  min-height: 94px;
  padding: 6px;
  text-align: left;
}

.agenda-month-day:nth-child(7n) {
  border-right: 0;
}

.agenda-month-day.is-empty {
  background: #f8fafc;
  color: #94a3b8;
}

.agenda-month-day.is-today {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

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

.readiness-grid div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  padding: 10px;
}

.readiness-grid strong {
  font-size: 20px;
}

.readiness-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.month-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.month-card h3 {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-transform: capitalize;
}

.week-head,
.month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.week-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 6px;
  text-align: center;
}

.calendar-day {
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  min-height: 78px;
  padding: 5px;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.is-empty {
  background: #f8fafc;
  color: #94a3b8;
}

.calendar-day.is-today {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.calendar-date {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.calendar-chip {
  border-radius: 5px;
  display: block;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 3px;
  overflow: hidden;
  padding: 3px 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-chip.is-work {
  background: var(--teal-soft);
  color: var(--teal);
}

.calendar-chip.is-qcm {
  background: var(--blue-soft);
  color: var(--blue);
}

.calendar-chip.is-off {
  background: #eef2f7;
  color: var(--muted);
}

.calendar-chip.is-unavailable {
  background: var(--red-soft);
  color: var(--red);
}

.calendar-chip.is-ccb {
  background: var(--amber-soft);
  color: var(--amber);
}

.day-grid {
  display: grid;
  gap: 8px;
}

.day-row,
.block-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 92px 68px 84px 84px 70px 90px;
}

.block-row {
  grid-template-columns: 52px minmax(110px, 1fr) 90px 86px 68px;
}

.duration-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

@media (max-width: 980px) {
  .toolbar,
  .agenda-toolbar,
  .schedule-profile-toolbar,
  .schedule-day-head,
  .schedule-block-row,
  .score-group-grid,
  .split {
    grid-template-columns: 1fr;
  }

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

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

  .form-grid .wide {
    grid-column: auto;
  }

  .form-grid .full {
    grid-column: 1 / -1;
  }

  .day-row {
    grid-template-columns: 1fr 1fr;
  }

  .week-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .week-day-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .priority-rule {
    align-items: start;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .priority-rule-meter {
    grid-column: 1 / -1;
  }

  .context-followup {
    grid-template-columns: 1fr;
  }

  .annale-card-head {
    display: grid;
  }

  .cockpit-layout {
    grid-template-columns: 1fr;
  }

  .plan-detail-overlay {
    align-items: stretch;
    padding: 10px;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .plan-detail-main h2 {
    font-size: 18px;
  }
}

@media (max-width: 620px) {
  main {
    padding: 8px;
  }

  .dashboard-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide,
  .form-grid .full {
    grid-column: auto;
  }

  .app-header {
    padding: 8px 12px;
  }
}

/* --- Plan du jour figé : créneaux faits / non faits --- */
.agenda-block.is-done {
  opacity: 0.6;
  filter: grayscale(0.55);
}

.agenda-block.is-done::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(15, 23, 42, 0.05) 0 6px, rgba(15, 23, 42, 0) 6px 12px);
  border-radius: inherit;
  pointer-events: none;
}

.agenda-block.is-skip {
  opacity: 0.45;
  filter: grayscale(0.85);
  text-decoration: line-through;
}

.agenda-block.is-hard {
  box-shadow: inset 3px 0 0 var(--amber);
}

.agenda-done-badge {
  display: inline-block;
  align-self: flex-start;
  margin: 2px 0;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(22, 163, 74, 0.16);
  color: var(--green);
}

.agenda-block.is-skip .agenda-done-badge {
  background: rgba(225, 29, 72, 0.14);
  color: var(--red);
}

.plan-row.is-done td {
  opacity: 0.62;
}

.plan-row.is-skip td {
  opacity: 0.45;
  text-decoration: line-through;
}

.row-done-flag {
  margin-left: 6px;
  font-weight: 700;
  color: var(--green);
}

.plan-row.is-skip .row-done-flag {
  color: var(--red);
}

.planned-note {
  display: block;
  font-size: 11px;
  color: var(--muted, #64748b);
  text-decoration: none;
}

.detail-done-note {
  margin: 4px 0 0;
  font-weight: 600;
  color: var(--green);
}

#agendaRefreshPlan {
  font-weight: 600;
}

/* --- Sélecteur de profil --- */
.profile-chip {
  font-weight: 600;
}

body[data-gate="1"] #app {
  display: none;
}

.profile-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #0f172a, #1e293b);
}

.profile-gate-card {
  width: min(560px, 100%);
  background: var(--paper, #f4f6f9);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 18px 48px rgba(15, 23, 42, 0.35));
  padding: 28px;
}

.profile-gate-card h2 {
  margin: 4px 0 6px;
}

.profile-gate-sub {
  color: var(--muted, #64748b);
  margin: 0 0 18px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border: 1px solid var(--line, #e8edf3);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.05s;
}

.profile-card:hover {
  border-color: var(--teal, #0d9488);
}

.profile-card:active {
  transform: scale(0.98);
}

.profile-card.is-active {
  border-color: var(--teal, #0d9488);
  box-shadow: inset 0 0 0 1px var(--teal, #0d9488);
}

.profile-avatar {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--teal, #0d9488);
  color: #fff;
  font-weight: 700;
}

.profile-name {
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}

.profile-empty {
  color: var(--muted, #64748b);
  margin: 0 0 14px;
}

.profile-create {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-create input {
  flex: 1 1 200px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e8edf3);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
}

.profile-gate-cancel {
  margin-top: 14px;
}

/* --- Notice / guide pas-à-pas --- */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
}

.help-card {
  width: min(540px, 100%);
  background: #fff;
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 18px 48px rgba(15, 23, 42, 0.35));
  padding: 24px 26px;
}

.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-card h2 {
  margin: 2px 0 10px;
}

.help-body {
  color: var(--ink, #1e293b);
  line-height: 1.5;
}

.help-body ul {
  margin: 8px 0;
  padding-left: 20px;
}

.help-body li {
  margin: 3px 0;
}

.help-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 18px 0 16px;
}

.help-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line, #e8edf3);
}

.help-dot.is-on {
  background: var(--teal, #0d9488);
}

.help-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.help-actions .primary-button {
  margin-left: auto;
}

.spacing-preview {
  font-weight: 700;
  color: var(--teal, #0d9488);
  letter-spacing: 0.2px;
}

/* --- Onglet Guide pas à pas --- */
.guide-intro {
  color: var(--ink, #1e293b);
  line-height: 1.5;
  margin-bottom: 12px;
}
.guide-feature {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  margin-bottom: 8px;
  padding: 4px 12px;
}
.guide-feature summary {
  cursor: pointer;
  font-weight: 800;
  padding: 6px 0;
}
.guide-feature-body {
  color: var(--ink, #1e293b);
  line-height: 1.55;
  padding: 4px 0 10px;
}
.guide-feature-body ul {
  margin: 4px 0;
  padding-left: 18px;
}
.guide-feature-body li {
  margin-bottom: 5px;
}

.guide-progress {
  height: 8px;
  background: var(--line, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.guide-progress-bar {
  height: 100%;
  background: var(--teal, #0d9488);
  transition: width 0.3s ease;
}

.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.guide-step {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 12px);
  background: #fff;
}

.guide-step.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.guide-step-num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal, #0d9488);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-step.is-done .guide-step-num {
  background: #22c55e;
}

.guide-step-body {
  flex: 1;
}

.guide-step-body strong {
  display: block;
  margin-bottom: 2px;
}

.guide-step-body p {
  margin: 4px 0 10px;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.guide-step-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.guide-done-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted, #64748b);
  cursor: pointer;
}

.guide-intro-soft {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: var(--radius, 12px);
  padding: 10px 14px;
  color: var(--ink, #1e293b);
}

.guide-how {
  margin: 4px 0 10px;
}

.guide-how > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal, #0d9488);
  font-size: 14px;
  list-style: none;
}

.guide-how > summary::-webkit-details-marker { display: none; }

.guide-how > summary::before {
  content: "▸ ";
}

.guide-how[open] > summary::before {
  content: "▾ ";
}

.guide-how-list {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--ink, #1e293b);
  line-height: 1.45;
}

.guide-step-tip {
  margin: 6px 0 10px !important;
  background: #f0fdfa;
  border-left: 3px solid var(--teal, #0d9488);
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink, #1e293b) !important;
  font-size: 14px;
}

.guide-step-warn {
  margin: 6px 0 10px !important;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 8px 12px;
  border-radius: 8px;
  color: #92400e !important;
  font-size: 14px;
}

/* --- Couverture & faisabilité --- */
.coverage-panel.is-warn {
  border-left: 4px solid #f59e0b;
}

.coverage-panel.is-ok {
  border-left: 4px solid #22c55e;
}

.coverage-ok {
  color: #15803d;
  font-weight: 600;
}

.coverage-warn {
  color: #b45309;
  font-weight: 600;
}

.coverage-autonudge {
  align-items: center;
  background: var(--teal-soft, #ccfbf1);
  border: 1px solid var(--teal, #0d9488);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: 10px 0;
  padding: 10px 12px;
}

.coverage-autonudge span {
  color: #0f766e;
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  min-width: 220px;
}

.coverage-levers {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.coverage-levers span {
  color: var(--muted, #64748b);
}

.coverage-seenonce {
  margin: 12px 0;
  padding: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius, 12px);
}

.coverage-seenonce p {
  margin: 4px 0 8px;
}

.coverage-details {
  margin: 10px 0;
}

.coverage-details summary {
  cursor: pointer;
  color: var(--teal, #0d9488);
}

.coverage-list {
  max-height: 200px;
  overflow: auto;
  margin: 8px 0 0;
  padding-left: 18px;
}

.coverage-list li {
  margin: 2px 0;
}

.coverage-subtitle {
  margin: 14px 0 8px;
  font-size: 15px;
}

.coverage-matieres {
  display: grid;
  gap: 6px;
}

.coverage-mat-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.coverage-mat-bar {
  height: 8px;
  background: var(--line, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
}

.coverage-mat-bar > div {
  height: 100%;
  background: var(--teal, #0d9488);
}

.coverage-overdue {
  margin: 12px 0;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius, 12px);
}

.coverage-overdue p {
  margin: 4px 0 8px;
}

.config-health {
  border-left: 4px solid #ef4444;
}

.config-health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.step-flash {
  animation: stepFlash 1.8s ease;
  border-radius: 8px;
}

@keyframes stepFlash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
  }
  15% {
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.45);
  }
  60% {
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.25);
  }
}

/* --- Assistant de démarrage --- */
.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
}

.setup-field {
  display: block;
  margin-top: 12px;
  font-weight: 600;
}

.setup-field select {
  display: block;
  margin-top: 6px;
  width: 100%;
}

.setup-days {
  display: grid;
  gap: 8px;
  margin: 12px 0 4px;
}

.setup-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setup-day-row span {
  font-weight: 600;
}

.setup-day-row select {
  flex: 0 0 auto;
  min-width: 200px;
}

.setup-skip {
  border: 0;
  background: transparent;
  color: var(--muted, #94a3b8);
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
}

/* --- Ligne « maintenant » dans l'agenda --- */
.agenda-now-line {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--now-top, 0);
  height: 0;
  border-top: 2px solid #e11d48;
  z-index: 6;
  pointer-events: none;
}

.agenda-now-line.is-hidden {
  display: none;
}

.agenda-now-dot {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e11d48;
}

.agenda-now-time {
  position: absolute;
  left: 8px;
  top: -8px;
  font-size: 10px;
  font-weight: 700;
  color: #e11d48;
  background: rgba(255, 255, 255, 0.85);
  padding: 0 3px;
  border-radius: 4px;
}

.agenda-event.is-clickable,
.agenda-block.is-clickable {
  cursor: pointer;
}

.agenda-event.is-clickable:hover,
.agenda-block.is-clickable:hover {
  filter: brightness(0.96);
}

/* --- Suppression de profil --- */
.profile-card-wrap {
  position: relative;
}

.profile-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  color: #ef4444;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.profile-delete:hover {
  background: #fef2f2;
}

/* --- Détail d'un événement (modifier / supprimer) --- */
.event-detail-meta {
  margin: 4px 0;
  color: var(--muted, #64748b);
}

.event-detail-comment {
  margin: 8px 0;
}

.event-detail-actions {
  margin-top: 14px;
}

/* --- Aide par paramètre (icône ⓘ + bulle) --- */
.hint-btn {
  border: 0;
  background: transparent;
  color: var(--teal, #0d9488);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  vertical-align: middle;
}

.hint-btn:hover {
  color: var(--ink, #1e293b);
}

.hint-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.hint-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 18px 48px rgba(15, 23, 42, 0.35));
  padding: 20px 22px;
}

.hint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hint-head h3 {
  margin: 0;
}

.hint-card p {
  margin: 10px 0 0;
  line-height: 1.45;
  color: var(--ink, #1e293b);
}

.hint-card p strong {
  color: var(--muted, #64748b);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hint-tip strong {
  color: var(--teal, #0d9488) !important;
}

/* ===== Session QCM ===== */
.qcm-overlay {
  align-items: center;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 90;
}

.qcm-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.3);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  max-width: 720px;
  overflow: hidden;
  width: min(720px, 100%);
}

.qcm-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 12px 16px;
}

.qcm-head > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qcm-progress-label {
  font-weight: 800;
  font-size: 13px;
}

.qcm-chip {
  background: var(--teal-soft, #ccfbf1);
  border-radius: 999px;
  color: var(--navy, #0f172a);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
}

.qcm-chip-source {
  background: var(--blue-soft, #dbeafe);
}

.qcm-chip-dp {
  background: var(--amber-soft, #fef3c7);
  color: #92400e;
}

/* Écran de choix du type de session */
.qcm-setup-options {
  display: grid;
  gap: 10px;
}

.qcm-setup-option {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 14px;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
  width: 100%;
}

.qcm-setup-option:hover:not(.is-disabled) {
  background: var(--teal-soft, #ccfbf1);
  border-color: var(--teal, #0d9488);
}

.qcm-setup-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.qcm-setup-icon {
  font-size: 24px;
}

.qcm-setup-text {
  display: grid;
  flex: 1;
  gap: 2px;
}

.qcm-setup-text small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.qcm-setup-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

/* Configurateur de session */
.qcm-cfg {
  display: grid;
  gap: 14px;
}

.qcm-cfg-block strong,
.qcm-cfg-grid strong {
  font-size: 13px;
}

.qcm-cfg-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.qcm-cfg-type {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  padding: 6px 12px;
}

.qcm-cfg-type.is-empty {
  opacity: 0.45;
  cursor: not-allowed;
}

.qcm-cfg-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.qcm-cfg-avail {
  font-weight: 700;
  margin: 0;
}

.qcm-cfg-avail.is-empty {
  color: var(--red, #dc2626);
}

.qcm-subhead {
  padding: 8px 18px 0;
}

.qcm-qnum {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.qcm-question.is-small {
  font-size: 15px;
  font-weight: 700;
}

/* DP : questions déjà répondues, verrouillées et grisées */
.qcm-locked-question {
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 6px;
  opacity: 0.72;
  padding: 10px 12px;
}

.qcm-active-question {
  display: grid;
  gap: 10px;
}

.qcm-option.is-chosen {
  background: var(--blue-soft, #dbeafe);
  border-color: var(--blue, #2563eb);
}

.qcm-correction-q {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.qcm-correction-q:first-of-type {
  border-top: none;
  padding-top: 0;
}

.qcm-score-line {
  border-radius: 8px;
  font-weight: 700;
  padding: 8px 12px;
}

.qcm-score-line.is-good {
  background: var(--green-soft, #dcfce7);
  color: #166534;
}

.qcm-score-line.is-partial {
  background: var(--amber-soft, #fef3c7);
  color: #92400e;
}

.qcm-score-line.is-bad {
  background: var(--red-soft, #fee2e2);
  color: #991b1b;
}

.link-button {
  background: none;
  border: none;
  color: var(--blue, #2563eb);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  justify-self: start;
  padding: 0;
  text-decoration: underline;
}

.qcm-progress {
  background: #eef2f7;
  height: 4px;
  width: 100%;
}

.priority-dynamic {
  background: #f8fafc;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.priority-dynamic p {
  margin: 6px 0 0;
}

/* Sous-onglets de Paramètres */
.settings-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e8edf3);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 16px;
  position: sticky;
  top: 8px;
  z-index: 5;
}
.settings-subtab {
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--muted, #64748b);
  padding: 9px 16px;
}
.settings-subtab:hover {
  background: #f1f5f9;
}
.settings-subtab.is-active {
  background: var(--teal, #0d9488);
  color: #fff;
}
/* Groupe de panneaux d'un sous-onglet (Paramètres, Dashboard, Guide).
   ⚠️ display:grid écrase la règle navigateur [hidden]{display:none} → il faut
   la réaffirmer explicitement, sinon tous les sous-onglets s'affichent à la fois. */
.settings-group {
  display: grid;
  gap: 16px;
}
.settings-group[hidden] {
  display: none;
}

/* Bilan de niveau : ligne remplie automatiquement depuis une note de partiel/CC */
.reims-bilan-row .bilan-auto {
  flex-basis: 100%;
  color: var(--teal, #0d9488);
}

/* Profil initial par matière : bloc replié + badges de statut */
.matiere-profiles-details summary {
  cursor: pointer;
  font-weight: 800;
}
.matiere-profiles-details .table-wrap {
  margin-top: 10px;
}
.matiere-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  vertical-align: middle;
  white-space: nowrap;
}
.matiere-badge.is-auto {
  background: #ccfbf1;
  color: #0f766e;
}
.matiere-badge.is-manual {
  background: #e0e7ff;
  color: #4338ca;
}

/* Partiels (examens intermédiaires) */
.link-button.danger {
  color: #e11d48;
}
.mini-bar {
  background: #eef2f7;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  width: 120px;
}
.mini-bar > span {
  background: #0d9488;
  display: block;
  height: 100%;
}
.partiel-auto {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
}
.partiel-auto.muted {
  display: block;
}
.partiel-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.reims-setup {
  background: #f5f7ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
}
.reims-setup-top {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.reims-setup-top > strong {
  font-size: 15px;
}
.reims-config {
  margin-top: 10px;
}
.reims-gen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.reims-config summary {
  cursor: pointer;
  color: var(--teal, #0d9488);
  font-weight: 700;
}
.reims-overview {
  background: #fff;
  border: 1px solid #dbe3f3;
  border-radius: 10px;
  margin-top: 10px;
  padding: 6px 10px;
}
.reims-ov-row {
  border-top: 1px solid #f0f3f7;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: space-between;
  padding: 5px 0;
}
.reims-ov-row:first-child {
  border-top: none;
}
.reims-inline-gen {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.partiel-group {
  margin-bottom: 14px;
}
.partiel-group-head {
  align-items: baseline;
  border-bottom: 2px solid #e0e7ff;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 4px;
}
.partiel-group-head > strong {
  font-size: 14px;
}
.partiel-group .partiel-card {
  margin-bottom: 8px;
}
.reims-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 10px 0;
}
.reims-fields label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
  color: var(--muted);
}
.reims-fields input,
.reims-fields select {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 36px;
  padding: 4px 8px;
}
.reims-grades {
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
}
.reims-grades h3 {
  font-size: 15px;
  margin: 0 0 8px;
}
.reims-grade-row {
  border-top: 1px solid #f0f3f7;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: space-between;
  padding: 7px 0;
}
.reims-grade-row.ok .reims-grade-moy strong {
  color: #065f46;
}
.reims-grade-row.warn .reims-grade-moy strong {
  color: #b45309;
}
.reims-grade-moy {
  font-size: 13px;
}
.warn {
  color: #b45309;
}
.partiel-type-badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
}
.partiel-type-badge.is-cc {
  background: #fef3c7;
  color: #92400e;
}
.partiel-type-badge.is-partiel {
  background: #e0e7ff;
  color: #3730a3;
}
.partiel-type-badge.is-ratt {
  background: #fde8ec;
  color: #9f1239;
}
.partiel-type-badge.is-redoub {
  background: #ede9fe;
  color: #6d28d9;
}
.partiel-date-input {
  font-size: 13px;
  padding: 2px 6px;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 6px;
}
.grade-ok {
  color: var(--green, #16a34a);
  font-weight: 800;
  font-size: 12px;
}
.grade-fail {
  color: var(--red, #e11d48);
  font-weight: 800;
  font-size: 12px;
}
.reims-redouble {
  margin-top: 12px;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  padding: 8px 12px;
  background: #faf5ff;
}
.reims-redouble > summary {
  cursor: pointer;
  font-weight: 800;
  color: #6d28d9;
}
.reims-redouble-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.redouble-periods {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.redouble-period {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.partiel-score-field {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
}
.partiel-score {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 30px;
  width: 64px;
  padding: 2px 6px;
}
.reims-bilan {
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
}
.projection-banner {
  align-items: baseline;
  background: linear-gradient(90deg, #eef2ff, #f5f3ff);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
}
.projection-banner strong {
  color: #4338ca;
  font-size: 14px;
}
.projection-banner span {
  color: #4b5563;
  font-size: 12.5px;
}
.projection-loading {
  margin: 0 auto;
  max-width: 540px;
  padding: 30px 10px;
  text-align: center;
}
.projection-loading h2 {
  margin-bottom: 6px;
}
.projection-bar {
  background: #e5e7eb;
  border-radius: 999px;
  height: 12px;
  margin: 16px 0 8px;
  overflow: hidden;
  width: 100%;
}
.projection-bar > span {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 999px;
  display: block;
  height: 100%;
  transition: width 0.2s ease;
}
.projection-pct {
  color: #4338ca;
  font-weight: 800;
}

.baseline-clean {
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
}
.baseline-clean summary {
  cursor: pointer;
  font-weight: 800;
}
.baseline-clean-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.baseline-clean-row {
  align-items: center;
  border-top: 1px solid #f0f3f7;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 6px;
}
.baseline-clean-m {
  flex: 1 1 160px;
  font-size: 13px;
  font-weight: 700;
}
.baseline-clean-row.is-orphan .baseline-clean-m {
  color: #b45309;
}
.baseline-orphan-tag {
  background: #fef3c7;
  border-radius: 6px;
  color: #92400e;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  text-transform: uppercase;
}
.reims-bilan summary {
  cursor: pointer;
  font-weight: 800;
}
.reims-bilan-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.reims-bilan-row {
  align-items: center;
  border-top: 1px solid #f0f3f7;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 6px;
}
.reims-bilan-row > strong {
  flex: 1 1 160px;
  font-size: 13px;
}
.reims-bilan-row label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
}
.reims-bilan-row input,
.reims-bilan-row select {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 30px;
  padding: 2px 6px;
}
.reims-bilan-row input[type="number"] {
  width: 58px;
}
.chip-x {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 11px;
  margin-left: 4px;
  opacity: 0.55;
  padding: 0 0 0 2px;
}
.chip-x:hover {
  opacity: 1;
}
.partiel-matiere-add {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.partiel-matiere-add select {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 32px;
  padding: 2px 8px;
}
.partiel-card {
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 12px;
  padding: 12px 14px;
}
.partiel-card-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}
.partiel-card-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}
.partiel-ready {
  background: #ecfdf5;
  border-radius: 999px;
  color: #065f46;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}
.partiel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.partiel-meta {
  font-size: 12px;
}
.partiel-items {
  border-top: 1px dashed var(--line, #e8edf3);
  margin-top: 10px;
  padding-top: 10px;
}
.partiel-item-list {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0 0 10px;
  max-height: 240px;
  overflow: auto;
  padding: 0;
}
.partiel-item-list li {
  align-items: center;
  display: flex;
  font-size: 13px;
  gap: 8px;
  justify-content: space-between;
}
.partiel-item-x {
  background: none;
  border: none;
  color: #e11d48;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.partiel-item-add input,
.partiel-add input,
.partiel-add select {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  font: inherit;
  padding: 8px 10px;
  width: 100%;
}
.partiel-add {
  display: grid;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 12px;
  padding: 12px;
}
.partiel-add-field {
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
}
.partiel-mode {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.partiel-mode select {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  font: inherit;
  padding: 8px 10px;
}
.partiel-add-note {
  font-size: 12px;
  margin: 0;
}
.partiel-dash-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.partiel-dash-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}
.partiel-dash-row.is-active {
  font-weight: 600;
}
.partiel-dash-ready {
  align-items: center;
  display: flex;
  gap: 8px;
  font-size: 13px;
}
.partiel-badge {
  background: #fef3c7;
  border-radius: 999px;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  margin-left: 6px;
  padding: 2px 8px;
}

/* ── Stages (externat) ── */
.stage-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.stage-card {
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-left: 4px solid #6366f1;
  border-radius: 12px;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}
.stage-card-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}
.stage-card-head > strong {
  font-size: 14px;
}
.stage-card-grid,
.stage-add-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.stage-card-grid label,
.stage-add-grid label {
  display: grid;
  font-size: 12px;
  gap: 2px;
}
.stage-card-grid label > span,
.stage-add-grid label > span {
  color: var(--muted);
  font-weight: 700;
}
.stage-card-grid input,
.stage-add-grid input {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 8px;
}
.stage-days {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stage-days-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-right: 4px;
}
.stage-day {
  align-items: center;
  background: #f4f6fb;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
  padding: 4px 10px;
  user-select: none;
}
.stage-day.is-on {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #3730a3;
}
.stage-day input {
  margin: 0;
}
.stage-weeks {
  background: #f9fafe;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 10px;
  padding: 8px 10px;
}
.stage-weeks > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
}
.stage-weeks .mini {
  font-size: 11px;
}
.stage-week-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.stage-week-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-width: 110px;
}
.stage-days.mini .stage-day {
  font-size: 11px;
  padding: 2px 7px;
}
.stage-mode-field {
  display: grid;
  font-size: 12px;
  gap: 3px;
}
.stage-mode-field > span {
  color: var(--muted);
  font-weight: 700;
}
.stage-mode-field select {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 8px;
}
.stage-card-note {
  font-size: 12px;
  margin: 0;
}
.stage-add {
  background: #f9fafe;
  border: 1px dashed var(--line, #e8edf3);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}
.stage-add input[name="label"] {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 10px;
}

.stage-banner {
  border-left: 4px solid #6366f1;
}
.stage-banner.is-resolved {
  background: #eef2ff;
}
.stage-banner-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 12px 16px 0;
}
.stage-banner-head > strong {
  font-size: 15px;
}
.stage-banner-head > span {
  color: var(--muted);
  font-size: 13px;
}
.stage-banner-note {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 16px 0;
}
.stage-banner-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 14px;
}
.stage-banner-actions input[type="time"] {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 10px;
}
.stage-banner-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 16px;
}
.stage-banner-text {
  font-size: 14px;
}

/* ── Barre d'actions rapides (haut du dashboard) ── */
.quick-actions {
  padding: 14px 16px;
}
.quick-actions-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.quick-tile {
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}
.quick-tile.is-on {
  background: #fff7ed;
  border-color: #fcd34d;
}
.quick-tile.is-course {
  background: #f0fdfa;
  border-color: #a7ded7;
}
.quick-tile-label,
.quick-tile-state {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.quick-tile-state {
  color: #92400e;
}
.quick-tile-course {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}
.quick-btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  padding: 12px 14px;
  width: 100%;
}
.quick-btn-pause {
  background: #f59e0b;
  color: #fff;
}
.quick-btn-go {
  background: #16a34a;
  color: #fff;
}
.quick-btn-stage {
  background: #6366f1;
  color: #fff;
}
.quick-btn-done {
  background: var(--teal, #0d9488);
  color: #fff;
  margin-top: auto;
}
.quick-btn-clear {
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  color: var(--muted);
}
.quick-stage-more {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.quick-stage-more input[type="time"] {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 32px;
  padding: 4px 8px;
}
.quick-tile.is-window {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.quick-window-chips {
  display: flex;
  gap: 8px;
}
.quick-btn-window {
  background: #fff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  flex: 1;
  font-size: 14px;
  padding: 10px 8px;
}
.quick-window-more {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.quick-window-more input[type="time"] {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 32px;
  padding: 4px 8px;
}
.window-focus {
  border: 1px solid #c7d2fe;
  background: #f5f7ff;
}
.window-cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.window-card {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line, #e8edf3);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  text-align: left;
}
.window-card:hover {
  border-color: #a5b4fc;
}
.window-card.is-active {
  background: #eef2ff;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px #c7d2fe;
}
.window-card-icon {
  font-size: 18px;
}
.window-card-title {
  font-weight: 800;
  font-size: 14px;
}
.window-card-sub {
  color: var(--muted);
  font-size: 12px;
}
.window-config-wrap {
  margin-top: 12px;
}
.window-config-wrap summary {
  cursor: pointer;
  color: var(--teal, #0d9488);
  font-weight: 700;
  font-size: 13px;
}
.window-config {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
}
.window-config label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
  color: var(--muted);
}
.window-config select {
  border: 1px solid var(--line, #e8edf3);
  border-radius: 8px;
  min-height: 36px;
  padding: 4px 8px;
}
.quick-link {
  background: none;
  border: none;
  color: var(--teal, #0d9488);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 4px;
  text-decoration: underline;
}

.pause-banner {
  background: #fff7ed;
  border-left: 4px solid #f59e0b;
}
.pause-banner-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 16px;
}
.pause-banner-text {
  font-size: 14px;
}

.qcm-progress-bar {
  background: var(--teal, #0d9488);
  height: 100%;
  transition: width 0.2s ease;
}

.qcm-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 16px 18px;
}

.qcm-item {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

.qcm-context {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue, #2563eb);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  padding: 10px 12px;
}

.qcm-question {
  font-size: 18px;
  line-height: 1.35;
  margin: 0;
}

.qcm-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: -4px 0 0;
}

.qcm-options {
  display: grid;
  gap: 8px;
}

.qcm-option {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
  width: 100%;
}

.qcm-option:hover:not([disabled]) {
  border-color: var(--teal, #0d9488);
}

.qcm-option.is-selected {
  background: var(--teal-soft, #ccfbf1);
  border-color: var(--teal, #0d9488);
}

.qcm-option.is-correct {
  background: var(--green-soft, #dcfce7);
  border-color: var(--green, #16a34a);
}

.qcm-option.is-wrong {
  background: var(--red-soft, #fee2e2);
  border-color: var(--red, #dc2626);
}

.qcm-option[disabled] {
  cursor: default;
}

.qcm-option-key {
  align-items: center;
  background: #eef2f7;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 800;
  height: 26px;
  justify-content: center;
  min-width: 26px;
}

.qcm-option-text {
  flex: 1;
  line-height: 1.4;
}

.qcm-option-flag {
  font-weight: 800;
}

.qcm-correction {
  border-radius: 9px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.qcm-correction.is-good {
  background: var(--green-soft, #dcfce7);
  border: 1px solid var(--green, #16a34a);
}

.qcm-correction.is-bad {
  background: var(--red-soft, #fee2e2);
  border: 1px solid var(--red, #dc2626);
}

.qcm-correction.is-partial {
  background: var(--amber-soft, #fef3c7);
  border: 1px solid #d97706;
}

.qcm-result {
  font-weight: 800;
  margin: 0;
}

.qcm-answer,
.qcm-explanation,
.qcm-confidence,
.qcm-correction-note {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.qcm-badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
}

.qcm-badge.is-ia {
  background: var(--amber-soft, #fef3c7);
  color: #92400e;
}

.qcm-badge.is-verified {
  background: var(--green-soft, #dcfce7);
  color: #166534;
}

.qcm-badge.is-rang-a {
  background: var(--navy, #0f172a);
  color: #fff;
}

.qcm-badge.is-rang-b {
  background: #e2e8f0;
  color: #475569;
}

.qcm-notion {
  font-size: 13px;
  font-style: italic;
  line-height: 1.4;
  margin: 0;
}

.qcm-images {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.qcm-image {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: zoom-in;
  max-height: 60vh;
  max-width: 100%;
  object-fit: contain;
}

/* Zone à pointer : image cliquable + repères */
.qcm-zone-wrap {
  display: inline-block;
  line-height: 0;
  position: relative;
  max-width: 100%;
}

.qcm-zone-wrap.is-clickable {
  cursor: crosshair;
}

.qcm-zone-wrap .qcm-image {
  cursor: inherit;
}

.qcm-zone-box {
  border: 2px solid var(--green, #16a34a);
  background: rgba(22, 163, 74, 0.18);
  border-radius: 4px;
  position: absolute;
  pointer-events: none;
}

.qcm-zone-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--blue, #2563eb);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}

.qcm-zone-marker.is-good {
  background: var(--green, #16a34a);
}

.qcm-zone-marker.is-bad {
  background: var(--red, #dc2626);
}

.qcm-zone-box-num {
  position: absolute;
  top: -10px;
  left: -2px;
  background: var(--green, #16a34a);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
}

.qcm-zone-count {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.qcm-zone-labels {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

.qcm-zone-labels li {
  margin: 2px 0;
}

/* QROC : saisie texte */
.qcm-qroc-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

.qcm-qroc-given {
  margin: 0;
}

.qcm-qroc-accepted {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

/* TCS : échelle -2..+2 */
.qcm-tcs-scale {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qcm-tcs-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  flex: 1;
  font-weight: 800;
  min-width: 52px;
  padding: 12px 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.qcm-tcs-btn:hover:not([disabled]) {
  border-color: var(--teal, #0d9488);
}

.qcm-tcs-btn.is-selected {
  background: var(--teal-soft, #ccfbf1);
  border-color: var(--teal, #0d9488);
}

.qcm-tcs-btn.is-correct {
  background: var(--green-soft, #dcfce7);
  border-color: var(--green, #16a34a);
}

.qcm-tcs-btn.is-wrong {
  background: var(--red-soft, #fee2e2);
  border-color: var(--red, #dc2626);
}

.qcm-zone-block {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.qcm-zone-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.qcm-flag-link {
  color: var(--red, #dc2626) !important;
}

.qcm-image-flagged {
  background: var(--amber-soft, #fef3c7);
  border-radius: 8px;
  color: #92400e;
  font-size: 13px;
  margin: 0;
  padding: 8px 12px;
}

.qcm-zoom-btn {
  font-size: 13px;
}

/* Lightbox d'image (zoom plein écran) */
.qcm-lightbox {
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 100;
}

.qcm-lightbox-imgwrap {
  display: inline-block;
  line-height: 0;
  position: relative;
}

.qcm-lightbox-imgwrap.is-clickable {
  cursor: crosshair;
}

.qcm-lightbox-imgwrap img {
  display: block;
  max-height: 86vh;
  max-width: 94vw;
  border-radius: 6px;
}

.qcm-lightbox-close {
  background: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  height: 40px;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 40px;
}

.qcm-lightbox-hint {
  color: #fff;
  font-size: 13px;
  margin: 0;
}

.item-num {
  color: var(--teal, #0d9488);
  font-variant-numeric: tabular-nums;
}

.qcm-lib-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.qcm-lib-actions {
  margin-bottom: 10px;
}

.qcm-lib-table .qcm-lib-row {
  cursor: pointer;
}

.qcm-lib-table .qcm-lib-row:hover {
  background: var(--teal-soft, #ccfbf1);
}

.qcm-lib-table .qcm-badge {
  font-size: 10px;
  padding: 1px 6px;
}

.qcm-correction-note {
  color: var(--muted);
  font-style: italic;
}

.qcm-actions {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
}

.qcm-report-form {
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
  padding: 12px 16px;
}

.qcm-report-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.qcm-report-options {
  display: grid;
  gap: 4px;
}

.qcm-report-option {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 8px;
  line-height: 1.4;
}

.qcm-report-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 8px;
  resize: vertical;
  width: 100%;
}

.qcm-report-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.qcm-score-big {
  border-radius: 12px;
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.qcm-score-big strong {
  font-size: 40px;
  line-height: 1;
}

.qcm-score-big.is-good {
  background: var(--green-soft, #dcfce7);
  color: #166534;
}

.qcm-score-big.is-mid {
  background: var(--amber-soft, #fef3c7);
  color: #92400e;
}

.qcm-score-big.is-bad {
  background: var(--red-soft, #fee2e2);
  color: #991b1b;
}

.qcm-recap-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.qcm-recap-items {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.qcm-recap-items li {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 12px;
}

@media (max-width: 640px) {
  .qcm-question {
    font-size: 16px;
  }
  .qcm-actions {
    justify-content: stretch;
  }
  .qcm-actions button {
    flex: 1;
  }
}

/* --- Toast non bloquant (synchro, confirmations) --- */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  z-index: 3000;
  max-width: min(92vw, 480px);
  background: #1e293b;
  color: #f8fafc;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   Passe mobile complète (téléphones & petites tablettes)
   ============================================================ */

/* iOS : les zones sûres (encoche/barre du bas) quand installé en PWA. */
.app-header {
  padding-top: max(10px, env(safe-area-inset-top));
}
.app-footer {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

/* Hauteurs d'écran fiables sur mobile (barre d'adresse iOS/Android). */
@supports (height: 100dvh) {
  .plan-detail-overlay,
  .access-gate,
  .qcm-overlay,
  .profile-gate-overlay {
    max-height: 100dvh;
  }
}

@media (max-width: 820px) {
  /* La navigation reste accessible en défilant : barre collante en haut. */
  .tab-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  }
}

@media (max-width: 640px) {
  /* Cibles tactiles confortables (recommandation 44px). */
  .tab {
    min-height: 44px;
    font-size: 14px;
    padding: 8px 12px;
  }
  .icon-button,
  .primary-button,
  .secondary-button,
  .danger-button,
  .footer-link {
    min-height: 44px;
  }

  /* iOS zoome sur les champs < 16px : on force 16px sur mobile. */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* Tableaux : défilement interne au lieu de casser la page. */
  .view table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* L'en-tête se réorganise proprement. */
  .app-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }

  /* Les barres d'outils et grilles passent en une colonne. */
  .toolbar,
  .agenda-toolbar {
    gap: 8px;
  }
  .week-metrics,
  .week-day-overview,
  .day-row {
    grid-template-columns: 1fr;
  }

  /* Modales plein écran : plus lisible qu'une petite boîte sur téléphone. */
  .plan-detail-overlay {
    padding: 0;
    align-items: stretch;
  }
  .access-gate .account-modal,
  .access-gate .doc-modal {
    max-width: 100%;
    width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 100dvh;
  }

  /* Le footer ne déborde pas. */
  .app-footer {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }
}

/* --- États vides pédagogiques --- */
.empty-state {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.empty-state-title {
  font-weight: 700;
  margin: 0 0 6px;
}

/* --- Grande notice (manuel par onglet) --- */
.manual-search {
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
}
.manual-section > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 6px;
}
.manual-section {
  border-bottom: 1px solid var(--line);
}
.manual-body {
  padding: 2px 8px 14px;
  line-height: 1.55;
}
.manual-body h4 {
  margin: 12px 0 4px;
}
.manual-body ul {
  margin: 4px 0 8px;
  padding-left: 20px;
}
.manual-note {
  background: rgba(15, 118, 110, 0.07);
  border-left: 3px solid var(--teal, #0f766e);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0;
}
