/* Brio, refonte v2 (2026-11-22). Maquette validée : https://claude.ai/artifact/F8z9KMrWNNWhiTXr8fUEZh
   Sombre ou clair selon le système. Une couleur vive par domaine (--c), posée en aplat avec du texte
   presque noir dessus, jamais en petit texte. La maîtrise de chaque question se lit en mosaïque. */
@font-face {
  font-family: "Onest";
  src: url("/assets/onest.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Unbounded";
  src: url("/assets/unbounded.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f3f4f7;
  --s1: #ffffff;
  --s2: #eceef3;
  --s3: #dfe2ea;
  --ink: #0c0e13;
  --ink2: #4d5462;
  --ink3: #6b7282;
  --line: #e2e5ec;
  --good: #12b76a;
  --good-text: #0b7a46;
  --bad: #f04438;
  --bad-text: #c4291d;
  --on: #0c0e13;
  --btn: #0c0e13;
  --btn-ink: #ffffff;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --ui: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r-lg: 26px;
  --r: 18px;
  --tabbar: 84px;
  font: 15px/1.5 var(--ui);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0c10;
    --s1: #15171d;
    --s2: #1d2028;
    --s3: #2a2e39;
    --ink: #f5f6f8;
    --ink2: #b0b6c2;
    --ink3: #8b92a0;
    --line: #23262f;
    --good: #32d583;
    --good-text: #4fe39a;
    --bad: #ff5a4f;
    --bad-text: #ff8a80;
    --btn: #f5f6f8;
    --btn-ink: #0b0c10;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
}
button:disabled {
  cursor: not-allowed;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
img,
svg {
  display: block;
}
svg {
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
strong,
b {
  font-weight: 650;
}
.muted {
  color: var(--ink2);
}
.small,
small {
  font-size: 0.875rem;
}
.grow {
  flex: 1;
  min-width: 0;
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.action-set {
  display: flex;
  gap: 8px;
  align-items: center;
}
.action-set.wrap {
  flex-wrap: wrap;
}
.bad-text {
  color: var(--bad-text);
}
.good-text {
  color: var(--good-text);
}
.gap-top {
  margin-top: 16px;
}
.loading {
  padding: 12vh 8vw;
  font-family: var(--display);
  font-size: 1.4rem;
}
.skip {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 90;
  background: var(--s1);
  padding: 0.7rem 1rem;
  border-radius: 12px;
}
.skip:focus {
  top: 1rem;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Structure */
.layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0 16px;
  border-right: 1px solid var(--line);
  z-index: 12;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rail-logo {
  margin-bottom: 18px;
}
.rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.nav-link {
  position: relative;
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 0 7px;
  border-radius: 16px;
  color: var(--ink2);
  font-size: 11.5px;
  font-weight: 550;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: var(--s2);
}
.nav-link.profile {
  padding: 6px 0;
}
.badge {
  position: absolute;
  top: 3px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  background: var(--bad);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ff7a3d;
  color: var(--on);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 650;
  font-size: 13px;
  flex: none;
}
.small-avatar {
  width: 34px;
  height: 34px;
}
.workspace {
  min-width: 0;
}
.topbar {
  display: none;
  align-items: center;
  gap: 4px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left));
}
.main:focus {
  outline: 0;
}
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 44px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.page.narrow {
  max-width: 720px;
}
.phone-nav {
  display: none;
}
.in-practice {
  grid-template-columns: minmax(0, 1fr);
}
.in-practice .sidebar,
.in-practice .topbar {
  display: none;
}

/* Titres */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--display);
  font-size: 2.6rem;
  line-height: 1.02;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.page-head p {
  color: var(--ink2);
  margin-top: 8px;
  font-size: 1rem;
}
.page-head p::first-letter {
  text-transform: uppercase;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-head h2,
.title-sm {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.count {
  color: var(--ink3);
  font-weight: 600;
}
.text-btn {
  color: var(--ink2);
  font-weight: 550;
  font-size: 14px;
}
.text-btn:hover {
  color: var(--ink);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink2);
  font-size: 14px;
  font-weight: 500;
  width: fit-content;
  margin-bottom: -12px;
}
.back:hover {
  color: var(--ink);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--s2);
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  transition:
    transform 0.12s,
    background 0.15s,
    filter 0.15s;
}
.btn:hover {
  background: var(--s3);
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--btn);
  color: var(--btn-ink);
}
.btn.primary:hover {
  filter: brightness(0.88);
}
.btn.subtle {
  background: transparent;
  color: var(--ink2);
}
.btn.subtle:hover {
  background: var(--s2);
  color: var(--ink);
}
.btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
}
.btn.big {
  min-height: 52px;
  padding: 0 26px;
  font-size: 16px;
}
.btn.danger {
  color: var(--bad-text);
}
.btn:disabled {
  opacity: 0.35;
  transform: none;
}
.btn.on-color {
  background: rgba(12, 14, 19, 0.12);
  color: var(--on);
}
.btn.on-color:hover {
  background: rgba(12, 14, 19, 0.2);
}
.btn.on-color.strong {
  background: var(--on);
  color: #fff;
}
.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink2);
  transition: background 0.15s;
}
.icon-btn:hover {
  background: var(--s2);
  color: var(--ink);
}
.icon-btn.on-color {
  color: var(--on);
}
.icon-btn.on-color:hover {
  background: rgba(12, 14, 19, 0.12);
}
.push {
  margin-right: auto;
}
.pill {
  font-size: 12.5px;
  font-weight: 650;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--s2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill.live {
  background: var(--btn);
  color: var(--btn-ink);
}

/* Surfaces */
.panel {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.panel.padded {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack,
.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.empty {
  background: var(--s1);
  border: 1px dashed var(--s3);
  border-radius: var(--r-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.empty > svg {
  color: var(--ink3);
}
.empty h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.empty p {
  color: var(--ink2);
  max-width: 48ch;
}
.empty .btn {
  margin-top: 8px;
}
.subhead {
  padding: 6px 2px;
}
.local-note {
  color: var(--ink2);
  font-size: 14px;
  padding: 14px 18px;
  border-radius: var(--r);
  background: var(--s2);
}
.tabs {
  display: inline-flex;
  background: var(--s2);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  width: fit-content;
}
.tabs button {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
  color: var(--ink2);
}
.tabs button.selected {
  background: var(--s1);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: 48px;
  border-radius: 999px;
  background: var(--s1);
  border: 1px solid var(--line);
  max-width: 400px;
  color: var(--ink3);
}
.search-field input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
  height: 100%;
  color: var(--ink);
}
.search-field:focus-within {
  border-color: var(--ink);
}

/* Mosaïque de maîtrise et anneau */
.mosaic {
  --cs: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cs), 1fr));
  gap: 4px;
}
.mosaic i {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--s3);
  display: block;
}
.mosaic i.ok {
  background: var(--c);
}
.mosaic i.mid {
  background: color-mix(in srgb, var(--c) 42%, var(--s2));
}
.mosaic i.ko {
  background: var(--bad);
}
.mosaic .more {
  grid-column: span 3;
  font-size: 11px;
  color: var(--ink3);
  align-self: center;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--ink2);
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--s3);
}
.legend i.ok {
  background: var(--c);
}
.legend i.mid {
  background: color-mix(in srgb, var(--c) 42%, var(--s2));
}
.legend i.ko {
  background: var(--bad);
}
.ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
}
.ring svg {
  transform: rotate(-90deg);
}
.ring-track {
  stroke: var(--s3);
}
.ring-value {
  position: absolute;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.03em;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--s3);
  flex: none;
  display: inline-block;
}
.dot.ok {
  background: var(--c, var(--good));
}
.dot.mid {
  background: color-mix(in srgb, var(--c, var(--good)) 42%, var(--s2));
}
.dot.ko {
  background: var(--bad);
}
.dot.good {
  background: var(--good);
}

