/* ============================================
   Evolution — Espace Evolution
   App-specific styles. Generic UI is in design-kit.
   ============================================ */

/* ══════════════════════════════════════════════════
   Evolution visual identity — "la table de cartes" (proposition D).
   Warm paper field, green-tinted ink, deep Eveil green accent,
   serif headings, mono captions, soft radii.
   Token-level override of the design kit (the documented mechanism);
   the kit itself stays untouched.
   ══════════════════════════════════════════════════ */
:root {
  /* field */
  --bg:        #eceae3;
  --surface:   #f9f8f4;
  --bg-inset:  #e9e6db;
  --mat:       #e2dfd4;   /* the table mat */
  --mat-edge:  #d3cfc0;

  /* ink — green-tinted warm greys */
  --ink-1: #252f2a;
  --ink-2: #57615b;
  --ink-3: #8b948c;

  /* structure */
  --line:        #d8d4c8;
  --line-strong: #b3ad9e;

  /* accent — the deep Eveil green of the base deck */
  --accent:       #1d7868;
  --accent-hover: #155e50;
  --accent-dim:   #e2ede9;
  --accent-mid:   #7fb5a8;

  /* semantic — warm-shifted */
  --ok:       #2e7d5b;
  --ok-dim:   #e0efe6;
  --warn:     #9a6a12;
  --warn-dim: #f6ecd6;
  --err:      #b04a3a;
  --err-dim:  #f7e6e2;

  /* geometry stays the kit's — square, rational */
  --shadow-sm: 0 1px 2px rgba(37,47,42,0.07), 0 3px 10px rgba(37,47,42,0.05);
  --shadow-md: 0 2px 4px rgba(37,47,42,0.08), 0 10px 24px rgba(37,47,42,0.09);
}

[data-theme="dark"] {
  --bg:        #151815;
  --surface:   #1e221f;
  --bg-inset:  #121513;
  --mat:       #101311;
  --mat-edge:  #070908;

  --ink-1: #e9e7dd;
  --ink-2: #a6afa7;
  --ink-3: #727b74;

  --line:        #31372f;
  --line-strong: #4a5348;

  --accent:       #4db39a;
  --accent-hover: #63c4ac;
  --accent-dim:   #1c2f2a;
  --accent-mid:   #2e6f5f;

  --ok:       #5cc08e;
  --ok-dim:   #12261b;
  --warn:     #d9a83f;
  --warn-dim: #2a2110;
  --err:      #e07a63;
  --err-dim:  #2b1512;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 3px 10px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.45), 0 10px 24px rgba(0,0,0,0.4);
}

/* Typography stays the kit's sans throughout — the identity lives in the
   palette, the mat, and the card faces, not in display faces. */

/* ── Upcoming TH list ── */
.th-list {
  display: flex;
  flex-direction: column;
  gap: var(--s12);
}

/* ── Séances timeline ── */
.timeline {
  position: relative;
  padding-left: var(--s24);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: var(--s8);
  bottom: var(--s8);
  width: 2px;
  background: var(--line);
}

.timeline-section-label {
  font-size: var(--t-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin: 0 0 var(--s12) 0;
}

.timeline-item {
  position: relative;
  margin-bottom: var(--s12);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--s24) + 1px);
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 2px solid var(--line-strong);
}
.timeline-item--next::before {
  background: var(--accent);
  border-color: var(--accent);
}
.timeline-item--past::before {
  border-color: var(--line);
}

/* Prominent "next" cards */
.th-card--next {
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
.th-card--next .th-card-date {
  color: var(--accent);
}

/* Past cards recede */
.th-card--past {
  opacity: 0.82;
}
.th-card--past:hover {
  opacity: 1;
}

/* Expand control between the next two and the rest */
.timeline-expand {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  margin: 0 0 var(--s12) 0;
  padding: var(--s4) var(--s12);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r1);
  background: none;
  color: var(--ink-2);
  font-size: var(--t-12);
  font-family: var(--font);
  cursor: pointer;
  transition: border-color var(--dt-fast), color var(--dt-fast), background var(--dt-fast);
}
.timeline-expand:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* "Today" divider */
.timeline-today {
  display: flex;
  align-items: center;
  gap: var(--s12);
  margin: var(--s24) 0;
  margin-left: calc(-1 * var(--s24));
}
.timeline-today::before,
.timeline-today::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--accent-mid);
}
.timeline-today::before {
  max-width: var(--s16);
}
.timeline-today-label {
  font-size: var(--t-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  border-radius: var(--r2);
  padding: var(--s4) var(--s12);
  white-space: nowrap;
}

.th-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s16);
  cursor: pointer;
  transition: border-color var(--dt-fast), box-shadow var(--dt-fast);
}
.th-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.th-card-main {
  flex: 1;
  min-width: 0;
}

