/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --bg: #f4f2ee;
  --text: #1c1c1a;
  --text-muted: #6b6b65;
  --sidebar-bg: #1a1a18;
  --sidebar-text: #e2ddd5;
  --sidebar-muted: #7a7670;
  --accent: #e06b3a;
  --border: #dedad2;
  --card-bg: #ffffff;
  --shadow: 0 1px 4px rgba(0,0,0,0.07);
  --radius: 8px;
  --sidebar-w: 255px;
  --gap: 1.5rem;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
ul { list-style: none; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
}

/* ── Écran d'erreur de validation ────────────────────────────────────────── */
.cv-error-screen {
  grid-column: 1 / -1;
  max-width: 640px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.cv-error-screen h1 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: #b91c1c;
}
.cv-error-screen p { margin-bottom: 1rem; color: var(--text-muted); }
.cv-error-screen ul { display: flex; flex-direction: column; gap: 0.5rem; }
.cv-error-screen li {
  background: #fff5f5;
  border: 1px solid #f3c9c9;
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  gap: 1.6rem;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.profile-header { }
.profile-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 0.7rem;
}
.profile-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.3rem;
}
.profile-header .titre-pro {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sidebar-muted);
  line-height: 1.5;
}
.profile-header .titre-pro em {
  font-style: normal;
  color: var(--accent);
}
.profile-header .lieu {
  font-size: 0.77rem;
  color: var(--sidebar-muted);
  margin-top: 0.3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.77rem;
  color: var(--sidebar-muted);
}
.contact-info a { text-decoration: none; color: var(--sidebar-text); transition: color 0.15s; }
.contact-info a:hover { color: var(--accent); }

.profil-liens {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  font-size: 0.77rem;
}
.profil-liens:empty { display: none; }
.profil-liens a { text-decoration: none; color: var(--sidebar-text); transition: color 0.15s; }
.profil-liens a:hover { color: var(--accent); }
.lien-fleche { margin-left: 0.2rem; font-size: 0.7em; color: var(--sidebar-muted); }

.contact-warning {
  font-size: 0.72rem;
  color: var(--accent);
  line-height: 1.4;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 0.77rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 0.45rem 0.55rem;
  color: var(--sidebar-text);
  resize: vertical;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--sidebar-muted); }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form button {
  background: var(--accent);
  color: #1a1a18;
  border: none;
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  font-size: 0.77rem;
  font-weight: 600;
}
.contact-form button:hover { opacity: 0.9; }

/* View navigation */
.view-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.view-btn {
  background: none;
  border: none;
  color: var(--sidebar-muted);
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  text-align: left;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s, color 0.15s;
}
.view-btn:hover { background: rgba(255,255,255,0.06); color: var(--sidebar-text); }
.view-btn.active { background: rgba(255,255,255,0.1); color: #fff; }
#btn-print {
  margin-top: 0.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-radius: 0;
}
.view-btn .vi { font-size: 1rem; line-height: 1; }

/* Sidebar filters */
#sidebar-filters {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.filter-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  margin-bottom: 0.2rem;
}
.filter-group-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-muted);
  margin-top: 0.75rem;
  margin-bottom: 0.1rem;
  padding-left: 0.6rem;
}
.filter-btn {
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--sidebar-muted);
  padding: 0.38rem 0.6rem;
  border-radius: 0 5px 5px 0;
  text-align: left;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.filter-btn:hover { color: var(--sidebar-text); background: rgba(255,255,255,0.05); }
.filter-count {
  margin-left: 0.4rem;
  font-size: 0.7rem;
  color: var(--sidebar-muted);
}
.filter-btn.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left-color: var(--tag-color, var(--accent));
}

/* Langues */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.langues-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  margin-bottom: 0.5rem;
}
.langue-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 0.18rem 0;
  color: var(--sidebar-text);
}
.langue-niveau { color: var(--sidebar-muted); font-size: 0.72rem; }

/* ── Main ────────────────────────────────────────────────────────────────── */
#main {
  padding: 2.5rem 3rem;
  max-width: 860px;
}
/* La frise chronologique profite d'un conteneur bien plus large que les
   vues à base de texte (cartes/listes) — sinon elle reste cantonnée à une
   petite portion de l'écran malgré tout l'espace disponible à côté. */
