/* ─────────────────────────────────────────────────────────────────
   SAGIP'26 — Carnet de conférence
   Direction : éditorial scientifique, asymétrie maîtrisée, typo expressive
   (Fraunces variable display + DM Sans + JetBrains Mono).
   Mobile-first, desktop : layout rail + stage + margin (3 colonnes).
   ───────────────────────────────────────────────────────────────── */

:root {
  /* — Palette dérivée tokens SAGIP avec accents éditoriaux — */
  --ink:        #0A1024;
  --ink-2:      #2C3454;
  --muted:      #6E7793;
  --line:       #E5E8F0;
  --line-2:     #EEF1F7;
  --paper:      #F7F4EC;   /* fond éditorial chaud (papier) */
  --paper-2:    #EFE9DA;
  --surface:    #FFFFFF;

  --brand:      #0B1F5C;
  --brand-2:    #1F4FBF;
  --brand-glow: #5CC6F5;
  --night:      #07123A;

  --accent:     #F2B400;
  --accent-2:   #C97900;
  --accent-soft:#FFE9A8;

  --ok:         #1D9A6C;
  --warn:       #E08A00;
  --danger:     #B33A3A;

  /* — Typo — */
  --ff-display: "Fraunces", "Georgia", serif;
  --ff-sans:    "DM Sans", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --ff-mono:    "JetBrains Mono", ui-monospace, monospace;

  --r-1: 4px;
  --r-2: 8px;
  --r-3: 14px;
  --r-4: 22px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(900px 600px at 110% -20%, rgba(31,79,191,.06), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(242,180,0,.07), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--accent-soft); color: var(--ink); }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .5rem .8rem; z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ─── Live banner (événement en cours) ─── */