/* Accueil */
.streak {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px 6px 6px;
}
.streak-days {
  display: flex;
  gap: 4px;
}
.streak-days i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--s2);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 650;
  color: var(--ink3);
}
.streak-days i.on {
  background: var(--ink);
  color: var(--bg);
}
.streak b {
  font-family: var(--display);
  font-size: 14px;
  white-space: nowrap;
}
.focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
}
.hero {
  background: var(--c);
  color: var(--on);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 300px;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 13.5px;
  background: rgba(12, 14, 19, 0.12);
  border-radius: 999px;
  padding: 5px 12px;
  width: fit-content;
}
.hero-tag.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--on);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.hero h2 {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1.06;
  font-weight: 650;
  letter-spacing: -0.035em;
  max-width: 18ch;
}
.hero-path {
  margin-top: 8px;
  font-weight: 550;
  opacity: 0.75;
}
.hero-foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.hero-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  max-width: 340px;
}
.segments {
  display: flex;
  gap: 4px;
}
.segments i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--s3);
  max-width: 34px;
}
.segments i.ok {
  background: var(--good);
}
.segments i.ko {
  background: var(--bad);
}
.hero .segments i {
  background: rgba(12, 14, 19, 0.16);
}
.hero .segments i.ok {
  background: var(--on);
}
.hero .segments i.ko {
  box-shadow: inset 0 0 0 1.5px var(--on);
}
.play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--on);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  transition: transform 0.15s;
}
.play:hover {
  transform: scale(1.06);
}
.play svg {
  fill: currentColor;
}
.review-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.review-card .btn {
  margin-top: auto;
  align-self: flex-start;
}
.big-line {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.big-line span:last-child {
  color: var(--ink2);
  font-weight: 550;
  padding-bottom: 6px;
  line-height: 1.3;
}
.big {
  font-family: var(--display);
  font-size: 4.6rem;
  line-height: 0.85;
  font-weight: 700;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 55%, var(--line));
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.project-name {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
/* Description du cours sous son titre : deux lignes au plus. */
.domain {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink2);
}
.project-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink2);
  margin-top: auto;
}
.project-foot b {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--ink);
  font-weight: 600;
}
.week {
  padding: 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.figures {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.figures b {
  display: block;
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.figures span {
  color: var(--ink2);
  font-size: 13px;
}
.bars {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 160px;
}
.bars.tall {
  height: 210px;
}
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.bar-col i {
  width: 100%;
  max-width: 42px;
  min-height: 6px;
  border-radius: 10px;
  background: var(--s3);
}
.bar-col.now i {
  background: var(--ink);
}
.bar-col span {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}
.bar-col small {
  font-size: 12px;
  color: var(--ink3);
  white-space: nowrap;
}
.session-row,
.subject-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto 64px auto;
  align-items: center;
  gap: 16px;
  padding: 11px 16px 11px 11px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color 0.15s;
}
a.session-row:hover,
a.subject-row:hover {
  border-color: var(--s3);
}
.session-row.static {
  grid-template-columns: 46px minmax(0, 1fr) auto;
}
.offline-session {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding-left: 16px;
}
.offline-session span {
  display: flex;
  flex-direction: column;
}
.session-row .segments {
  width: 130px;
}
.swatch {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--c);
  color: var(--on);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}
.swatch.neutral {
  background: var(--s2);
  color: var(--ink);
}
.swatch svg {
  fill: currentColor;
}
.session-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.session-info b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-info small {
  color: var(--ink2);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-time {
  color: var(--ink2);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Cours */
.color-hero {
  background: var(--c);
  color: var(--on);
  border-radius: var(--r-lg);
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 30px;
  align-items: end;
}
.color-hero h1 {
  font-family: var(--display);
  font-size: 2.6rem;
  line-height: 1.02;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.color-hero h1.smaller {
  font-size: 2.1rem;
}
.color-hero p {
  margin-top: 10px;
  font-weight: 550;
  opacity: 0.78;
}
.hero-stats {
  display: flex;
  gap: 28px;
  margin: 22px 0;
}
.hero-stats b {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.hero-stats span {
  font-size: 13px;
  font-weight: 550;
  opacity: 0.75;
}
.color-hero .mosaic {
  --cs: 16px;
}
.color-hero .mosaic i {
  background: rgba(12, 14, 19, 0.12);
}
.color-hero .mosaic i.ok {
  background: var(--on);
}
.color-hero .mosaic i.mid {
  background: rgba(12, 14, 19, 0.42);
}
.color-hero .mosaic i.ko {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--on);
}
.color-hero .mosaic .more {
  color: var(--on);
}
.color-hero .legend {
  margin-top: 14px;
  color: rgba(12, 14, 19, 0.78);
}
.color-hero .legend i {
  background: rgba(12, 14, 19, 0.12);
}
.color-hero .legend i.ok {
  background: var(--on);
}
.color-hero .legend i.mid {
  background: rgba(12, 14, 19, 0.42);
}
.color-hero .legend i.ko {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--on);
}
/* QCM suggérés : le premier est un aplat de la couleur du cours, les autres des cartes neutres. */
.mix-intro {
  margin: -6px 0 14px;
}
.mix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.mix-card {
  text-align: left;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.mix-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink3);
}
.mix-card:first-child {
  background: var(--c);
  border-color: transparent;
  color: var(--on);
}
.mix-size {
  font-size: 0.9rem;
  color: var(--ink2);
}
.mix-size b {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-right: 4px;
}
.mix-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
}
.mix-desc {
  color: var(--ink2);
  font-size: 0.9rem;
  flex: 1;
}
.mix-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: var(--ink2);
}
.mix-card:first-child :is(.mix-size, .mix-size b, .mix-desc, .mix-foot) {
  color: var(--on);
}
.mix-card:first-child .go {
  background: var(--on);
  color: #fff;
}
.mix-card:hover .go {
  transform: scale(1.06);
}
.subject {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.subject-head,
.chapter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.subject-head h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.chapter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chapter-head h3 {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink2);
}
.quiz-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 42px;
  align-items: center;
  gap: 18px;
  padding: 12px 12px 12px 18px;
  border-radius: var(--r);
  background: var(--s2);
  transition: background 0.15s;
}
.quiz-row:hover {
  background: var(--s3);
}
.quiz-link {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.quiz-link small {
  color: var(--ink2);
  font-size: 13px;
}
.quiz-mosaic .mosaic {
  --cs: 10px;
  gap: 3px;
}
.go {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--btn);
  color: var(--btn-ink);
  display: grid;
  place-items: center;
  transition: transform 0.15s;
}
.go:hover {
  transform: scale(1.08);
}
.go svg {
  fill: currentColor;
}
.question-item summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  align-items: center;
}
.question-item summary::-webkit-details-marker {
  display: none;
}
.question-item summary b {
  font-weight: 550;
}
.question-item summary > svg {
  color: var(--ink3);
  transition: transform 0.2s;
}
.question-item[open] summary > svg {
  transform: rotate(180deg);
}
.question-item > :not(summary) {
  margin: 0 18px 16px 44px;
}
.review-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.review-options p {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--s2);
  color: var(--ink2);
}
.review-options p > span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--s3);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
  color: var(--ink);
}
.review-options .is-correct {
  color: var(--ink);
  background: color-mix(in srgb, var(--good) 16%, var(--s1));
}
.review-options .is-correct > span {
  background: var(--good);
  color: #fff;
}
.review-options .is-wrong {
  background: color-mix(in srgb, var(--bad) 13%, var(--s1));
}
.review-options .is-wrong > span {
  background: var(--bad);
  color: #fff;
}
.mine {
  margin-left: auto;
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink2);
}
.explanation {
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--s2);
  line-height: 1.6;
  color: var(--ink2);
}
.explanation b {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 4px;
}
.explanation small {
  display: block;
  margin-top: 10px;
  color: var(--ink3);
  font-size: 12.5px;
}
.question-item .form-actions {
  justify-content: flex-start;
}