#main.main-wide {
  max-width: 1600px;
}
#view-header { margin-bottom: 2rem; }
#view-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* ── Timeline ────────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 88px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  margin-bottom: 1.4rem;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 85px;
  top: 19px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  z-index: 1;
}
.timeline-date {
  padding-top: 1rem;
  padding-right: 1.4rem;
  text-align: right;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.timeline-card {
  padding-left: 1.5rem;
}

/* ── Frise proportionnelle (Gantt compact, horizontale) ─────────────────── */
.tl-gantt-wrap {
  overflow-x: auto;
  overflow-y: visible; /* laisse les popovers de sous-engagements déborder verticalement */
  padding-bottom: 0.5rem;
}
.tl-gantt {
  position: relative;
  min-width: 100%;
}
.tl-gantt-axis {
  position: absolute;
  inset: 0;
}
.tl-axis-col {
  position: absolute;
  top: 0;
  bottom: 0;
}
.tl-axis-year {
  position: absolute;
  top: 0;
  left: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.tl-axis-line {
  position: absolute;
  top: 22px;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--border);
}
.tl-axis-col-now .tl-axis-year {
  color: var(--accent);
  font-weight: 700;
}
.tl-axis-col-now .tl-axis-line {
  background: var(--accent);
  opacity: 0.6;
  width: 2px;
}
/* Bornes d'âge (CV.profil.naissance) : bande sous les années */
.tl-age-mark {
  position: absolute;
  bottom: 0;
  width: 0;
}
.tl-age-mark::before {
  content: '';
  position: absolute;
  top: 15px;
  height: 5px;
  left: 0;
  border-left: 1px solid var(--accent);
  opacity: 0.6;
}
.tl-age-label {
  position: absolute;
  top: 1px;
  transform: translateX(-50%);
  z-index: 1;
  padding: 0 3px;
  border-radius: 3px;
  background: var(--bg);
  font-size: 0.62rem;
  color: var(--accent);
  white-space: nowrap;
}
.tl-age-mark-rond .tl-age-label { font-weight: 700; }
.tl-age-mark-rond::after {
  content: '';
  position: absolute;
  top: 20px;
  bottom: 0;
  left: 0;
  border-left: 1px dashed var(--accent);
  opacity: 0.45;
}
.timeline-age {
  display: block;
  margin-top: 0.15rem;
  color: var(--accent);
}
.tl-gantt-bars {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
.tl-bar {
  position: absolute;
  box-sizing: border-box;
  padding: 3px;
}
.tl-bar-card {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  background: var(--type-bg, var(--card-bg));
  border: 1px solid var(--border);
  border-left: 3px solid var(--type-color, var(--accent));
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  box-shadow: var(--shadow);
}
.tl-bar-actuel .tl-bar-card {
  border-left-style: dashed;
}
/* Barre parente qui contient des sous-engagements : plus de centrage
   vertical, une zone titre/période compacte puis la zone des sous-barres.
   overflow visible (contrairement à .tl-bar-card standard) pour ne pas
   couper les popovers de petits-enfants qui pourraient déborder. */
.tl-bar-card-parent {
  overflow: visible;
  justify-content: flex-start;
  padding: 0;
  gap: 0;
}
.tl-bar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem 0.15rem;
  overflow: hidden;
}
.tl-bar-header .tl-bar-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-bar-header .tl-bar-period { flex-shrink: 0; }
.tl-bar-children {
  position: relative;
  flex: 1;
  margin: 0 4px 4px;
}
.tl-child-bar {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--type-bg, var(--card-bg));
  border: 1px solid var(--border);
  border-left: 2px solid var(--type-color, var(--accent));
  border-radius: 4px;
  padding: 0 0.4rem;
}
.tl-child-bar.tl-bar-actuel { border-left-style: dashed; }
/* Sélecteur composé (au lieu de .tl-child-bar-titre seul) pour être sûr de
   l'emporter sur .tl-bar-titre malgré l'ordre dans la feuille de style —
   même spécificité sinon, résultat dépendrait de l'ordre des règles. */
.tl-bar-titre.tl-child-bar-titre {
  font-size: 0.68rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  width: auto;
}
.tl-bar-expand.tl-bar-expand-sm {
  position: static;
  flex-shrink: 0;
  padding: 0.05rem 0.3rem;
  font-size: 0.55rem;
}
.tl-bar-titre {
  /* Réinitialisation : c'est un <button> (ouvre le détail complet au clic),
     mais il doit se fondre visuellement dans la barre comme un simple
     libellé, avec juste un signal d'interactivité au survol. */
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: block;
  width: 100%;

  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-bar-titre:hover, .tl-bar-titre:focus-visible {
  text-decoration: underline;
  color: var(--type-color, var(--accent));
}
.tl-bar-org {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-bar-period {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Badge + popover des sous-engagements ("héritage" d'entrées) */
.tl-bar-expand {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--type-color, var(--accent));
  background: var(--card-bg);
  border: 1px solid var(--type-color, var(--accent));
  border-radius: 999px;
  padding: 0.18rem 0.4rem;
}
.tl-bar-expand:hover { background: var(--type-color, var(--accent)); color: #fff; }
.tl-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  z-index: 20;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.tl-children-popover {
  min-width: 220px;
  max-width: 320px;
  padding: 0.5rem 0.65rem;
}
.tl-detail-popover {
  width: 320px;
  max-width: 90vw;
  max-height: 60vh;
  overflow-y: auto;
}
.tl-detail-popover .card {
  border: none;
  box-shadow: none;
  border-radius: 6px;
}
.tl-children-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
}
.tl-children-list .tl-children-list {
  margin: 0.3rem 0 0 0.8rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border);
}
.tl-child-titre { font-size: 0.78rem; font-weight: 600; }
.tl-child-org { font-size: 0.72rem; color: var(--text-muted); }
.tl-child-period { font-size: 0.68rem; color: var(--text-muted); margin-left: 0.4rem; white-space: nowrap; }

/* Dans la vue liste simple (mobile/impression), la liste des
   sous-engagements est ajoutée directement sous la carte, toujours visible
   (pas de popover à déplier, on est déjà dans un flux vertical simple). */
.timeline-card > .tl-children-list {
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ── Cards (full) ────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.card-titre {
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
}
.card-org {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}
.badge-type {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--type-color) 14%, transparent);
  color: var(--type-color);
  white-space: nowrap;
}
.badge-type.sm { font-size: 0.6rem; padding: 0.12rem 0.4rem; }
.badge-placeholder {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: #fef9c3;
  color: #854d0e;
}
.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}
.card-points {
  margin: 0 0 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.card-points li {
  font-size: 0.83rem;
  padding-left: 1rem;
  position: relative;
  color: var(--text);
}
.card-points li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.6rem;
}
.tag {
  font-size: 0.67rem;
  font-weight: 500;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
}
.tag-milieu {
  background: color-mix(in srgb, var(--tag-color) 13%, transparent);
  color: var(--tag-color);
}
.tag-tech {
  background: #f0ede6;
  color: #4a4a42;
}