/* ── Calendar-leaf variant (proposal B): date block + names + fill state ── */
.th-card--cal { align-items: center; }
.cal-date {
  flex: none;
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--s4) 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--bg-inset);
  line-height: 1.15;
}
.cal-date-dow {
  font-size: var(--t-10);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cal-date-num {
  font-size: var(--t-20, 20px);
  font-weight: 650;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}
.cal-date-mon { font-size: var(--t-11); color: var(--ink-2); }
.th-card--next .cal-date { border-color: var(--accent-mid); }
.th-card--next .cal-date-num { color: var(--accent); }

.th-card-names {
  margin-top: var(--s4);
  font-size: var(--t-12);
  color: var(--ink-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.th-card-names-more { color: var(--ink-3); font-weight: 600; }

.th-card-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s8);
}

.fill-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--t-11);
  font-weight: 600;
  border-radius: var(--r2);
  padding: 2px 10px;
  white-space: nowrap;
}
.fill-pill--done   { background: var(--ok-dim); color: var(--ok); }
.fill-pill--partial{ background: var(--warn-dim, rgba(217, 119, 6, 0.12)); color: var(--warn, #b45309); }
.fill-pill--todo   { background: var(--bg-inset); color: var(--ink-3); border: 1px dashed var(--line-strong); }
.fill-pill--muted  { background: var(--bg-inset); color: var(--ink-3); }

.th-card-date {
  font-size: var(--t-12);
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.th-card-title {
  font-size: var(--t-15);
  font-weight: 600;
  color: var(--ink-1);
  margin-top: 2px;
}

.th-card-meta {
  font-size: var(--t-12);
  color: var(--ink-3);
  margin-top: var(--s4);
}

.th-card-source {
  font-size: var(--t-11);
  color: var(--ink-4);
  font-style: italic;
}

/* Presence segmented control in the entry form — words, not letters */
.presence-seg {
  display: inline-flex;
  gap: var(--s8);
}
.presence-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s16);
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: var(--t-13);
  cursor: pointer;
  transition: border-color var(--dt-fast), background var(--dt-fast), color var(--dt-fast);
}
.presence-seg-btn:hover { border-color: var(--line-strong); color: var(--ink-1); }
.presence-seg-btn--active.presence-seg-btn--present {
  background: var(--ok-dim);
  border-color: var(--ok);
  color: var(--ok);
  font-weight: 600;
}
.presence-seg-btn--active.presence-seg-btn--absent {
  background: var(--err-dim, rgba(239, 68, 68, 0.12));
  border-color: var(--err);
  color: var(--err);
  font-weight: 600;
}

/* Previous-session context strip — grounds the reflective entry and the
   "Lien avec les choix précédents" rating without opening the history modal */
.prev-session {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s8);
  padding: var(--s8) var(--s12);
  margin-bottom: var(--s16);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-mid);
  border-radius: var(--r1);
  background: var(--bg-inset);
  font-size: var(--t-12);
}
.prev-session-label {
  font-size: var(--t-10);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex-shrink: 0;
}
.prev-session-date { color: var(--ink-2); font-weight: 600; flex-shrink: 0; }
.prev-session-picks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.prev-session-notes {
  flex-basis: 100%;
  color: var(--ink-3);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.prev-session-empty { color: var(--ink-3); font-style: italic; }

/* Reflective notes deserve room — this is the heart of the entry.
   Fixed height by design: a stable writing surface, no resize handle. */
.field-textarea--notes {
  height: 360px;
  min-height: 360px;
  resize: none;
}

/* ── La feuille de séance: participants as hands of cards ── */
.fds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--s12);
}
.fds-card {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s12) var(--s16);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dt-fast), box-shadow var(--dt-fast);
}
.fds-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.fds-card--absent .fds-card-name,
.fds-card--absent .fds-fan,
.fds-card--absent .fds-card-picks { opacity: 0.5; }
.fds-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s8);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.fds-card-name {
  font-size: var(--t-15);
  font-weight: 600;
  color: var(--ink-1);
}
.fds-card-top:hover .fds-card-name { color: var(--accent); }
.fds-fan { display: inline-flex; padding-left: 6px; flex: none; }
.fds-fan i {
  display: block;
  width: 14px;
  height: 20px;
  border-radius: 3px;
  margin-left: -6px;
  border: 1.5px solid var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.fds-fan i:nth-child(1) { rotate: -9deg; }
.fds-fan i:nth-child(2) { rotate: -2deg; translate: 0 -2px; }
.fds-fan i:nth-child(3) { rotate: 6deg; }
.fds-fan i:nth-child(4) { rotate: 13deg; translate: 0 2px; }
.fds-card-picks {
  font-size: var(--t-12);
  color: var(--ink-3);
  min-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.fds-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
  margin-top: auto;
}
.fds-presence { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; }
.fds-presence-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border: none;
  background: var(--surface);
  color: var(--ink-3);
  font-family: inherit;
  font-size: var(--t-11);
  cursor: pointer;
}
.fds-presence-btn + .fds-presence-btn { border-left: 1px solid var(--line); }
.fds-presence-btn:hover { color: var(--ink-1); }
.fds-presence-btn--active.fds-presence-btn--p { background: var(--ok-dim); color: var(--ok); font-weight: 600; }
.fds-presence-btn--active.fds-presence-btn--a { background: var(--err-dim, rgba(239,68,68,0.12)); color: var(--err); font-weight: 600; }
.fds-card-state { display: inline-flex; align-items: center; gap: var(--s4); }
.fds-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  background: var(--ok-dim);
  color: var(--ok);
}
.fds-card--add {
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: var(--s8);
  border-style: dashed;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--t-13);
  min-height: 110px;
}
.fds-card--add:hover { color: var(--accent); border-color: var(--accent); }
.fds-card--addform { justify-content: center; }

/* ── La table d'aujourd'hui (the mat) ── */
.mat {
  background: var(--mat, var(--bg-inset));
  border: 1px solid var(--mat-edge, var(--line));
  border-radius: 16px;
  padding: var(--s20) var(--s20) var(--s16);
  margin-bottom: var(--s16);
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.05);
}

/* Notes + observations attached to the spread, D's ".under" grid */
.mat-under {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: var(--s24);
  margin-top: var(--s20);
  border-top: 1px solid var(--mat-edge, var(--line));
  padding-top: var(--s16);
}
@media (max-width: 940px) {
  .mat-under { grid-template-columns: 1fr; }
}
.mat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
  font-size: var(--t-10);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s8);
}
.mat-notes .field-textarea {
  background: var(--surface);
  width: 100%;
}
.mat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
  margin-bottom: var(--s12);
}
.mat-caption {
  font-size: var(--t-10);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.mat-spread {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s12);
  align-items: stretch;
}
.mat-card { flex: none; }
/* A light "laid on the table" gesture — straightens on hover */
.mat-spread .mat-card:nth-child(odd)  { rotate: -1.2deg; }
.mat-spread .mat-card:nth-child(even) { rotate: 1deg; }
.mat-spread .mat-card:hover { rotate: 0deg; }
.mat-empty { color: var(--ink-3); font-style: italic; font-size: var(--t-12); align-self: center; }

.mat-slot {
  width: 280px;
  aspect-ratio: 471 / 347;
  border: 2px dashed var(--line-strong);
  border-radius: 10px;
  background: none;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--t-12);
  transition: border-color var(--dt-fast), color var(--dt-fast);
}
.mat-slot:hover { border-color: var(--accent); color: var(--accent); }
.mat-slot--open {
  border-style: solid;
  border-color: var(--accent);
  background: var(--surface);
  cursor: default;
  align-items: stretch;
  justify-content: flex-start;
  padding: var(--s8);
  gap: var(--s4);
}
.mat-slot-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink-1);
  font-family: inherit;
  font-size: var(--t-13);
  padding: var(--s4) 2px;
}
.mat-slot-input:focus { outline: none; border-bottom-color: var(--accent); }
.mat-slot-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}
.mat-slot-opt {
  display: flex;
  align-items: center;
  gap: var(--s8);
  padding: 4px 6px;
  border: none;
  border-radius: var(--r1);
  background: none;
  color: var(--ink-1);
  font-family: inherit;
  font-size: var(--t-12);
  text-align: left;
  cursor: pointer;
}
.mat-slot-opt:hover { background: var(--bg-inset); }
.mat-slot-opt-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-slot-opt-num { color: var(--ink-4); font-variant-numeric: tabular-nums; font-size: var(--t-11); }
.mat-slot-none { color: var(--ink-3); font-size: var(--t-12); padding: 4px 6px; font-style: italic; }
.mat-slot-all {
  margin-top: var(--s4);
  padding: 4px 6px;
  border: none;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: var(--t-12);
  text-align: left;
  cursor: pointer;
}
.mat-slot-all:hover { text-decoration: underline; }

/* Recurrence badge on a card face */
.topic-card-recurrence {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tc-ink);
  background: rgba(0,0,0,0.06);
  border: 1px solid var(--tc-line);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.topic-card--sm .topic-card-recurrence { top: 4px; left: 5px; font-size: 9px; padding: 0 5px; }

/* Deck overlay */
.deck-modal {
  max-width: 900px;
  width: min(900px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
}
.deck-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
  margin-bottom: var(--s12);
}

/* Observations header toggle */
.obs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s12);
}
.obs-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  font-family: var(--font);
  font-size: var(--t-12);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.obs-toggle input { accent-color: var(--accent); cursor: pointer; }