.live-banner {
  position: sticky; top: 0; z-index: 200;
  background: linear-gradient(90deg, #B33A3A 0%, var(--brand) 80%);
  color: #fff;
  font-family: var(--ff-sans);
  font-size: .82rem;
  padding: .45rem 1rem;
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,.2);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.live-banner:hover { text-decoration: none; color: #fff; }
.live-banner .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.7);
  animation: live-pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
  70%  { box-shadow: 0 0 0 9px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.live-banner .tag {
  font-family: var(--ff-mono); font-size: .65rem;
  letter-spacing: .18em; text-transform: uppercase;
  font-weight: 600; opacity: .9;
}
.live-banner .live-title {
  font-weight: 500; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-banner .live-time {
  font-family: var(--ff-mono); font-size: .76rem;
  opacity: .85; letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.live-banner .arrow { opacity: .8; }
.live-banner[hidden] { display: none; }

/* ─────────────────────────────────────────────────────────────────
   Layout : RAIL (desktop) + STAGE + MARGIN
   ───────────────────────────────────────────────────────────────── */

body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "main";
  padding-bottom: 78px; /* dock height */
}

.rail { display: none; }

.stage {
  grid-area: main;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: calc(100vh - 78px);
}
.view { padding: 1rem 1.2rem 2rem; max-width: 760px; margin: 0 auto; width: 100%; }
.margin { display: none; }

@media (min-width: 980px) {
  body {
    grid-template-columns: 232px 1fr;
    grid-template-areas: "rail main";
    padding-bottom: 0;
  }
  .rail {
    grid-area: rail; display: flex; flex-direction: column;
    background: linear-gradient(180deg, #07123A 0%, #0B1F5C 100%);
    color: #fff; padding: 1.4rem 1rem 1rem;
    position: sticky; top: 0; height: 100vh;
    border-right: 1px solid rgba(255,255,255,.08);
  }
  .stage {
    grid-area: main;
    grid-template-columns: minmax(0, 1fr) 320px;
    min-height: 100vh;
  }
  .view {
    padding: 2rem 2.4rem 3rem;
    max-width: none;
    border-right: 1px solid var(--line);
  }
  .margin { display: block; padding: 2rem 1.4rem; background: var(--paper-2); border-left: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .dock { display: none; }
}

@media (min-width: 1280px) {
  body { grid-template-columns: 260px 1fr; }
  .stage { grid-template-columns: minmax(0, 1fr) 360px; }
  .view { padding: 2.5rem 3.2rem 4rem; }
}

/* ─────────────────────────────────────────────────────────────────
   RAIL (desktop nav)
   ───────────────────────────────────────────────────────────────── */
.rail-brand {
  display: flex; align-items: center; gap: .75rem; color: #fff;
  margin-bottom: 2rem; text-decoration: none;
}
.rail-mark {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07123A; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(242,180,0,.25);
}
.rail-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.rail-brand-text strong { font-family: var(--ff-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.rail-brand-text em { font-style: italic; font-family: var(--ff-display); font-size: .82rem; opacity: .75; font-weight: 400; }

.rail-nav { display: flex; flex-direction: column; gap: .15rem; }
.rail-link {
  display: flex; align-items: center; gap: .8rem;
  padding: .65rem .8rem;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  border-radius: var(--r-2);
  font-size: .94rem;
  transition: background .15s, color .15s, transform .15s;
}
.rail-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.rail-link.active {
  background: rgba(242,180,0,.14);
  color: var(--accent-soft);
}
.rail-link.active .ri { color: var(--accent); }
.rail-link .ri {
  font-size: 1.1rem; width: 22px; text-align: center;
  color: rgba(255,255,255,.55);
  font-family: var(--ff-display);
}
.rail-link em { font-style: normal; font-weight: 500; }

.rail-bottom {
  padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .5rem; font-size: .8rem;
}

/* Auth badge in rail */
.auth-badge {
  margin-top: auto;
  background: rgba(242,180,0,.10);
  border: 1px solid rgba(242,180,0,.28);
  border-radius: 8px;
  padding: .55rem .65rem;
  display: flex; align-items: center; gap: .45rem;
  font-size: .78rem;
  margin-bottom: .55rem;
}
.auth-badge .role-pill {
  font-family: var(--ff-mono);
  font-size: .58rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--accent); color: #2C2400;
  padding: 2px 6px; border-radius: 3px; font-weight: 600;
}
.auth-badge .auth-who {
  flex: 1; min-width: 0; color: #fff; font-weight: 500;
  font-family: var(--ff-display); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.auth-badge .auth-logout {
  background: transparent; border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.55); border-radius: 4px;
  width: 22px; height: 22px; padding: 0; cursor: pointer; font-size: .7rem;
}
.auth-badge .auth-logout:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.auth-badge[hidden] { display: none; }

/* Identity card in profil */
.identity-card {
  background: linear-gradient(135deg, var(--brand-deep, #0B1F5C), #07123A);
  color: #fff;
  border-radius: var(--r-3);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
  position: relative; overflow: hidden;
}
.identity-card::after {
  content: ""; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(242,180,0,.18), transparent 70%);
}
.identity-card h3 {
  font-family: var(--ff-mono);
  font-size: .65rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .35rem; font-weight: 600;
}
.identity-card .who {
  font-family: var(--ff-display);
  font-weight: 600; font-size: 1.4rem; color: #fff;
  letter-spacing: -.015em; margin: 0;
}
.identity-card .who em {
  font-style: italic; font-weight: 400; opacity: .85;
}
.identity-card .ident-meta {
  display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .8rem;
  font-size: .82rem;
}
.identity-card .ident-meta b {
  display: block;
  font-family: var(--ff-mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; opacity: .65; font-weight: 500;
}

.code-input {
  width: 100%;
  font-family: var(--ff-display); font-weight: 600;
  font-size: 2rem; letter-spacing: .08em; text-align: center;
  padding: .65rem; border: 2px dashed var(--accent);
  border-radius: var(--r-2);
  background: var(--paper-2); color: var(--night);
  font-variant-numeric: tabular-nums;
}
.code-input:focus {
  outline: 0; border-style: solid; border-color: var(--brand-2);
  background: #fff;
}
.net-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(29,154,108,.18);
}
.net-dot.offline { background: var(--muted); box-shadow: 0 0 0 3px rgba(110,119,147,.18); }
.rail-install {
  margin-left: auto; background: var(--accent); color: #1a1300; border: 0;
  padding: .35rem .7rem; border-radius: 4px; font: inherit; font-size: .8rem; cursor: pointer;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   DOCK (mobile bottom nav)
   ───────────────────────────────────────────────────────────────── */
.dock {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom, 0));
  z-index: 99;
  box-shadow: 0 -2px 16px rgba(7,18,58,.06);
}
.dock-link {
  flex: 1; text-decoration: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center;
  font-size: .68rem; padding: .35rem 0;
  transition: color .15s;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dock-link:hover { color: var(--brand); text-decoration: none; }
.dock-link span { font-size: 1.3rem; line-height: 1; font-family: var(--ff-display); color: var(--ink-2); }
.dock-link em { font-style: normal; margin-top: 3px; }
.dock-link.active { color: var(--brand); }
.dock-link.active span { color: var(--accent-2); }

/* ─────────────────────────────────────────────────────────────────
   Typographie éditoriale
   ───────────────────────────────────────────────────────────────── */
.boot { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.boot-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--brand);
  margin: 0 auto .8rem; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 500;
}

.page-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(1.85rem, 2.5vw + 1rem, 2.8rem);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -.025em;
  line-height: 1.05;
  margin: .35rem 0 .4rem;
  color: var(--night);
}
.page-title em { font-style: italic; color: var(--brand-2); font-weight: 500; }

.page-lede {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.4;
  max-width: 60ch;
  margin: 0 0 1.5rem;
}

h2.section {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -.005em;
  color: var(--night);
  margin: 2rem 0 .8rem;
  display: flex; align-items: baseline; gap: .6rem;
}
h2.section::before {
  content: ""; display: inline-block; width: 18px; height: 1px;
  background: var(--accent-2); margin-right: .2rem;
  align-self: center;
}
h2.section .count {
  font-family: var(--ff-mono); font-size: .72rem; color: var(--muted);
  margin-left: auto; font-weight: 400; letter-spacing: .04em;
}

h3.sub {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink-2);
  margin: 1.4rem 0 .55rem;
  letter-spacing: -.005em;
}

/* ─────────────────────────────────────────────────────────────────
   Composants : slot card (programme + now)
   ───────────────────────────────────────────────────────────────── */
.slot {
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: .9rem 1rem .9rem .9rem;
  margin: .5rem 0;
  text-decoration: none;
  color: var(--ink);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  overflow: hidden;
}
.slot::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand-2);
}
.slot[data-type="break"]::before, .slot[data-type="accueil"]::before { background: var(--line); }
.slot[data-type="pleniere"]::before, .slot[data-type="ouverture"]::before, .slot[data-type="cloture"]::before { background: var(--brand-glow); }
.slot[data-type="ct_parallel"]::before, .slot[data-type="ct"]::before, .slot[data-type="parallel"]::before, .slot[data-type="session"]::before { background: var(--brand-2); }
.slot[data-type="prix"]::before, .slot[data-type="social"]::before, .slot[data-type="evenement_special"]::before { background: var(--accent); }
.slot[data-type="ag"]::before { background: #6E57D6; }

.slot:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(7,18,58,.08);
  border-color: var(--brand-2);
  text-decoration: none;
}

.slot.now {
  background: linear-gradient(135deg, #FFFBEC, var(--surface));
  border-color: var(--accent);
  box-shadow: 0 6px 22px rgba(242,180,0,.18);
}
.slot.now::before { background: var(--accent); width: 4px; }
.slot.now::after {
  content: "EN COURS";
  position: absolute; top: .55rem; right: .8rem;
  font-family: var(--ff-mono); font-size: .62rem; letter-spacing: .14em;
  background: var(--accent); color: #2C2400; padding: 2px 7px; border-radius: 3px;
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
.slot.past { opacity: .58; }
.slot.past::before { background: var(--line) !important; }

.slot-time {
  font-family: var(--ff-display);
  font-variation-settings: "opsz" 80;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--night);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.slot-time small {
  display: block;
  font-family: var(--ff-mono);
  font-weight: 400;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .25rem;
  letter-spacing: .04em;
}
.slot-time .dur {
  display: block;
  font-family: var(--ff-mono);
  font-size: .68rem;
  color: var(--accent-2);
  letter-spacing: .03em;
  margin-top: .15rem;
}

.slot-body { min-width: 0; }
.slot-title {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.3;
  letter-spacing: -.005em;
  margin: 0 0 .35rem;
  color: var(--night);
}
.slot.now .slot-title { font-weight: 600; }

.slot-meta {
  display: flex; flex-wrap: wrap; gap: .35rem .8rem;
  font-size: .78rem;
  color: var(--muted);
  align-items: center;
}
.slot-meta .typ {
  font-family: var(--ff-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 500;
  color: var(--ink-2);
}
.slot-meta .ct-tag {
  font-family: var(--ff-mono);
  background: var(--paper-2); color: var(--brand);
  padding: 1px 7px; border-radius: 3px; font-weight: 600;
  font-size: .7rem; letter-spacing: .03em;
}
.slot-meta .room-tag {
  color: var(--brand-2); font-weight: 500;
  font-size: .8rem;
}
.slot-meta .com-count {
  font-family: var(--ff-mono); font-size: .68rem;
  background: var(--accent-soft); color: var(--accent-2);
  padding: 1px 7px; border-radius: 3px; font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   Day separator (timeline)
   ───────────────────────────────────────────────────────────────── */
.day-sep {
  position: relative;
  margin: 2rem 0 1rem;
  padding: 0 0 0 0;
  display: flex; align-items: baseline; gap: 1rem;
}
.day-sep .day-num {
  font-family: var(--ff-display);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 600;
  font-size: 3.2rem;
  line-height: 1;
  color: var(--accent-2);
  letter-spacing: -.04em;
}
.day-sep .day-meta { display: flex; flex-direction: column; }
.day-sep .day-label {
  font-family: var(--ff-display); font-weight: 500; font-size: 1.15rem;
  color: var(--night); font-style: italic;
}
.day-sep .day-date {
  font-family: var(--ff-mono); font-size: .76rem;
  color: var(--muted); letter-spacing: .08em; text-transform: uppercase;
  margin-top: .15rem;
}
.day-sep::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -.55rem;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-2), transparent 35%);
}

/* ─────────────────────────────────────────────────────────────────
   Filtres
   ───────────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: .7rem .8rem;
  margin: 1rem 0 .8rem;
  display: flex; flex-wrap: wrap; gap: .5rem;
  align-items: center;
}
.filter-bar input,
.filter-bar select {
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: .45rem .65rem;
  font: inherit; font-size: .88rem;
  font-family: var(--ff-sans);
  transition: border-color .15s;
}
.filter-bar input:focus, .filter-bar select:focus {
  outline: 0; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(31,79,191,.12);
}
.filter-bar input[type="search"] {
  flex: 1 1 100%; min-width: 0; font-size: .95rem;
}
.filter-bar .seg {
  display: inline-flex; border: 1px solid var(--line);
  border-radius: var(--r-2); overflow: hidden;
  background: var(--paper);
}
.filter-bar .seg button {
  background: transparent; border: 0;
  padding: .4rem .75rem;
  font: inherit; font-size: .83rem;
  color: var(--ink-2); cursor: pointer;
  font-weight: 500;
  font-family: var(--ff-sans);
}
.filter-bar .seg button:hover { background: rgba(11,31,92,.06); }
.filter-bar .seg button.active {
  background: var(--brand); color: #fff;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   Détail session
   ───────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--ff-mono); font-size: .75rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.4rem;
}
.back-link::before {
  content: "⟵"; font-family: var(--ff-display); font-size: 1rem; font-style: italic;
}
.back-link:hover { color: var(--brand-2); text-decoration: none; }

.session-head {
  padding: 1.5rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.4rem;
}
.session-head .session-eyebrow {
  display: flex; gap: .7rem; margin-bottom: .8rem;
  flex-wrap: wrap; align-items: center;
}
.session-head h1 {
  font-family: var(--ff-display);
  font-variation-settings: "opsz" 144;
  font-weight: 500;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.022em;
  margin: 0;
  color: var(--night);
  max-width: 36ch;
}
.session-head .session-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin-top: 1rem;
  font-size: .9rem;
}
.session-head .meta-block {
  display: flex; flex-direction: column;
}
.session-head .meta-block .lbl {
  font-family: var(--ff-mono); font-size: .65rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .15rem;
}
.session-head .meta-block .val {
  font-family: var(--ff-display); font-weight: 500;
  color: var(--night); font-size: 1.05rem;
}
.session-head .meta-block .val small {
  display: block; font-size: .72rem;
  color: var(--muted); font-family: var(--ff-sans);
  font-weight: 400; margin-top: .15rem;
}

.session-actions {
  display: flex; gap: .4rem; margin-top: 1rem; flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────────────
   Communications (papier scientifique style)
   ───────────────────────────────────────────────────────────────── */
.com-list {
  margin: 1rem 0;
  counter-reset: com-counter;
}
.com-item {
  position: relative;
  padding: 1rem 1.1rem 1rem 3.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  margin-bottom: .65rem;
  counter-increment: com-counter;
  transition: border-color .15s, box-shadow .15s;
}
.com-item:hover { border-color: var(--brand-2); }
.com-item.open { border-color: var(--brand-2); box-shadow: 0 6px 22px rgba(7,18,58,.07); }
.com-item::before {
  content: counter(com-counter, decimal-leading-zero);
  position: absolute;
  top: .9rem; left: .9rem;
  font-family: var(--ff-display);
  font-variation-settings: "opsz" 80;
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--accent-2);
  letter-spacing: -.02em;
  line-height: 1;
}
.com-time {
  font-family: var(--ff-mono); font-size: .7rem; color: var(--muted);
  letter-spacing: .06em; font-weight: 500;
}
.com-title {
  font-family: var(--ff-display);
  font-weight: 500; font-size: 1.05rem;
  line-height: 1.32; letter-spacing: -.005em;
  margin: .15rem 0 .35rem; color: var(--night);
  max-width: 50ch;
}
.com-auteurs {
  font-size: .82rem; line-height: 1.5;
  color: var(--ink-2);
}
.com-auteurs strong { font-weight: 600; }
.com-auteurs em { font-style: italic; color: var(--muted); font-weight: 400; }
.com-actions {
  display: flex; gap: .35rem; margin-top: .65rem; flex-wrap: wrap;
}

/* Notes par communication */
.com-notes {
  margin-top: .8rem;
  background: linear-gradient(180deg, #FFFCEC, var(--surface));
  border: 1px dashed var(--accent);
  border-radius: var(--r-2);
  padding: .65rem .8rem;
}
.com-notes textarea {
  width: 100%; min-height: 60px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line); border-radius: var(--r-2);
  padding: .5rem .65rem;
  font: inherit; font-size: .92rem;
  resize: vertical; color: var(--ink);
  font-family: var(--ff-display); font-weight: 400;
  font-style: italic;
}
.com-notes textarea::placeholder { color: var(--muted); }

.com-question {
  margin-top: .8rem;
  background: #F2F8FF;
  border: 1px dashed var(--brand-2);
  border-radius: var(--r-2);
  padding: .65rem .8rem;
}
.com-question textarea {
  width: 100%; min-height: 60px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line); border-radius: var(--r-2);
  padding: .5rem .65rem;
  font: inherit; font-size: .92rem;
  resize: vertical;
  font-family: var(--ff-display);
  font-style: italic;
}

.note-status {
  font-family: var(--ff-mono); font-size: .68rem;
  letter-spacing: .04em; color: var(--ok); margin-left: auto;
  align-self: center;
}

/* ─────────────────────────────────────────────────────────────────
   Carte ressource (margin / cards)
   ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 1rem 1.1rem;
  margin-bottom: .8rem;
}
.card h3 {
  font-family: var(--ff-display); font-weight: 500; font-size: .95rem;
  margin: 0 0 .4rem; color: var(--night); letter-spacing: -.005em;
}
.card p { margin: .3rem 0; font-size: .88rem; color: var(--ink-2); }

.empty {
  text-align: center; padding: 3rem 1rem;
  color: var(--muted); font-family: var(--ff-display); font-style: italic;
}
.empty p { margin: .4rem 0; }
.empty p:first-child { font-size: 1.1rem; }

/* ─────────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────────── */
.btn {
  background: var(--brand); color: #fff; border: 0;
  padding: .55rem 1rem;
  border-radius: var(--r-2);
  font: inherit; font-size: .9rem; font-weight: 500;
  font-family: var(--ff-sans);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--night); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--paper-2); color: var(--brand); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: var(--brand); color: #fff; }
