/* ============================================================
   Moteur de plateforme communautaire : structure et composants.
   Toutes les couleurs, polices, rayons et ombres viennent des
   variables définies dans le fichier de thème.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--frame);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- Scène ---------- */
.stage {
  position: fixed;
  inset: var(--frame-padding);
  border-radius: var(--radius-stage);
  background: var(--surface);
  box-shadow: var(--shadow-stage);
  overflow: hidden;
  isolation: isolate;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--stage-bg);
  pointer-events: none;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--stage-veil);
  pointer-events: none;
}
.scroller {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------- En-tête ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner, .tabs-inner, .page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 28px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  flex: none;
}
.brand-mark .soleil { width: 100%; height: 100%; display: block; color: var(--gold); }
.soleil .rayons { transform-box: fill-box; transform-origin: center; animation: tourne 40s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .soleil .rayons { animation: none; } }
.brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; }
.search input::placeholder { color: var(--ink-muted); }
.search:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 999px;
  display: grid; place-items: center;
  color: var(--ink);
  transition: background .15s;
}
.icon-btn:hover { background: var(--hover); }
.badge {
  position: absolute;
  top: 4px; right: 2px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 600;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}
.tabs { border-top: 1px solid var(--border-soft); }
.tabs-inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 8px; padding-bottom: 8px;
}
.tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--tab-active-bg); color: var(--ink); box-shadow: var(--tab-active-shadow); }

/* ---------- Pages ---------- */
.page { padding-top: 40px; padding-bottom: 120px; }
.page-head { margin-bottom: 32px; }
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
}
.display em { font-family: var(--font-display-em); font-style: normal; color: var(--display-em); }
.lead { color: var(--ink); font-size: 17px; max-width: 620px; margin: 14px 0 0; }
.chip-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
  transform: translateY(-0.08em);
  padding: 7px 14px;
  margin: 0 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-chip);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1;
  color: var(--ink);
}
.chip-inline .spark { color: var(--ink); display: grid; }

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-2);
}
.card-pad { padding: 24px; }
.card.clickable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.card.pinned { border-color: var(--pinned-border); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-control);
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent); font-weight: 400; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.btn-secondary:hover { border-color: var(--border-strong); }
.btn-ghost { color: var(--ink); height: 36px; padding: 0 12px; }
.btn-ghost:hover { color: var(--accent); }
.btn-block { width: 100%; }
.btn:focus-visible, .tab:focus-visible, .icon-btn:focus-visible, .chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Puces de filtre ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.chip.active { border-color: var(--ink); }

/* ---------- Avatars ---------- */
.av {
  --s: 40px;
  width: var(--s); height: var(--s);
  border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: calc(var(--s) * .36);
  color: var(--ink);
  flex: none;
  position: relative;
  box-shadow: 0 0 0 2px var(--surface);
  background-size: cover;
  background-position: center;
}
.av.c1 { background-color: var(--av-1); } .av.c2 { background-color: var(--av-2); } .av.c3 { background-color: var(--av-3); } .av.c4 { background-color: var(--av-4); }
.av-lvl {
  position: absolute;
  right: -4px; bottom: -4px;
  width: max(18px, calc(var(--s) * .2)); height: max(18px, calc(var(--s) * .2));
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: max(10px, calc(var(--s) * .1));
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}
.av-stack { display: flex; }
.av-stack .av { margin-left: -10px; }
.av-stack .av:first-child { margin-left: 0; }