.score-scale--compact .score-segments { margin-top: var(--s4); }

/* ── Evolution surface — cards and observations on one time axis ──
   One CSS grid geometry shared by CardHistoryMatrix and ObservationTrends:
   [label 220px] [n session columns of --evo-col] [flexible tail].
   Borders fade (SWD pp.40–41): whitespace and color similarity do the
   grouping; the only accented element is "aujourd'hui" (Von Restorff). */
.evo-surface { overflow-x: auto; --evo-label: 220px; }
.evo-row {
  display: grid;
  grid-template-columns: var(--evo-label) repeat(var(--evo-n), var(--evo-col)) minmax(0, 1fr);
  align-items: center;
}
.evo-row--head { align-items: end; }
.evo-date {
  text-align: center;
  font-size: var(--t-11);
  color: var(--ink-3);
  padding: var(--s4) 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evo-date--today {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-dim);
  overflow: visible;
  text-overflow: clip;
}
.evo-row--card { min-height: 32px; }
.evo-label {
  display: flex;
  align-items: center;
  gap: var(--s8);
  min-width: 0;
  padding-right: var(--s16);
}
.evo-swatch { flex: none; width: 9px; height: 9px; border-radius: var(--r1); }
.evo-name {
  font-size: var(--t-13);
  color: var(--ink-1);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evo-count {
  flex: none;
  font-size: var(--t-12);
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.evo-cell {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}
.evo-cell--today { background: var(--accent-dim); }
/* ── Cards-over-time: the original recurrence grid ──
   Bordered table, sticky label column, one column per session; each chosen
   cell holds a tiny white card face with its category dot bottom-left
   (the printed card at thumbnail size). */
.history-grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  width: fit-content;
  max-width: 100%;
  background: var(--surface);
}
.history-grid {
  border-collapse: collapse;
  font-size: var(--t-12);
}
.history-grid th,
.history-grid td {
  padding: 4px 8px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.history-grid tr:last-child td { border-bottom: none; }
.history-grid th:last-child,
.history-grid td:last-child { border-right: none; }
.history-grid th {
  background: var(--bg-inset);
  font-weight: 500;
  color: var(--ink-3);
  font-size: var(--t-11);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.history-grid-corner {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 200px;
  text-align: left !important;
}
.history-grid-row-label {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  text-align: left !important;
  font-weight: 500;
  color: var(--ink-1);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-grid-row-count {
  margin-left: var(--s8);
  font-size: var(--t-11);
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.history-grid-col {
  font-variant-numeric: tabular-nums;
  min-width: 60px;
}
.history-grid-col--today { color: var(--accent); font-weight: 700; }
.history-grid-cell {
  width: 52px;
  height: 30px;
  padding: 0 !important;
  vertical-align: middle;
}
.history-grid-cell--today { background: var(--accent-dim); }
.history-mini-card {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 16px;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: 2px;
  vertical-align: middle;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.history-mini-card-dot {
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.history-grid-row-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: baseline;
}
.evo-sub {
  margin-top: var(--s12);
  padding-top: var(--s12);
  border-top: 1px solid var(--line);
  margin-bottom: var(--s4);
  font-size: var(--t-10);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.evo-label--trend {
  font-size: var(--t-12);
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.3;
}
.evo-trends { position: relative; }
.evo-band {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--evo-col);
  background: var(--accent-dim);
}
.evo-row--trend { position: relative; }
.evo-plot { min-width: 0; }
.evo-plot-svg { display: block; }
.evo-plot-line { stroke: var(--line-strong); stroke-width: 1.2; }
.evo-plot-letter {
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--ink-2);
}
.evo-plot-letter--today { font-size: 12px; font-weight: 700; fill: var(--accent); }
.evo-delta {
  padding-left: var(--s16);
  display: flex;
  align-items: baseline;
  gap: var(--s8);
  min-width: 0;
  font-size: var(--t-12);
  color: var(--ink-2);
}
.evo-delta-move { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.evo-delta-word {
  font-weight: 600;
  color: var(--ink-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evo-delta-empty { color: var(--ink-3); }

/* ── Editor header: who + presence, nothing else ── */
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s16);
  flex-wrap: wrap;
  margin-bottom: var(--s16);
}
.editor-head-name { margin: 0; font-size: var(--t-20); }

/* Compact session context strip above the participant view */
.session-strip {
  display: flex;
  align-items: center;
  gap: var(--s12);
  flex-wrap: wrap;
  padding: var(--s8) var(--s12);
  margin-bottom: var(--s16);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
  font-size: var(--t-12);
}
.session-strip-title { font-weight: 600; color: var(--ink-1); }
.session-strip-meta { color: var(--ink-3); }
.session-strip-progress {
  margin-left: auto;
  display: inline-flex;
  align-items: baseline;
  gap: var(--s4);
  white-space: nowrap;
}

/* Editor footer: report + BSP left, queue advance right */
.editor-footer-left { display: inline-flex; gap: var(--s4); }
.editor-footer { justify-content: space-between; }

/* ── Séance précédente — pinned under the notes ── */
.prevbox {
  margin-top: var(--s12);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-mid);
  border-radius: var(--r1);
  background: var(--surface);
  padding: var(--s8) var(--s12) var(--s12);
}
.prevbox-head {
  display: flex;
  align-items: center;
  gap: var(--s8);
  margin-bottom: var(--s8);
}
.prevbox-label { margin-bottom: 0; }
.prevbox-date { font-size: var(--t-13); font-weight: 600; color: var(--ink-1); }
.prevbox-nav { margin-left: auto; display: inline-flex; gap: 2px; }
.prevbox-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.prevbox-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.prevbox-nav-btn:disabled { opacity: 0.35; cursor: default; }
.prevbox-cards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s8);
}
/* Stylised card: still a card — white face, dot bottom-left — but dense:
   the title owns the face, no number, no brand. Readability over facsimile. */
.prevcard {
  --tc-ink: #2b2b2b;
  --tc-line: #d8d8d8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s8);
  width: 148px;
  min-height: 88px;
  padding: 10px 12px 8px;
  background: #ffffff;
  border: 1px solid var(--tc-line);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.prevcard-title {
  font-size: var(--t-14);
  font-weight: 600;
  line-height: 1.25;
  color: var(--tc-ink);
  overflow-wrap: anywhere;
}
.prevcard-dot {
  width: 11px;
  height: 11px;
  border-radius: var(--r-full);
  flex: none;
}
.prevbox-notes {
  margin-top: var(--s8);
  font-size: var(--t-13);
  color: var(--ink-2);
  line-height: 1.5;
}
.prevbox-empty { color: var(--ink-3); font-style: italic; font-size: var(--t-12); }

/* ── Objectifs panel — the participant's own words, always in view ── */
.obj-panel {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r1);
  background: var(--surface);
  padding: var(--s12) var(--s16);
  margin-bottom: var(--s16);
}
.obj-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s8);
  flex-wrap: wrap;
  margin-bottom: var(--s8);
}
.obj-panel-source { font-size: var(--t-11); color: var(--ink-3); }
.obj-panel-text {
  font-size: var(--t-14);
  line-height: 1.55;
  color: var(--ink-1);
  white-space: pre-line;
  max-width: 75ch;
}
.obj-panel-measure {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s8);
  margin-top: var(--s8);
  padding-top: var(--s8);
  border-top: 1px solid var(--line);
}
.obj-panel-measure-label {
  font-size: var(--t-10);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.obj-panel-measure-text { font-size: var(--t-13); color: var(--ink-2); }
.obj-panel-progression { font-size: var(--t-12); color: var(--ink-2); }

/* Informations complémentaires — clamped, expandable in place */
.obj-panel-infos {
  margin-top: var(--s12);
  padding-top: var(--s8);
  border-top: 1px solid var(--line);
}
.obj-panel-infos-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s8);
  margin-bottom: var(--s4);
}
.obj-panel-infos-toggle {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: var(--t-12);
  color: var(--accent);
  cursor: pointer;
}
.obj-panel-infos-toggle:hover { text-decoration: underline; }
.obj-panel-infos-text {
  font-size: var(--t-13);
  line-height: 1.55;
  color: var(--ink-2);
  white-space: pre-line;
  max-width: 75ch;
}
.obj-panel-infos-text--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── L'évolution — matrix and trends share one panel ── */
.evo-panel {
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
  padding: var(--s16) var(--s20);
  margin-bottom: var(--s16);
}
.evo-panel-head {
  display: flex;
  align-items: baseline;
  gap: var(--s12);
  flex-wrap: wrap;
  margin-bottom: var(--s12);
}
.evo-panel-help { font-size: var(--t-11); color: var(--ink-3); }