/* Séances */
.review-panel {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.review-panel .grow {
  flex: 1 1 260px;
}
.review-panel h2 {
  font-size: 1.05rem;
  font-weight: 650;
}

/* Séance plein écran */
.study-view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.study-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 14px max(24px, env(safe-area-inset-left));
  background: var(--bg);
}
.study-bars {
  flex: 1;
  display: flex;
  gap: 5px;
}
.study-bars i {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--s3);
  transition: background 0.3s;
}
.study-bars i.ok {
  background: var(--good);
}
.study-bars i.ko {
  background: var(--bad);
}
.study-bars i.current {
  background: var(--c);
}
.study-count {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.study-content {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 16px max(24px, env(safe-area-inset-right)) 160px max(24px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: enter 0.25s ease-out;
}
.study-content.answered {
  padding-bottom: 360px;
  animation: none;
}
@keyframes enter {
  from {
    opacity: 0.4;
    transform: translateY(6px);
  }
}
.study-view.still .study-content,
.study-view.sheet-still .answer-sheet,
.study-view.sheet-still .choice {
  animation: none;
}
.study-context {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  background: var(--s1);
  border: 1px solid var(--line);
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.study-context i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}
.question-title {
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.question-title:focus {
  outline: 0;
}
.study-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -14px;
}
.study-hint {
  color: var(--ink2);
  font-size: 14px;
}
.lang-toggle {
  min-width: 52px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--s2);
  color: var(--ink);
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.lang-toggle:hover {
  background: var(--s3);
}
.lang-toggle[aria-pressed="true"] {
  background: var(--btn);
  color: var(--btn-ink);
}
.translation-edit {
  border-radius: 16px;
  background: var(--s2);
  padding: 4px 16px;
}
.translation-edit[open] {
  padding-bottom: 16px;
}
.translation-edit summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 14px;
  padding: 10px 0;
}
.translation-edit > :not(summary) {
  margin-top: 10px;
}
.translation-edit .field textarea {
  background: var(--s1);
}
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.choices.single {
  grid-template-columns: minmax(0, 1fr);
}
.choice {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  min-height: 72px;
  border-radius: 20px;
  text-align: left;
  width: 100%;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.4;
  background: var(--s1);
  border: 2px solid var(--line);
  transition:
    transform 0.12s,
    border-color 0.15s,
    background 0.2s;
}
.choice:hover:not(:disabled) {
  border-color: var(--ink3);
}
.choice:active:not(:disabled) {
  transform: scale(0.99);
}
.choice:disabled {
  cursor: default;
}
.choice-letter {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--s2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
  transition:
    background 0.15s,
    color 0.15s;
}
.choice.multi .choice-letter {
  border-radius: 10px;
}
.choice.picked {
  border-color: var(--ink);
}
.choice.picked .choice-letter {
  background: var(--ink);
  color: var(--bg);
}
.choice.correct {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 14%, var(--s1));
  animation: pop 0.35s;
}
.choice.correct .choice-letter {
  background: var(--good);
  color: #fff;
}
.choice.wrong {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 12%, var(--s1));
  animation: shake 0.35s;
}
.choice.wrong .choice-letter {
  background: var(--bad);
  color: #fff;
}
.choice.dimmed {
  opacity: 0.45;
}
.choice-tag {
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}
.choice.correct .choice-tag {
  color: var(--good-text);
}
.choice.wrong .choice-tag {
  color: var(--bad-text);
}
@keyframes pop {
  40% {
    transform: scale(1.01);
  }
}
@keyframes shake {
  30% {
    transform: translateX(-2px);
  }
  70% {
    transform: translateX(2px);
  }
}
.study-dock,
.answer-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.sheet-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 860px;
}
.study-dock .sheet-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
  padding: 12px 0 4px;
}
.study-dock .save-state {
  margin-right: auto;
}
.keys {
  font-size: 12.5px;
  color: var(--ink3);
}
kbd {
  font: 650 11.5px var(--ui);
  background: var(--s2);
  border-radius: 6px;
  padding: 2px 6px;
  margin: 0 2px;
  color: var(--ink2);
}
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink3);
}
.answer-sheet {
  animation: up 0.25s ease-out;
}
@keyframes up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}
.answer-sheet .sheet-inner {
  border-radius: 26px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--s1);
  border: 1px solid var(--line);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
}
.study-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.study-verdict:focus {
  outline: 0;
}
.verdict-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.good .study-verdict {
  color: var(--good-text);
}
.good .verdict-icon {
  background: var(--good);
}
.bad .study-verdict {
  color: var(--bad-text);
}
.bad .verdict-icon {
  background: var(--bad);
}
.study-expected {
  font-size: 15px;
}
.sheet-text {
  color: var(--ink2);
  line-height: 1.6;
  max-height: 30vh;
  overflow: auto;
}
.sheet-text small {
  display: block;
  margin-top: 6px;
  color: var(--ink3);
  font-size: 12.5px;
}
.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.offline-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bad) 13%, var(--s1));
  color: var(--bad-text);
  font-size: 14px;
  font-weight: 550;
}