/* ---------- Composer & publications ---------- */
.composer {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius-control);
  cursor: text;
}
.composer-fake { flex: 1; color: var(--ink-muted); font-size: 16px; text-align: left; }
.event-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px;
  color: var(--ink);
}
.event-banner b { font-weight: 600; }
.event-banner button { text-decoration: underline; text-underline-offset: 3px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-meta { font-size: 13px; color: var(--ink-muted); }
.post-author { font-weight: 600; }
.post-pin { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.post-title { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 14px 0 6px; line-height: 1.3; }
.post-body { margin: 0; color: var(--ink); }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-foot { display: flex; align-items: center; gap: 18px; margin-top: 16px; font-size: 14px; color: var(--ink-muted); }
.react { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); font-weight: 500; }
.react:hover { color: var(--ink); }
.react.on { color: var(--accent); }
.last-comment { margin-left: auto; font-size: 13px; color: var(--ink-muted); }

/* ---------- Carte latérale ---------- */
.side-cover {
  height: 150px;
  border-radius: calc(var(--radius-card) - 10px);
  margin: 10px;
  background: var(--plate-bg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.side-cover-title { font-family: var(--font-display); font-size: 32px; line-height: 1; letter-spacing: -0.02em; color: var(--plate-ink); }
.side-body { padding: 6px 20px 20px; }
.side-name { font-weight: 600; font-size: 17px; }
.side-url { font-size: 13px; color: var(--ink-muted); margin-bottom: 10px; }
.side-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 16px 0; }
.side-stats div { text-align: center; padding: 10px 4px; }
.side-stats div + div { border-left: 1px solid var(--border); }
.side-stats b { display: block; font-size: 17px; }
.side-stats span { font-size: 12px; color: var(--ink-muted); }

/* ---------- Salle de classe ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.course-card { overflow: hidden; display: flex; flex-direction: column; }
.course-plate {
  aspect-ratio: 16 / 10;
  margin: 10px 10px 0;
  border-radius: calc(var(--radius-card) - 10px);
  position: relative;
  overflow: hidden;
  display: flex; align-items: flex-end;
  padding: 16px;
}
.course-plate-title { font-family: var(--font-display); font-size: 30px; line-height: 1; letter-spacing: -0.02em; color: var(--plate-ink); position: relative; }
.lock-veil {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: var(--lock-veil);
  color: var(--ink);
  text-align: center;
  font-weight: 600;
}
.lock-veil > div { display: grid; justify-items: center; gap: 8px; }
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.course-desc { color: var(--ink-muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.progress { height: 22px; border-radius: 999px; background: var(--neutral); position: relative; overflow: hidden; margin-top: auto; }
.progress > i { position: absolute; inset: 0 auto 0 0; background: var(--progress-fill); border-radius: 999px; }
.progress > span { position: relative; font-size: 12px; font-weight: 600; padding-left: 12px; line-height: 22px; }

.course-view { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.lesson-list { padding: 10px; }
.lesson-list h3 { font-size: 14px; font-weight: 600; margin: 12px 12px 6px; color: var(--ink-muted); }
.lesson-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: left;
  font-size: 14px;
}
.lesson-item:hover { background: var(--hover); }
.lesson-item.active { background: var(--neutral); font-weight: 600; }
.tick {
  width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid var(--ink);
  display: grid; place-items: center; flex: none;
  color: var(--on-accent);
}
.tick.on { background: var(--accent); border-color: var(--accent); }
.video {
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius-card) - 10px);
  overflow: hidden;
  background: var(--plate-bg);
  display: grid; place-items: center;
  position: relative;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { display: grid; justify-items: center; gap: 10px; color: var(--plate-ink); text-align: center; padding: 20px; }
.play { width: 64px; height: 64px; border-radius: 999px; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow-chip); color: var(--ink); }
.lesson-content h2 { font-family: var(--font-display); font-weight: 400; font-size: 40px; letter-spacing: -0.02em; line-height: 1.05; margin: 22px 0 10px; }
.lesson-content p { margin: 0 0 12px; }
.exercise { margin-top: 18px; padding: 18px 20px; border-radius: 18px; background: var(--neutral); }
.exercise b { display: block; margin-bottom: 6px; }
.lesson-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Calendrier ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.cal-title { text-align: center; }
.cal-title b { display: block; font-size: 17px; text-transform: none; }
.cal-title span { font-size: 13px; color: var(--ink-muted); }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.seg button { height: 32px; padding: 0 12px; border-radius: 999px; color: var(--ink-muted); display: grid; place-items: center; }
.seg button.active { background: var(--neutral); color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.cal-dow { padding: 10px; text-align: center; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 112px; padding: 8px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-soft); font-size: 13px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { color: var(--ink-faint); }
.cal-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; }
.cal-cell.today .cal-num { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-ev {
  display: block; width: 100%;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--event-bg);
  color: var(--event-ink);
  font-size: 12px; font-weight: 600;
  text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev-row { display: flex; gap: 18px; align-items: center; padding: 18px 20px; }
.ev-row + .ev-row { border-top: 1px solid var(--border); }
.ev-date { width: 64px; text-align: center; flex: none; }
.ev-date b { display: block; font-family: var(--font-display); font-size: 34px; line-height: 1; font-weight: 400; }
.ev-date span { font-size: 13px; color: var(--ink-muted); }

/* ---------- Membres ---------- */
.member { display: flex; gap: 16px; padding: 20px; }
.member + .member { border-top: 1px solid var(--border); }
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 600; }
.member-handle { font-size: 13px; color: var(--ink-muted); }
.member-bio { margin: 8px 0; }
.member-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-muted); }
.member-meta span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 99px; background: var(--online); display: inline-block; }