/* Queue advance */
.editor-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--s16);
  margin-top: var(--s8);
  border-top: 1px solid var(--line);
}




/* ── Card picker (cards as little boxes) ── */
.card-picker {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

.card-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}
.card-search {
  width: 100%;
  padding: var(--s8) var(--s12);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--ink-1);
  font-size: var(--t-13);
}
.card-search:focus { outline: none; border-color: var(--accent); }

.card-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.card-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  font-size: var(--t-11);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.card-cat-chip:hover { border-color: var(--accent); color: var(--ink-1); }
.card-cat-chip--active {
  background: var(--bg-inset);
  border-color: var(--ink-2);
  color: var(--ink-1);
  font-weight: 600;
}
.card-cat-chip-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.card-cat-chip-num { font-weight: 600; }
/* Show category names, not just numbers — labels shouldn't need a tooltip */
.card-cat-chip-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .card-cat-chip-name { display: none; } /* fall back to number+dot on narrow screens */
}

.card-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--s8) 0;
  min-height: 36px;
}

/* ── TopicCard: on-screen facsimile of the printed card ──
   Landscape 471×347, title centred, bottom-left dot + number +
   Base/Supplémentaire, bottom-right "L'Eveil".
   The face is ALWAYS white with dark text (it mimics the physical
   printed card) in both light and dark themes; only its
   surroundings (grids, modals) follow the app theme. */
.topic-card {
  --tc-ink: #2b2b2b;
  --tc-line: #d8d8d8;
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 471 / 347;
  container-type: inline-size;
  background: #ffffff;
  color: var(--tc-ink);
  border: 1px solid var(--tc-line);
  padding: 0;
  font-family: inherit;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.topic-card--sm { width: 168px; border-radius: 6px; }
.topic-card--md { width: 280px; border-radius: 10px; }

/* Cards placed in a fluid grid stretch to their track. */
.card-grid .topic-card { width: 100%; }

.topic-card--clickable {
  cursor: pointer;
  transition: box-shadow var(--dt-fast), transform var(--dt-fast);
}
.topic-card--clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}
.topic-card--clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Selection: outer ring + elevation — never recolour the face. */
.topic-card--selected,
.topic-card--selected:hover {
  transform: none;
  box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0, 0, 0, 0.14);
}

.topic-card-title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8% 9% 0;
  font-weight: 500;
  line-height: 1.3;
  color: var(--tc-ink);
  overflow-wrap: anywhere;
  /* fixed fallback first, container-relative scaling when supported */
  font-size: 12px;
  font-size: clamp(10px, 5.6cqw, 30px);
}
.topic-card--md .topic-card-title { font-size: 17px; font-size: clamp(10px, 5.6cqw, 30px); }

.topic-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4%;
  padding: 0 9% 7.5%;
  color: #222222;
  font-size: 8px;
  font-size: clamp(8px, 3cqw, 15px);
}
.topic-card--md .topic-card-footer { font-size: 11px; font-size: clamp(8px, 3cqw, 15px); }
.topic-card-footer-left {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  min-width: 0;
}
.topic-card-dot {
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  flex: none;
}
.topic-card-num { font-variant-numeric: tabular-nums; }
.topic-card-kind {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topic-card-brand { white-space: nowrap; }

/* Overlays (UI affordances on top of the face) */
.topic-card-order {
  position: absolute;
  top: 5px;
  left: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.topic-card-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  border: none;
  background: none;
  color: #8a8a8a; /* fixed: the face is always white */
  cursor: pointer;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  border-radius: 50%;
}
.topic-card-remove:hover {
  color: var(--err);
  background: rgba(0, 0, 0, 0.06);
}

/* Legacy small chip — still used by the editor's previous-session strip
   and the measure-objectives strip (labels, not card facsimiles). */
.card-tile {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--ink-1);
  font-family: inherit;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.card-tile-name {
  font-weight: 500;
  word-break: break-word;
}
.card-tile--mini {
  width: auto;
  min-height: 0;
  padding: 2px 6px;
  font-size: 10px;
  border-top-width: 3px;
  border-radius: 3px;
}

.card-grid-wrap {
  max-height: 460px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--bg-inset);
  padding: 8px;
}
.card-grid-group {
  margin-bottom: 12px;
}
.card-grid-group:last-child { margin-bottom: 0; }
.card-grid-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 4px 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

/* ── Observations — proposal D's compact lettered dots ──
   One row per dimension: caption + selected level spelled out, then five
   lettered dots. Explanations (the prompt + the shown level's criteria)
   unfold under the row when the toggle is on. */