.btn.accent { background: var(--accent); color: #2C2400; }
.btn.accent:hover { background: var(--accent-2); color: #fff; }
.btn.danger { background: var(--danger); }
.btn.tiny { padding: .3rem .7rem; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────────────────
   Formulaires profil
   ───────────────────────────────────────────────────────────────── */
.form-row { margin: .8rem 0; }
.form-row label {
  display: block; font-family: var(--ff-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: .25rem; font-weight: 500;
}
.form-row input, .form-row select, .form-row textarea {
  display: block; width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: .6rem .75rem; font: inherit; font-size: .95rem;
  font-family: var(--ff-display); font-weight: 400;
  color: var(--ink);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 0; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(31,79,191,.12);
}

.consent {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 1rem 1.1rem; margin: 1rem 0;
}
.consent h4 {
  font-family: var(--ff-display); font-weight: 500; font-size: 1rem;
  margin: 0 0 .55rem; color: var(--night);
}
.consent label {
  display: flex; align-items: center; gap: .55rem;
  margin: .3rem 0; font-size: .9rem; font-family: var(--ff-sans);
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--ink); cursor: pointer;
}
.consent label input { width: 18px; height: 18px; accent-color: var(--brand-2); }

/* ─────────────────────────────────────────────────────────────────
   Plan + salles
   ───────────────────────────────────────────────────────────────── */
.plan-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: .8rem;
  overflow-x: auto;
}
.plan-wrap svg { width: 100%; height: auto; max-width: 100%; display: block; }
.plan-wrap svg .salle-clickable { cursor: pointer; transition: opacity .15s; }
.plan-wrap svg .salle-clickable:hover { opacity: .8; }

/* ─────────────────────────────────────────────────────────────────
   Messages
   ───────────────────────────────────────────────────────────────── */
.msg {
  padding: .65rem .9rem; border-radius: var(--r-2);
  font-size: .88rem; margin: .6rem 0;
  font-family: var(--ff-sans);
  display: flex; gap: .5rem; align-items: flex-start;
}
.msg.info { background: #EBF0FA; color: var(--brand); }
.msg.ok   { background: #E0F4EA; color: var(--ok); }
.msg.err  { background: #FCE2E2; color: var(--danger); }
.msg::before {
  font-family: var(--ff-display); font-weight: 600; font-size: 1rem;
  line-height: 1.2;
}
.msg.info::before { content: "ⓘ"; }
.msg.ok::before   { content: "✓"; }
.msg.err::before  { content: "✕"; }

/* ─────────────────────────────────────────────────────────────────
   Margin panel (desktop right column)
   ───────────────────────────────────────────────────────────────── */
.margin h3 {
  font-family: var(--ff-mono); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .8rem; font-weight: 500;
}
.margin .now-strip {
  border-left: 3px solid var(--accent); padding-left: .8rem; margin-bottom: 1rem;
}
.margin .now-strip .nm-time {
  font-family: var(--ff-display); font-weight: 600; font-size: 1.4rem;
  color: var(--night); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.margin .now-strip .nm-title {
  font-family: var(--ff-display); font-weight: 500;
  margin-top: .25rem; color: var(--night); font-size: .92rem;
  line-height: 1.3;
}
.margin .now-strip .nm-meta {
  font-size: .78rem; color: var(--muted); margin-top: .35rem;
}

/* ─────────────────────────────────────────────────────────────────
   Notes carnet (route notes)
   ───────────────────────────────────────────────────────────────── */
.notebook-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: .9rem 1rem;
  margin: .5rem 0;
}
.notebook-item .nb-head {
  display: flex; gap: .8rem; align-items: baseline;
  font-family: var(--ff-mono); font-size: .7rem; letter-spacing: .06em;
  color: var(--muted); margin-bottom: .4rem;
}
.notebook-item .nb-head a {
  color: var(--brand-2); font-family: var(--ff-display);
  font-style: italic; font-size: .85rem; letter-spacing: 0;
}
.notebook-item .nb-text {
  font-family: var(--ff-display); font-weight: 400;
  font-size: 1rem; line-height: 1.5;
  white-space: pre-wrap; color: var(--ink);
}
.notebook-item .nb-com {
  display: inline-block; background: var(--accent-soft); color: var(--accent-2);
  font-family: var(--ff-mono); font-size: .65rem; letter-spacing: .08em;
  padding: 1px 6px; border-radius: 3px; font-weight: 600;
  margin-left: .5rem;
}

/* ─────────────────────────────────────────────────────────────────
   Misc
   ───────────────────────────────────────────────────────────────── */
code {
  font-family: var(--ff-mono); font-size: .82em;
  background: var(--paper-2); padding: .1em .4em; border-radius: 3px;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