/* ---------- Classements ---------- */
.levels { display: grid; grid-template-columns: 260px 1fr 1fr; gap: 24px; padding: 32px; align-items: center; }
.me-big { display: grid; justify-items: center; gap: 6px; text-align: center; }
.level-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.level-ic { width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; background: var(--neutral); color: var(--ink-muted); font-weight: 600; flex: none; }
.level-ic.on { background: var(--accent); color: var(--on-accent); }
.level-row small { display: block; color: var(--ink-muted); font-size: 12px; }
.board h3 { margin: 0; padding: 18px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--border); }
.board-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.rank { width: 24px; text-align: center; font-weight: 600; color: var(--ink-muted); }
.rank.top { color: var(--ink); }
.board-pts { margin-left: auto; font-weight: 600; font-size: 13px; color: var(--accent); }

/* ---------- À propos ---------- */
.about-cover {
  aspect-ratio: 16 / 8;
  border-radius: calc(var(--radius-card) - 10px);
  background: var(--plate-bg);
  display: flex; align-items: flex-end;
  padding: clamp(20px, 4vw, 40px);
  overflow: hidden;
}
.about-cover h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 6vw, 72px); line-height: .95; letter-spacing: -0.02em; margin: 0; color: var(--plate-ink); }
.about-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 22px 0; font-weight: 500; }
.about-meta span { display: inline-flex; align-items: center; gap: 8px; }
.about-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.about-list li { display: flex; gap: 10px; align-items: flex-start; }
.about-list li svg { margin-top: 3px; flex: none; color: var(--accent); }

/* ---------- Profil ---------- */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; overflow-x: auto; padding-bottom: 6px; }
.heat i { width: 11px; height: 11px; border-radius: 3px; background: var(--neutral); }
.heat i.l1 { background: var(--heat-1); }
.heat i.l2 { background: var(--heat-2); }
.heat i.l3 { background: var(--heat-3); }

/* ---------- Menus déroulants & fenêtres ---------- */
.dropdown {
  position: absolute;
  top: 64px; right: 28px;
  width: min(420px, calc(100vw - 48px));
  max-height: 70vh;
  overflow: auto;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-3);
}
.dd-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.dd-head b { font-size: 16px; }
.dd-head button { font-size: 13px; color: var(--accent); font-weight: 500; }
.dd-item { display: flex; gap: 12px; align-items: center; padding: 12px 18px; width: 100%; text-align: left; }
.dd-item:hover { background: var(--hover); }
.dd-item + .dd-item { border-top: 1px solid var(--border-soft); }
.dd-item .t { font-size: 14px; flex: 1; min-width: 0; }
.dd-item .t small { display: block; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-item.read { opacity: .6; }
.unread-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--accent); flex: none; }

.modal-wrap {
  position: fixed; inset: 0; z-index: 60;
  background: var(--scrim);
  display: grid; place-items: center;
  padding: 24px;
}
.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-3);
  padding: 28px;
  position: relative;
}
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal h2 { font-family: var(--font-display); font-weight: 400; font-size: 36px; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 16px; }
.field {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: 14px 18px;
  outline: none;
  box-shadow: var(--shadow-1);
}
.field.pill { border-radius: var(--radius-control); height: 48px; padding: 0 18px; }
.field:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
textarea.field { min-height: 140px; resize: vertical; }
.form-row { display: grid; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.comment { display: flex; gap: 12px; padding: 14px 0; }
.comment + .comment { border-top: 1px solid var(--border-soft); }
.comment-bubble { flex: 1; }
.comment-bubble b { font-size: 14px; }
.comment-bubble p { margin: 2px 0 0; }
.chat-thread { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px; background: var(--neutral); }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); }