.obs-rows {
  display: flex;
  flex-direction: column;
}
.obs-row {
  padding: var(--s8) 0;
  border-top: 1px solid var(--line);
}
.obs-row:first-child { border-top: none; padding-top: 0; }
.obs-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s8);
  margin-bottom: 5px;
}
.obs-row-label {
  font-size: var(--t-14);
  font-weight: 600;
  color: var(--ink-1);
  min-width: 0;
}
.obs-row-value {
  font-size: var(--t-13);
  color: var(--ink-1);
  white-space: nowrap;
  flex: none;
}
.obs-row-value strong {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}
.obs-row-value--empty { color: var(--ink-3); }
.obs-dots {
  display: inline-flex;
  gap: 8px;
}
.obs-dot {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--t-13);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--dt-fast), background var(--dt-fast), color var(--dt-fast), scale var(--dt-fast);
}
.obs-dot:hover { border-color: var(--accent); color: var(--accent); scale: 1.08; }
.obs-dot--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.obs-dot--active:hover { color: #fff; }
.obs-explain {
  margin-top: var(--s8);
  font-size: var(--t-13);
  line-height: 1.5;
}
.obs-explain-q {
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: var(--s4);
}
/* All five criteria share the same grid cell (visibility-toggled): the block
   keeps the height of the tallest one — no reflow while hovering/selecting. */
.obs-explain-stack { display: grid; }
.obs-explain-item {
  grid-area: 1 / 1;
  visibility: hidden;
  color: var(--ink-2);
}
.obs-explain-item--shown { visibility: visible; }
.obs-explain-hint { color: var(--ink-3); font-style: italic; }

/* Copy-report button feedback */
.btn-copied { color: var(--ok); }

/* ── Page header bar ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s20);
  gap: var(--s16);
}

.page-header-meta {
  font-size: var(--t-13);
  color: var(--ink-3);
}

/* ── Forms ── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  margin-bottom: var(--s12);
}
.field-label {
  font-size: var(--t-11);
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-input,
.field-textarea {
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--ink-1);
  padding: var(--s8) var(--s12);
  font-size: var(--t-13);
  font-family: var(--font);
}
.field-textarea { min-height: 100px; resize: vertical; }
.field-input:focus,
.field-textarea:focus { outline: none; border-color: var(--accent); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--t-11);
  font-weight: 500;
  border-radius: var(--r1);
}
.badge-muted { background: var(--bg-inset); color: var(--ink-3); }
.badge-accent { background: var(--accent-dim); color: var(--accent); }
/* BSP chip: 1-on-1 bilan meetings interleaved in the séances timeline. */
.badge-bsp { background: var(--warn-dim); color: var(--warn); }

/* Clickable badge used as a header entry point (e.g. Admin), matching PMO. */
.badge-clickable { cursor: pointer; user-select: none; }
.badge-clickable:hover { filter: brightness(0.96); }
.badge-clickable.active { background: var(--accent); color: var(--surface); }

/* ── Empty state ── */
.empty-state {
  padding: var(--s32) var(--s16);
  text-align: center;
  color: var(--ink-3);
  font-size: var(--t-13);
  border: 1px dashed var(--line);
  border-radius: var(--r1);
}

/* ── Modal-ish overlay (used by ad-hoc TH form) ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-card {
  background: var(--surface);
  border-radius: var(--r1);
  padding: var(--s24);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
}
.modal-title {
  font-size: var(--t-16);
  font-weight: 600;
  margin-bottom: var(--s16);
  color: var(--ink-1);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s8);
  margin-top: var(--s16);
}

/* ── Impersonation banner ── */
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s12);
  padding: var(--s8) var(--s16);
  margin-bottom: var(--s16);
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: var(--r1);
  font-size: var(--t-13);
  color: var(--ink-1);
}

/* ── Profile menu (user tag dropdown: name, email, language) ── */
.profile-menu {
  position: relative;
  display: flex;
  align-items: center;
}
.profile-menu-trigger {
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r1);
  padding: 3px var(--s8);
  cursor: pointer;
  font: inherit;
}
.profile-menu-trigger:hover,
.profile-menu-trigger[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface);
}
.profile-menu-chevron {
  color: var(--ink-3);
  transition: transform var(--dt-fast);
}
.profile-menu-chevron--open { transform: rotate(180deg); }
.profile-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: var(--s8);
  z-index: 60;
}
.profile-menu-header { padding: var(--s4) var(--s8) var(--s8); }
.profile-menu-name {
  font-size: var(--t-13);
  font-weight: 600;
  color: var(--ink-1);
}
.profile-menu-email {
  font-size: var(--t-11);
  color: var(--ink-3);
  margin-top: 2px;
  word-break: break-all;
}
.profile-menu-divider {
  height: 1px;
  background: var(--line);
  margin: var(--s4) 0 var(--s8);
}
.profile-menu-section-label {
  font-size: var(--t-10, 10px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 var(--s8) var(--s4);
}
.profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
  width: 100%;
  border: none;
  background: transparent;
  border-radius: var(--r1);
  padding: var(--s4) var(--s8);
  font-size: var(--t-12);
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.profile-menu-item:hover { background: var(--bg); color: var(--ink-1); }
.profile-menu-item--active { color: var(--accent); font-weight: 600; }

/* ── Participant history button (per-row) ── */

/* ── History modal ── */
.history-modal {
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
}
.history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s12);
  margin-bottom: var(--s16);
}
.history-subtitle {
  font-size: var(--t-13);
  color: var(--ink-3);
}
.history-section {
  margin-top: var(--s20);
  padding-top: var(--s16);
  border-top: 1px solid var(--line);
}
.history-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: var(--s12);
}
.history-help {
  font-size: var(--t-11);
  color: var(--ink-3);
  margin-bottom: var(--s8);
}

/* evolution surface inside the (narrower) history modal */
.evo-surface--modal { --evo-label: 180px; }

/* Session entry progress (header, right side) */
.session-progress {
  display: inline-flex;
  align-items: center;
  gap: var(--s8);
  white-space: nowrap;
}
.session-progress-count {
  font-size: var(--t-15);
  font-weight: 650;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}
.session-progress-label {
  font-size: var(--t-12);
  color: var(--ink-3);
}
.session-progress-bar {
  display: inline-block;
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  overflow: hidden;
}
.session-progress-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width var(--dt-fast);
}
.history-note-pick-tiles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* notes per session */
.history-notes {
  display: flex;
  flex-direction: column;
  gap: var(--s12);
}
.history-note {
  padding: var(--s8) var(--s12);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
}
.history-note-date {
  font-size: var(--t-11);
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.history-note-title {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-3);
}
.history-note-picks {
  font-size: var(--t-13);
  color: var(--ink-1);
  margin-bottom: 4px;
}
.history-note-text {
  font-size: var(--t-12);
  color: var(--ink-2);
  white-space: pre-wrap;
  font-style: italic;
}

/* ── Logo settings (admin) ── */
.logo-settings { max-width: 600px; }
.logo-settings-row {
  display: flex;
  align-items: center;
  gap: var(--s16);
}
.logo-preview {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: var(--r1);
  background: var(--bg-inset);
  flex-shrink: 0;
  overflow: hidden;
}
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.logo-placeholder {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.logo-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

/* topbar logo */
.brand-logo {
  height: 22px;
  margin-right: var(--s8);
  vertical-align: middle;
}

/* ── Save indicator ── */
.save-indicator {
  font-size: var(--t-11);
  color: var(--ink-3);
  font-style: italic;
}

/* ── UI polish (PR: feat/ui-polish) ── */

/* Opening feedback on session cards (Doherty: acknowledge the click) */
.th-card--opening {
  opacity: 0.7;
  pointer-events: none;
}

/* Keyboard focus must be visible on all small interactive controls */
.presence-seg-btn:focus-visible,
.score-segment:focus-visible,
.card-cat-chip:focus-visible,
.topic-card-remove:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  z-index: 1;
}