/* ── Cards (compact) ─────────────────────────────────────────────────────── */
.compact-list { display: flex; flex-direction: column; gap: 0.4rem; }
.card-compact {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.compact-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 72px;
}
.compact-body {
  flex: 1;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.5rem;
}
.compact-org {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.compact-desc {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Milieu / section headers ────────────────────────────────────────────── */
.milieu-block { margin-bottom: 2.5rem; }
.milieu-sub-block { margin: 0.7rem 0 0.7rem 1.2rem; }
.milieu-sub-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color, var(--accent));
  margin-bottom: 1rem;
}
.section-header.clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}
.section-header.clickable:hover { opacity: 0.75; }
.section-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-color, var(--text));
}
.count {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* ── Competence view ─────────────────────────────────────────────────────── */
.comp-group-block { margin-bottom: 2rem; }
.comp-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.comp-row { margin-bottom: 0.5rem; }
.comp-skill-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.87rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.comp-skill-btn:hover { border-color: #aaa; background: #fff; }
.count-badge {
  font-size: 0.68rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.08rem 0.42rem;
  border-radius: 10px;
  margin-left: auto;
}
.comp-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.35rem 0.4rem;
}
.preview-chip {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

/* ── Glossaire (définitions cliquables) ─────────────────────────────────── */
.glossary-term {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}
.glossary-term:hover, .glossary-term:focus-visible {
  text-decoration-style: solid;
}
.glossary-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.glossary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.glossary-modal-panel {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 1.5rem 1.6rem;
  max-width: 420px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
}
.glossary-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  line-height: 1;
}
.glossary-modal-close:hover { color: var(--text); }
#glossary-modal-term {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-right: 1.5rem;
}
#glossary-modal-def {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  body { grid-template-columns: 1fr; }
  #sidebar { height: auto; position: static; }
  #main { padding: 1.5rem 1.25rem; max-width: 100%; }
  .timeline::before { display: none; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .timeline-item::before { display: none; }
  .timeline-date { text-align: left; padding-top: 0; padding-right: 0; }
  .timeline-card { padding-left: 0; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* ── Impression / export PDF ────────────────────────────────────────────── */
@media print {
  .glossary-modal { display: none !important; }
  body {
    display: block;
    background: #fff;
    color: #111;
    font-size: 11px;
  }
  #sidebar {
    position: static;
    height: auto;
    background: #fff;
    color: #111;
    padding: 0 0 0.8rem;
    border-bottom: 2px solid #111;
    margin-bottom: 1rem;
    display: block;
  }
  .profile-header h1 { color: #111; }
  .profile-header .titre-pro,
  .profile-header .lieu,
  .contact-info,
  .sidebar-footer { color: #333; }
  .contact-info a { color: #111; }
  /* Sur papier un lien ne se clique pas : on imprime l'adresse à côté. */
  .profil-liens { flex-direction: column; margin-top: 0.4rem; }
  .profil-liens a { color: #111; }
  .profil-liens a::after { content: " — " attr(href); color: #555; }
  .lien-fleche { display: none; }
  .view-nav, #sidebar-filters { display: none; }
  .sidebar-footer {
    border-top: none;
    padding-top: 0.4rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 1rem;
  }
  .langues-title { display: none; }
  #langue-list { display: flex; flex-wrap: wrap; gap: 0 1rem; }
  /* .langue-row hérite de --sidebar-text (clair, prévu pour le fond sombre) :
     illisible sur papier blanc sans couleur explicite. */
  .langue-row { display: flex; gap: 0.25rem; color: #111; }
  .langue-niveau { color: #555; }

  #main { max-width: 100%; padding: 0; }
  #view-header { margin-bottom: 0.8rem; }

  .card, .card-compact, .comp-row, .timeline-item {
    break-inside: avoid;
    box-shadow: none;
  }
  .card, .card-compact { border: 1px solid #bbb; }
  .badge-type, .badge-placeholder, .tag {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .timeline::before, .timeline-item::before { background: #999; }

  a { color: #111; text-decoration: none; }
}