.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  z-index: 80;
  background: var(--ink); color: var(--surface);
  padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-3);
}
.empty { text-align: center; color: var(--ink-muted); padding: 40px 20px; }
.muted { color: var(--ink-muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .levels { grid-template-columns: 1fr; }
  .course-view { grid-template-columns: 1fr; }
}
/* ---------- Barre du bas (téléphone) ---------- */
.bottom-nav { display: none; }

@media (max-width: 700px) {
  :root { --frame-padding: 0px; }
  body { font-size: 15px; }
  .stage { inset: 0; border-radius: 0; box-shadow: none; }
  .topbar { padding-top: env(safe-area-inset-top); }
  .topbar-inner, .tabs-inner, .page { padding-left: 16px; padding-right: 16px; }
  .topbar-inner { gap: 6px; height: 60px; }
  .brand-name { font-size: 20px; }
  .brand-mark { width: 32px; height: 32px; font-size: 18px; }
  .search { display: none; }
  .top-actions { margin-left: auto; gap: 0; }
  .tabs { display: none; }
  .page { padding-top: 24px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 20px; }
  .display { font-size: clamp(32px, 9vw, 40px); }
  .chip-inline { padding: 5px 10px; margin: 0 2px; font-size: 12px; }
  .lead { font-size: 16px; }

  /* barre de navigation du bas, façon application */
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 35;
    background: var(--topbar-bg);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav button {
    display: grid; justify-items: center; gap: 2px;
    padding: 6px 0;
    min-height: 52px;
    font-size: 11px; font-weight: 500;
    color: var(--ink-muted);
    border-radius: 14px;
  }
  .bottom-nav button.active { color: var(--accent); }
  .bottom-nav button.active svg { stroke-width: 2.2; }

  /* champs : 16 px minimum pour éviter le zoom automatique sur iPhone */
  input, textarea, select, .field { font-size: 16px !important; }

  /* publications */
  .card-pad { padding: 18px; }
  .composer { padding: 10px; gap: 10px; }
  .composer-fake { font-size: 15px; }
  .composer .btn { padding: 0 16px; }
  .event-banner { justify-content: flex-start; text-align: left; font-size: 13px; }
  .post-title { font-size: 17px; }
  .post-foot { gap: 14px; flex-wrap: wrap; }
  .last-txt { display: none; }

  /* fenêtres : elles montent du bas comme sur une app */
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .modal h2 { font-size: 28px; padding-right: 36px; }
  .modal .post-foot > span:last-child { margin-left: 0 !important; width: 100%; justify-content: flex-start; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1; }

  /* menus déroulants pleine largeur */
  .dropdown { left: 8px; right: 8px; width: auto; top: calc(60px + env(safe-area-inset-top)); max-height: 75vh; }
  .dropdown.dd-bottom { top: auto; bottom: calc(72px + env(safe-area-inset-bottom)); }

  /* cours */
  .grid-3 { grid-template-columns: 1fr; gap: 14px; }
  .course-view { display: flex; flex-direction: column; }
  .course-view > * { width: 100%; }
  .lesson-content { order: 1; }
  .lesson-list { order: 2; }
  .lesson-content h2 { font-size: 30px; }
  .lesson-actions { gap: 8px; }
  .lesson-actions .btn-ghost { padding: 0 6px; }
  .lesson-actions .btn-primary, .lesson-actions .btn-secondary { order: -1; width: 100%; }

  /* calendrier */
  .cal-head { flex-wrap: wrap; padding: 12px; }
  .cal-nav { order: -1; width: 100%; justify-content: space-between; }
  .cal-head > .btn { height: 38px; }
  .cal-cell { min-height: 58px; padding: 4px 2px; }
  .cal-num { width: 22px; height: 22px; font-size: 12px; }
  .cal-ev { font-size: 0; height: 6px; padding: 0; margin-top: 3px; background: var(--accent); border-radius: 99px; }
  .cal-dow { padding: 8px 2px; font-size: 11px; }
  .ev-row { padding: 14px 16px; gap: 14px; }

  /* membres */
  .member { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .member-info { flex: 1 1 calc(100% - 70px); }
  .member > .btn { width: 100%; }

  /* classements */
  .levels { padding: 22px; gap: 10px; }
  .me-big .av { --s: 96px !important; }

  /* profil */
  .layout-2 > aside.card-pad { order: -1; }
}