/* ── Participant tabs (design-kit .tabs; Krug pp.625-626) ── */
.participant-tabs {
  flex-wrap: wrap;             /* many participants → second row, no scroll */
  align-items: center;
  row-gap: 2px;
}
/* Kit tabs are uppercase section labels; participant NAMES stay as written */
.participant-tabs .tab {
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-state--done { color: var(--ok); }
.tab-state--absent { color: var(--err); }
.tab--absent { opacity: 0.6; }
.tab--add { color: var(--ink-3); }
.tab--add:hover { color: var(--ink-1); }
.tab-add-form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--s8);
}
.tab-add-form .field-input { width: 160px; padding: 3px 8px; font-size: var(--t-13); }

/* ── Mes Participant-es ── */
.pt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--s12);
}
.pt-card { margin-bottom: 0; }
.pt-card-name {
  font-size: var(--t-15);
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: var(--s12);
  transition: color var(--dt-fast, 120ms);
}
.pt-card:hover .pt-card-name { color: var(--accent); }
.pt-card-stats {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.pt-stat {
  display: flex;
  justify-content: space-between;
  gap: var(--s8);
  font-size: var(--t-12);
}
.pt-stat-label { color: var(--ink-3); }
.pt-stat-value { color: var(--ink-1); font-weight: 500; white-space: nowrap; }

.pt-v2-warning {
  padding: var(--s8) var(--s12);
  margin-bottom: var(--s12);
  font-size: var(--t-12);
  color: var(--ink-2);
  background: rgba(234, 179, 8, 0.10);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: var(--r1);
}

.pt-source {
  font-size: var(--t-11);
  font-weight: 400;
  color: var(--ink-3);
  text-transform: none;
  letter-spacing: normal;
}
.pt-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  font-size: var(--t-13);
  color: var(--ink-2);
}
.pt-text {
  font-size: var(--t-13);
  color: var(--ink-2);
  white-space: pre-line;
  line-height: 1.5;
  max-width: 72ch;
}

/* Pick rows on the participant detail page (TopicCard tiles) */
.pick-row { display: flex; flex-wrap: wrap; gap: var(--s8); }

/* ══ Participant portrait page ══ */

/* Portrait header — identity first, the key dates woven in */
.pd-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s16);
  margin-bottom: var(--s8);
}
.pd-head .btn { margin-top: 6px; flex: none; }
.pd-head-main { min-width: 0; }
.pd-name {
  margin: 0 0 var(--s4);
  font-size: var(--t-20);
  font-weight: 650;
  color: var(--ink-1);
}
.pd-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--s8);
  row-gap: 2px;
  font-size: var(--t-12);
  color: var(--ink-3);
}
.pd-meta-item strong { color: var(--ink-1); font-weight: 600; }
.pd-meta-sep { color: var(--line-strong); }

.pd-section { margin-top: var(--s32); }
.pd-section-title {
  font-size: var(--t-13);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin: 0 0 var(--s12) 0;
}

/* The participant's own words — the emotional anchor of the page */
.pd-quote {
  margin: 0 0 var(--s20);
  padding: var(--s4) 0 var(--s4) var(--s20);
  border-left: 3px solid var(--accent);
}
.pd-quote-text {
  margin: 0;
  font-size: var(--t-15);
  line-height: 1.65;
  color: var(--ink-1);
  white-space: pre-line;
  max-width: 64ch;
}
.pd-quote-src {
  margin-top: var(--s8);
  font-size: var(--t-11);
  color: var(--ink-3);
}

/* Secondary objective sources — quiet blocks, no boxes */
.pd-block { margin-top: var(--s16); }
.pd-block-title {
  font-size: var(--t-12);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: var(--s8);
  display: flex;
  align-items: baseline;
  gap: var(--s8);
  flex-wrap: wrap;
}
.pd-block-row { margin-top: var(--s8); display: flex; flex-direction: column; gap: var(--s4); }

/* Premier entretien — a folded drawer, present but not shouting */
.pd-details {
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
}
.pd-details-summary {
  display: flex;
  align-items: baseline;
  gap: var(--s12);
  padding: var(--s12) var(--s16);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.pd-details-summary::-webkit-details-marker { display: none; }
.pd-details-summary::before {
  content: '';
  align-self: center;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--ink-3);
  transition: transform var(--dt-fast, 120ms);
}
.pd-details[open] .pd-details-summary::before { transform: rotate(90deg); }
.pd-details-title { margin: 0; }
.pd-details-summary:hover .pd-details-title { color: var(--ink-1); }
.pd-details-body { padding: var(--s4) var(--s16) var(--s16); }
.pd-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s12);
}
.pd-info-field {
  min-width: 0;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s8) var(--s12) var(--s12);
}
.pd-info-field--wide { grid-column: 1 / -1; }
.pd-info-label {
  font-size: var(--t-10);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  margin-bottom: var(--s8);
}
.pd-info-field .pt-text {
  color: var(--ink-1);
  overflow-wrap: anywhere;
  max-width: none;
}

/* Journal des séances */
.pd-journal { display: flex; flex-direction: column; }
.pd-entry { padding: var(--s16) 0; border-top: 1px solid var(--line); }
.pd-journal > .pd-entry:first-child { border-top: none; padding-top: var(--s4); }
.pd-entry-head {
  display: flex;
  align-items: baseline;
  gap: var(--s8);
  flex-wrap: wrap;
  margin-bottom: var(--s8);
}
.pd-entry-date { font-size: var(--t-13); font-weight: 600; color: var(--ink-1); }
.pd-entry-meta { font-size: var(--t-12); color: var(--ink-3); }
.pd-badge-absent { color: var(--err); }
.pd-entry-picks { margin-bottom: var(--s8); }
/* Compact card-face chip: white like the physical deck, even in dark mode */
.pd-pick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: var(--r1);
  padding: 4px 10px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  font-size: var(--t-12);
  color: #2e2e2e;
  max-width: 100%;
}
.pd-pick-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.pd-pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-pick-num {
  color: #9a9a9a;
  font-size: var(--t-11);
  font-variant-numeric: tabular-nums;
}
.pd-entry-notes {
  font-size: var(--t-13);
  color: var(--ink-2);
  line-height: 1.55;
  white-space: pre-line;
  max-width: 72ch;
  margin-bottom: var(--s8);
}
.pd-entry-obs {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--s20);
  row-gap: var(--s4);
}
.pd-obs {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s4);
  font-size: var(--t-11);
}
.pd-obs-label { color: var(--ink-3); }
.pd-obs-value {
  font-family: var(--font-mono);
  font-size: var(--t-12);
  font-weight: 600;
  color: var(--ink-1);
}

/* ══════════════════════════════════════════════════
   Flip card, labeled observation scale, rich notes
   ══════════════════════════════════════════════════ */