/* Résultats */
.result-hero {
  background: var(--c);
  color: var(--on);
  border-radius: var(--r-lg);
  padding: 32px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.result-hero .ring-track {
  stroke: rgba(12, 14, 19, 0.14);
}
.result-hero .ring circle[stroke="var(--bad)"] {
  stroke: rgba(255, 255, 255, 0.8);
}
.result-hero .ring-value {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}
.result-hero h1 {
  font-family: var(--display);
  font-size: 2.2rem;
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.result-hero p {
  margin: 10px 0 20px;
  font-weight: 550;
  opacity: 0.8;
}

/* Progrès */
.kpis {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
}
.kpi {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}
.kpi b {
  font-family: var(--display);
  font-size: 2.3rem;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.kpi span {
  color: var(--ink2);
  font-size: 13.5px;
  font-weight: 550;
}
.kpi.dark {
  background: var(--btn);
  color: var(--btn-ink);
  border-color: transparent;
}
.kpi.dark span {
  color: inherit;
  opacity: 0.75;
}
.kpi.dark b {
  font-size: 3.4rem;
}
.heat {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 16px);
  grid-auto-columns: 16px;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.heat i {
  border-radius: 4px;
  background: var(--s2);
}
.heat i.l1 {
  background: color-mix(in srgb, var(--ink) 28%, var(--s2));
}
.heat i.l2 {
  background: color-mix(in srgb, var(--ink) 58%, var(--s2));
}
.heat i.l3 {
  background: var(--ink);
}
.heat i.today {
  outline: 2px solid var(--ink3);
  outline-offset: 1px;
}
.subject-row {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 2fr) 64px;
}
.stackbar {
  display: flex;
  gap: 2px;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--s2);
}
.stackbar i {
  display: block;
  height: 100%;
}
.subject-pct {
  font-family: var(--display);
  font-size: 1.1rem;
  text-align: right;
}
.section .legend {
  margin-top: 12px;
}

/* Assistants */
.connect {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.credential {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 22px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-ink);
  max-width: 600px;
}
.credential code {
  flex: 1;
  min-width: 0;
  font: 550 15px ui-monospace, "SF Mono", Menlo, monospace;
  overflow-x: auto;
  white-space: nowrap;
}
.credential .btn {
  background: color-mix(in srgb, var(--btn-ink) 16%, transparent);
  color: var(--btn-ink);
  min-height: 38px;
}
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.flow li {
  counter-increment: step;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flow li::before {
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--btn);
  color: var(--btn-ink);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
.flow p {
  color: var(--ink2);
  font-size: 14px;
}
.flow .quote {
  background: var(--s2);
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 550;
}

/* Profil */
.install-panel {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}
.install-panel .grow {
  flex: 1 1 200px;
}
.install-panel img {
  border-radius: 14px;
}

/* Fenêtres */
dialog {
  border: 0;
  padding: 0;
  border-radius: 26px;
  background: var(--s1);
  color: var(--ink);
  width: min(580px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
}
dialog[open] {
  animation: rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
dialog::backdrop {
  background: rgba(5, 6, 9, 0.55);
  backdrop-filter: blur(3px);
}
@keyframes rise {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 14px 6px 24px;
}
.modal-head h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.modal-body {
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.field input,
.field select,
.field textarea,
.option-text {
  font-weight: 400;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--s2);
  width: 100%;
  font-size: 15px;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.option-text:focus {
  outline: 0;
  border-color: var(--ink);
}
.field legend {
  padding: 0 0 8px;
}
.password-control {
  display: flex;
  gap: 6px;
  align-items: center;
}
.swatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.swatch-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
  background: var(--s2);
  border: 2px solid transparent;
  font-weight: 550;
  font-size: 13.5px;
  cursor: pointer;
}
.swatch-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.swatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
}
.swatch-pick:has(input:checked) {
  border-color: var(--ink);
}
.swatch-pick:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.answer-edit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
#options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.is-answer {
  width: 22px;
  height: 22px;
  accent-color: var(--good);
}
.form-error {
  color: var(--bad-text);
  font-size: 14px;
}
.form-error:empty {
  display: none;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.quiz-picker {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.quiz-checklist {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-checklist legend {
  font-weight: 700;
  font-size: 13.5px;
  padding: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quiz-checklist legend .dot {
  border-radius: 50%;
  width: 10px;
  height: 10px;
}
.quiz-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--s2);
  border: 2px solid transparent;
  cursor: pointer;
}
.quiz-pick:has(input:checked) {
  border-color: var(--ink);
}
.quiz-pick input {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}
.quiz-pick small {
  display: block;
  color: var(--ink2);
  font-size: 12.5px;
}
.pick-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  white-space: nowrap;
}
.selection-total {
  font-weight: 600;
  font-size: 14px;
}
.modal-search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
}
.search-result:hover,
.search-result:focus-visible {
  background: var(--s2);
}
.search-result .dot {
  border-radius: 50%;
}
.search-result > span:last-child {
  display: flex;
  flex-direction: column;
}
.search-result small {
  color: var(--ink2);
  font-size: 12.5px;
}
.toast-inside {
  color: var(--good-text);
  font-size: 14px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(14px);
  background: var(--btn);
  color: var(--btn-ink);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.25s;
  z-index: 60;
  max-width: calc(100% - 32px);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

/* Accueil déconnecté et pages d'accès */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.wordmark {
  display: inline-flex;
  color: var(--ink);
}
/* Logotype vectoriel (public/brand.js) : lettres à la couleur du texte, case orange. */
.wordmark svg {
  height: 1.5rem;
  width: auto;
  display: block;
}
.welcome-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.welcome-page:focus {
  outline: 0;
}
.welcome-copy {
  padding: 48px max(56px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}
.welcome-copy h1 {
  font-family: var(--display);
  font-size: 3.6rem;
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.05em;
  max-width: 11ch;
}
.welcome-copy p {
  font-size: 1.1rem;
  color: var(--ink2);
  max-width: 42ch;
}
.welcome-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.welcome-note {
  font-size: 14px;
}
.welcome-art {
  background: #ff7a3d;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 48px 40px 120px;
}
.demo {
  position: relative;
  width: min(400px, 100%);
}
.demo-back {
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  background: var(--s1);
  transform: rotate(-5deg) translateY(10px);
  opacity: 0.55;
}
.demo-back.two {
  transform: rotate(4deg) translateY(16px);
  opacity: 0.3;
}
.demo-card {
  position: relative;
  background: var(--s1);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 30px 60px -20px rgba(12, 14, 19, 0.45);
}
.demo-card small {
  color: var(--ink2);
}
.demo-card b {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.demo-card .choice {
  min-height: 0;
  padding: 10px 12px;
  font-size: 14.5px;
  border-radius: 14px;
  animation: none;
}
.demo-card .choice-letter {
  width: 26px;
  height: 26px;
  font-size: 12px;
}
.welcome-mosaic {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  --cs: 14px;
}
.welcome-mosaic i {
  background: rgba(12, 14, 19, 0.14);
}
.welcome-mosaic i.ok {
  background: var(--on);
}
.welcome-mosaic i.mid {
  background: rgba(12, 14, 19, 0.42);
}
.welcome-mosaic i.ko {
  background: #fff;
}
.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-box {
  background: var(--s1);
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.auth-box h1 {
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}
.auth-box p {
  color: var(--ink2);
}

/* Téléphone et petite tablette */
@media (max-width: 820px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
  }
  .topbar {
    display: flex;
  }
  .hide-phone {
    display: none;
  }
  .phone-nav {
    display: flex;
    position: fixed;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 30;
    background: var(--btn);
    border-radius: 999px;
    padding: 6px;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }
  .phone-nav .nav-link {
    flex: 1;
    width: auto;
    color: color-mix(in srgb, var(--btn-ink) 62%, transparent);
    border-radius: 999px;
    padding: 7px 0 6px;
    font-size: 11px;
  }
  .phone-nav .nav-link:hover,
  .phone-nav .nav-link.active {
    background: color-mix(in srgb, var(--btn-ink) 15%, transparent);
    color: var(--btn-ink);
  }
  .phone-nav .badge {
    right: calc(50% - 24px);
  }
  .page {
    padding: 10px max(16px, env(safe-area-inset-right)) calc(var(--tabbar) + 36px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    gap: 28px;
  }
  .in-practice .page {
    padding-bottom: 40px;
  }
  .page-head h1 {
    font-size: 2rem;
  }
  .focus-grid,
  .week,
  .color-hero,
  .flow,
  .result-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero {
    min-height: 0;
    padding: 22px;
  }
  .review-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px 18px;
    padding: 20px;
  }
  .review-panel .btn {
    grid-column: 1 / -1;
  }
  .hero h2 {
    font-size: 1.6rem;
  }
  .big {
    font-size: 3.6rem;
  }
  .projects {
    grid-template-columns: minmax(0, 1fr);
  }
  .session-row {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 12px;
  }
  .session-row .segments,
  .session-time {
    display: none;
  }
  .color-hero {
    padding: 22px;
    gap: 18px;
  }
  .color-hero h1 {
    font-size: 1.9rem;
  }
  .color-hero h1.smaller {
    font-size: 1.6rem;
  }
  .subject {
    padding: 18px;
  }
  .quiz-row {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 12px;
  }
  .quiz-mosaic {
    display: none;
  }
  .mix-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .subject-head {
    flex-wrap: wrap;
  }
  .question-item > :not(summary) {
    margin-left: 18px;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
  .kpi.dark,
  .kpi:last-child {
    grid-column: span 2;
  }
  .kpi {
    min-height: 0;
  }
  .subject-row {
    grid-template-columns: minmax(0, 1fr) 54px;
  }
  .subject-row .stackbar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .study-head {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    gap: 10px;
  }
  .study-content {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    gap: 20px;
  }
  .question-title {
    font-size: 1.4rem;
  }
  .choices {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .choice {
    min-height: 0;
    padding: 14px;
    font-size: 15.5px;
    border-radius: 18px;
  }
  .keys,
  .study-dock .save-state {
    display: none;
  }
  .study-dock .sheet-inner .btn,
  .sheet-foot .btn {
    flex: 1;
  }
  .sheet-foot .save-state {
    display: none;
  }
  .answer-sheet {
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .result-hero {
    padding: 24px;
    gap: 20px;
    justify-items: start;
  }
  .result-hero h1 {
    font-size: 1.6rem;
  }
  dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
    max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .welcome-page {
    grid-template-columns: minmax(0, 1fr);
  }
  .welcome-copy {
    padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 28px max(20px, env(safe-area-inset-left));
  }
  .welcome-copy h1 {
    font-size: 2.4rem;
  }
  .welcome-art {
    padding: 32px 20px 110px;
  }
  #toast {
    bottom: calc(var(--tabbar) + 20px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 380px) {
  .streak-days {
    display: none;
  }
  .kpi.dark b {
    font-size: 2.6rem;
  }
}

.quiz-pick.repeat-option {
  grid-template-columns: auto minmax(0, 1fr);
  margin-block: 12px;
}

.course-link {
  margin-block: 4px 10px;
}
.course-page {
  max-width: 1200px;
}
.course-intro {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 52px);
  border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
  border-radius: 22px;
  background: linear-gradient(125deg, color-mix(in srgb, var(--c) 13%, var(--s1)), var(--s1) 72%);
}
.course-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink2);
  font-size: .88rem;
  font-weight: 700;
}
.course-intro h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.3vw, 3rem);
  font-family: var(--display);
  line-height: 1.16;
  overflow-wrap: anywhere;
}
.course-intro p {
  max-width: 67ch;
  margin: 0;
  color: var(--ink2);
  font-size: 1.04rem;
  line-height: 1.65;
}
.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(160px, 225px);
  gap: clamp(24px, 5vw, 76px);
  align-items: start;
}
.course-reading {
  min-width: 0;
  overflow-wrap: anywhere;
}
.course-section {
  padding-block: 27px 32px;
  border-bottom: 1px solid var(--line);
}
.course-section:first-child {
  padding-top: 0;
}
.course-section h2,
.course-practice h2 {
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  margin: 0 0 14px;
  scroll-margin-top: 88px;
}
.course-section p,
.course-section ul {
  max-width: 65ch;
  margin-block: 0 14px;
  color: var(--ink2);
  font-size: 1.025rem;
  line-height: 1.7;
}
.course-section p {
  white-space: pre-line;
}
.course-section ul {
  padding-inline-start: 1.3em;
}
.course-section li + li {
  margin-block-start: 8px;
}
.course-section li::marker {
  color: var(--c);
}
.course-source,
.course-figure small {
  display: block;
  margin-top: 6px;
  font-size: .8rem;
}
.course-figure {
  margin: 20px 0 14px;
}
.course-figure img {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 420px;
  border-radius: 12px;
  object-fit: contain;
}
.course-figure figcaption {
  margin-top: 8px;
  font-size: .9rem;
  color: var(--ink2);
}
.course-outline {
  position: sticky;
  top: 28px;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 16px;
}
.course-outline h2 {
  margin: 0 0 8px;
  font-size: .9rem;
}
.course-outline ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.course-outline button {
  width: 100%;
  padding: 8px 0;
  text-align: start;
  color: var(--ink2);
  border: 0;
  background: none;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.course-outline button:hover,
.course-outline button:focus-visible {
  color: var(--ink);
}
.course-practice {
  padding-block: 28px;
}
.course-practice a {
  white-space: normal;
}
@media (max-width: 860px) {
  .course-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .course-outline {
    display: none;
  }
}

.course-mark {
  background: #d3eefc;
  color: #093b54;
  border-radius: .24em;
  padding-inline: .13em;
  font-weight: 650;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.course-mark.exemple { background: #ccefdc; color: #14422d; }
.course-mark.attention { background: #ffe4a6; color: #513609; }
@media (prefers-color-scheme: dark) {
  .course-mark { background: #204457; color: #c8efff; }
  .course-mark.exemple { background: #244738; color: #cdf6da; }
  .course-mark.attention { background: #503e21; color: #ffe5ac; }
}