/* ── The mat flips between today's entry and the history ── */
.mat-flip { perspective: 1600px; }
.mat-flip > .mat {
  transform: rotateY(0deg);
  transition: transform 170ms ease-out;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.mat-flip--out > .mat { transform: rotateY(90deg); transition-timing-function: ease-in; }
.mat-flip--in  > .mat { transform: rotateY(-90deg); transition: none; }
@media (prefers-reduced-motion: reduce) {
  .mat-flip > .mat { transition: none !important; transform: none !important; }
}

.mat-head-actions { display: inline-flex; gap: var(--s4); }

/* Back face blocks read as quiet surfaces on the mat */
.mat--back { display: flex; flex-direction: column; gap: var(--s12); }
.mat--back .mat-head { margin-bottom: 0; }
.back-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s12) var(--s16);
}
.back-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s12);
  flex-wrap: wrap;
  margin-bottom: var(--s8);
}

/* ── Observations as a labeled, connected scale ── */
.obs-scale {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-top: var(--s4);
}
/* the connecting line runs through the dot centres (first to last stop) */
.obs-scale::before {
  content: '';
  position: absolute;
  top: 16px;                 /* half the 32px dot */
  left: 10%;
  right: 10%;
  height: 1.5px;
  background: var(--line-strong);
}
.obs-stop {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.obs-stop .obs-dot {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
}
.obs-stop-label {
  font-size: var(--t-11);
  line-height: 1.25;
  text-align: center;
  color: var(--ink-3);
  max-width: 100%;
  padding: 0 3px;
}
.obs-stop-label--active { color: var(--ink-1); font-weight: 600; }
.obs-stop:hover .obs-stop-label { color: var(--ink-1); }

/* ── Rich notes: toolbar + auto-expanding editable area + versions ── */
.richnotes {
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
}
.richnotes-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--s4) var(--s8);
  border-bottom: 1px solid var(--line);
  background: var(--bg-inset);
  border-radius: var(--r1) var(--r1) 0 0;
  flex-wrap: wrap;
}
.richnotes-tool {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  padding: 4px 7px;
  border: none;
  border-radius: var(--r1);
  background: none;
  color: var(--ink-2);
  font-family: inherit;
  font-size: var(--t-12);
  cursor: pointer;
}
.richnotes-tool:hover { background: var(--surface); color: var(--ink-1); }
.richnotes-bar-sep { width: 1px; height: 16px; background: var(--line); margin: 0 var(--s4); }
.richnotes-bar-spacer { flex: 1; }
.richnotes-savestate {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--t-11);
  color: var(--ok);
  white-space: nowrap;
}
.richnotes-savestate--saving { color: var(--ink-3); font-style: italic; }
.richnotes-savestate--error { color: var(--danger, #b3261e); font-weight: 600; }
.richnotes-versions { position: relative; }
.richnotes-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  box-shadow: var(--shadow-md);
  padding: var(--s8);
}
.richnotes-pop-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  width: 100%;
  padding: var(--s8);
  border: 1px solid var(--accent);
  border-radius: var(--r1);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: inherit;
  font-size: var(--t-12);
  font-weight: 600;
  cursor: pointer;
}
.richnotes-pop-save:hover { background: var(--accent); color: #fff; }
.richnotes-pop-list {
  margin-top: var(--s8);
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.richnotes-pop-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: var(--s4) var(--s8);
  border: none;
  border-radius: var(--r1);
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.richnotes-pop-item:hover { background: var(--bg-inset); }
.richnotes-pop-date { font-size: var(--t-11); font-weight: 600; color: var(--ink-1); }
.richnotes-pop-preview {
  font-size: var(--t-11);
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.richnotes-pop-empty { padding: var(--s8); font-size: var(--t-12); color: var(--ink-3); font-style: italic; }

.richnotes-editorwrap { position: relative; }
.richnotes-editor {
  min-height: 300px;
  padding: var(--s12);
  font-size: var(--t-14);
  line-height: 1.55;
  color: var(--ink-1);
  outline: none;
  overflow-wrap: anywhere;
}
.richnotes-editor:focus { box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 0 0 var(--r1) var(--r1); }
.richnotes-editor ul, .richnotes-editor ol { margin: 4px 0; padding-left: 22px; }
.richnotes-placeholder {
  position: absolute;
  top: var(--s12);
  left: var(--s12);
  right: var(--s12);
  color: var(--ink-3);
  font-size: var(--t-14);
  pointer-events: none;
}

/* ── Observation graphs (card-table style, back face) ── */
.obsgraphs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s12);
}
.obsgraph {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s8) var(--s12);
  background: var(--surface);
}
.obsgraph-cap {
  font-size: var(--t-11);
  font-weight: 600;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.obsgraph-spark { display: block; }
.obsgraph-delta { font-size: var(--t-12); color: var(--ink-2); }
.obsgraph-delta-letters { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.obsgraph-delta-empty { color: var(--ink-3); }

/* ── Round 5: merged header, white observations, side-by-side history ── */
.session-strip--participant { flex-direction: column; align-items: stretch; gap: var(--s8); }
.session-strip-row { display: flex; align-items: center; gap: var(--s12); flex-wrap: wrap; }
.session-strip-row--who {
  border-top: 1px solid var(--line);
  padding-top: var(--s8);
}
.session-strip-name {
  font-size: var(--t-17);
  font-weight: 650;
  color: var(--ink-1);
  display: inline-flex;
  align-items: baseline;
  gap: var(--s8);
}
.session-strip-name-meta { font-size: var(--t-11); font-weight: 400; color: var(--ink-3); }
.session-strip-next {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: var(--t-12);
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.session-strip-next:hover { text-decoration: underline; text-underline-offset: 3px; }
.session-strip-progress { margin-left: auto; }

/* Observations: label outside (like the other mat captions), the scales on
   their own white surface */
.mat-obs { align-self: start; }
.mat-obs-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s12) var(--s16) var(--s16);
}
.obs-stop-label { font-size: var(--t-12); }
.mat-footer { margin-top: var(--s16); }
.mat-copy {
  width: 100%;
  justify-content: center;
}

/* Back face: matrix and observation graphs side by side */
.back-evo {
  display: flex;
  gap: var(--s24);
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 1080px;
}
.back-evo-matrix { flex: 1 1 480px; min-width: 0; }
.back-evo-graphs { flex: 0 1 300px; }
.back-evo-graphs .obsgraphs { grid-template-columns: 1fr; }

/* ══════════════════════════════════════════════════
   Mes Participant-es — rework of the overview cards ("ptv-").
   Each card: name + tenure, a fan of the participant's recurring
   theme colours, a présence timeline whose marks sit proportionally
   in time (the rhythm is the picture), and a next-session countdown.
   ══════════════════════════════════════════════════ */

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

.ptv-card {
  display: flex;
  flex-direction: column;
  gap: var(--s12);
}

/* head: name + tenure on the left, the colour fan on the right */
.ptv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s8);
}
.ptv-head-text { min-width: 0; }
.ptv-card .pt-card-name { margin-bottom: 2px; }
.ptv-tenure {
  font-size: var(--t-12);
  color: var(--ink-3);
}

/* the fan of recurring theme colours — same motif as the feuille de séance */
.ptv-fan {
  display: inline-flex;
  flex: none;
  padding: 4px 4px 0 10px;
}
.ptv-fan i {
  display: block;
  width: 14px;
  height: 20px;
  border-radius: 3px; /* card-face motif, matches .fds-fan */
  margin-left: -6px;
  border: 1.5px solid var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.ptv-fan i:nth-child(1) { rotate: -9deg; }
.ptv-fan i:nth-child(2) { rotate: -2deg; translate: 0 -2px; }
.ptv-fan i:nth-child(3) { rotate: 6deg; }
.ptv-fan i:nth-child(4) { rotate: 13deg; translate: 0 2px; }

/* présence timeline */
.ptv-timeline { margin-top: var(--s4); }
.ptv-tl-kicker {
  font-size: var(--t-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: var(--s8);
}
.ptv-track {
  position: relative;
  height: 10px;
  margin: 0 5px; /* room for the outermost marks */
}
.ptv-track::before {
  content: '';
  position: absolute;
  left: -5px;
  right: -5px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--line);
}
.ptv-mark {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border-radius: var(--r1);
  box-sizing: border-box;
}
.ptv-mark--present {
  background: var(--accent);
  border: 1px solid var(--accent);
}
.ptv-mark--missed {
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
}
.ptv-mark--upcoming {
  background: var(--accent-dim);
  border: 1.5px solid var(--accent-mid);
}
.ptv-axis {
  display: flex;
  justify-content: space-between;
  gap: var(--s8);
  margin-top: var(--s4);
  font-size: var(--t-11);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.ptv-axis--next { color: var(--accent); font-weight: 500; }
.ptv-axis--center { justify-content: center; }

/* foot: countdown to the next Espace Évolution */
.ptv-foot {
  margin-top: auto;
  padding-top: var(--s8);
  border-top: 1px solid var(--line);
  font-size: var(--t-12);
}
.ptv-next { color: var(--ink-2); }
.ptv-next strong { color: var(--accent); font-weight: 600; }
.ptv-last { color: var(--ink-3); }

/* ── motion: a quiet arrival, a small hover response ── */
@media (prefers-reduced-motion: no-preference) {
  /* cards drift up as they arrive, one after the other */
  .ptv-card {
    animation: ptv-card-in 340ms cubic-bezier(0.2, 0.6, 0.3, 1) both;
    animation-delay: calc(var(--ci, 0) * 55ms);
  }
  @keyframes ptv-card-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* the track draws itself, then the marks settle onto it in order */
  .ptv-track::before {
    animation: ptv-track-draw 480ms ease-out both;
    animation-delay: calc(var(--ci, 0) * 55ms + 120ms);
    transform-origin: left center;
  }
  @keyframes ptv-track-draw {
    from { scale: 0 1; }
    to   { scale: 1 1; }
  }
  .ptv-mark {
    animation: ptv-mark-in 300ms cubic-bezier(0.2, 0.6, 0.3, 1) both;
    animation-delay: calc(var(--ci, 0) * 55ms + 200ms + var(--i, 0) * 45ms);
  }
  @keyframes ptv-mark-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }

  /* hover: the fan opens a little, the marks sit up */
  .ptv-fan i { transition: rotate 160ms ease, translate 160ms ease; }
  .ptv-card:hover .ptv-fan i:nth-child(1) { rotate: -14deg; translate: -1px 0; }
  .ptv-card:hover .ptv-fan i:nth-child(2) { rotate: -4deg; translate: 0 -3px; }
  .ptv-card:hover .ptv-fan i:nth-child(3) { rotate: 9deg; translate: 0 -1px; }
  .ptv-card:hover .ptv-fan i:nth-child(4) { rotate: 18deg; translate: 1px 2px; }
  .ptv-mark { transition: box-shadow 160ms ease; }
  .ptv-card:hover .ptv-mark--present { box-shadow: 0 0 0 2px var(--accent-dim); }
}

/* ── Merged evolution table: observation letters share the card grid ── */
.history-grid-divider td {
  background: var(--bg-inset);
  text-align: left !important;
  font-size: var(--t-10);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 5px 8px;
}
.history-grid-evo {
  text-align: left !important;
  min-width: 150px;
  max-width: 220px;
  white-space: normal !important;
}
th.history-grid-evo {
  text-align: left !important;
}
td.history-grid-evo {
  font-size: var(--t-12);
  padding: 4px 10px;
}
.evo-delta-letters {
  font-family: var(--font-mono);
  font-size: var(--t-11);
  color: var(--ink-3);
  margin-right: var(--s8);
  white-space: nowrap;
}
.evo-delta-word { font-weight: 600; color: var(--ink-1); }
/* The letter itself is the data point — tinted deeper as the level rises */
.evo-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  border-radius: var(--r1);
  font-family: var(--font-mono);
  font-size: var(--t-12);
  font-weight: 700;
}
.evo-letter[data-level="1"] { background: color-mix(in srgb, var(--accent) 8%,  var(--surface)); color: var(--ink-2); }
.evo-letter[data-level="2"] { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--ink-1); }
.evo-letter[data-level="3"] { background: color-mix(in srgb, var(--accent) 34%, var(--surface)); color: var(--ink-1); }
.evo-letter[data-level="4"] { background: color-mix(in srgb, var(--accent) 58%, var(--surface)); color: #fff; }
.evo-letter[data-level="5"] { background: var(--accent); color: #fff; }

/* ── Round 7: a date under every présence mark (two lines: day / month) ── */
.ptv-dates {
  position: relative;
  height: 26px;
  margin: 10px 5px 0;   /* same inset as .ptv-track so positions line up */
}
.ptv-date {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  color: var(--ink-3);
  white-space: nowrap;
}
.ptv-date--first { transform: translateX(-2px); align-items: flex-start; }
.ptv-date--last { transform: translateX(calc(-100% + 2px)); align-items: flex-end; }
.ptv-date-day {
  font-size: var(--t-11);
  font-weight: 650;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.ptv-date-month { font-size: var(--t-10); }
.ptv-date--next .ptv-date-day,
.ptv-date--next .ptv-date-month { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .ptv-card .ptv-date {
    opacity: 0;
    animation: ptv-mark-in 260ms ease-out forwards;
    animation-delay: calc(340ms + var(--i) * 45ms);
  }
}

/* ── Admin: accent colour picker ── */
.accent-swatches { display: flex; flex-wrap: wrap; gap: var(--s8); margin-bottom: var(--s12); }
.accent-swatch {
  width: 34px;
  height: 34px;
  border-radius: var(--r1);
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0;
}
.accent-swatch:hover { outline: 2px solid var(--line-strong); outline-offset: 1px; }
.accent-swatch--active { outline: 2px solid var(--ink-1); outline-offset: 1px; }
.accent-custom { display: flex; align-items: center; gap: var(--s16); flex-wrap: wrap; }
.accent-custom-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s8);
  font-size: var(--t-13);
  color: var(--ink-2);
  cursor: pointer;
}
.accent-custom-label input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: none;
  cursor: pointer;
}
.accent-custom-hex { font-family: var(--font-mono); font-size: var(--t-12); color: var(--ink-3); }

/* Second tenure line: days around + cadence */
.ptv-tenure--stats { margin-top: 1px; }
.ptv-tenure--stats strong { color: var(--accent); font-weight: 650; }
