/* Espace cliente MDB : composants en plus de base.css (copie du style de la page de rendez-vous) */

.app { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
.counter { margin-left: auto; }
.topbar #msgBtn { position: relative; }
.badge {
  position: absolute; top: 4px; right: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--jaune); box-shadow: 0 0 0 2px var(--nuit);
}

/* ---------- Barre d'onglets ---------- */
.tabbar {
  position: fixed; z-index: 6;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: calc(100% - 24px); max-width: 528px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px; border-radius: var(--r-pill);
  /* teinte sombre sous le verre : reste lisible quand elle passe sur une note crème */
  background: var(--glass-fill), rgba(62, 20, 15, .55);
}
.tab {
  background: none; border: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 7px; border-radius: var(--r-pill);
  font-size: 11px; color: var(--ink-mute);
  -webkit-tap-highlight-color: transparent;
  transition: background .25s, color .25s, box-shadow .25s;
}
.tab[aria-current="page"] {
  color: var(--creme);
  background: var(--glass-fill-on);
  box-shadow: var(--glass-shadow-on);
}
.tab:active { transform: scale(.95); }

/* ---------- En-têtes de section ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 4px 12px; }
.sec-head h3 { font-size: 21px; }
.sec-head .small { color: var(--ink-mute); white-space: nowrap; }

/* ---------- Lignes cliquables (vidéos, fiches) ---------- */
.list { display: grid; gap: 10px; }
.row-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center;
  width: 100%; text-align: left;
  padding: 12px 18px 12px 12px;
  border-radius: 26px;
}
.row-item .thumb {
  width: 52px; height: 52px; border-radius: 18px;
  display: grid; place-items: center;
  background: rgba(250, 246, 236, .1);
}
.row-item .t { display: block; font-size: 15px; line-height: 1.3; }
.row-item .m { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.row-item .state { font-size: 12px; color: var(--ink-mute); }
.row-item.done .thumb { background: rgba(250, 246, 236, .9); color: var(--oxblood); }
.row-item.new .thumb { background: var(--creme); color: var(--oxblood); }
.row-item.locked { opacity: .5; }
.row-item.locked:active { transform: none; filter: none; }
.pill-new {
  font-size: 11px; padding: 4px 9px; border-radius: 999px;
  background: rgba(250, 246, 236, .16); color: var(--creme);
}

/* Type de vidéo : chips de filtre */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 22px -16px 0; padding: 4px 16px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--glass-fill-on); box-shadow: var(--glass-shadow-on), 0 0 0 1.5px rgba(250, 246, 236, .75); }

/* Phase */
.phase { margin-top: 30px; }
.phase-head { display: grid; grid-template-columns: 40px 1fr; gap: 10px; margin: 0 4px 12px; }
.phase-n {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--title); font-size: 18px;
  border: 1px solid rgba(250, 246, 236, .35);
}
.phase.current .phase-n { background: var(--creme); color: var(--oxblood); border-color: transparent; }
.phase-head h3 { font-size: 19px; }
.phase-head p { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }

/* ---------- Pratiques : 7 jours à cocher ---------- */
.practice { border-radius: var(--r-lg); padding: 18px 18px 16px; }
.practice-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.practice h4 { margin: 0; font-size: 16px; font-weight: 500; }
.practice .count { font-family: var(--title); font-size: 20px; white-space: nowrap; }
.practice .count small { font-family: var(--body); font-size: 12px; color: var(--ink-mute); }
.practice .when { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.dot {
  aspect-ratio: 1; max-height: 42px; border-radius: 50%;
  border: 1px solid rgba(250, 246, 236, .3); background: none;
  font-size: 12px; color: var(--ink-soft);
  display: grid; place-items: center; padding: 0;
  transition: background .2s, color .2s, transform .15s;
}
.dot.today { border-color: var(--creme); color: var(--creme); }
.dot[aria-pressed="true"] { background: var(--creme); color: var(--oxblood); border-color: transparent; }
.dot:active { transform: scale(.9); }
.dot[disabled] { opacity: .35; cursor: default; }
.practice .watch { margin-top: 12px; font-size: 13px; color: var(--ink-soft); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Lecteur vidéo ---------- */
.player {
  position: relative; margin-top: 22px;
  aspect-ratio: 16 / 10; border-radius: var(--r-lg); overflow: hidden;
  display: grid; place-items: center;
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player .play {
  width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center;
}
.player .soon { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--ink-soft); }
.player .bar { position: absolute; left: 18px; right: 18px; bottom: 16px; height: 3px; border-radius: 3px; background: rgba(250, 246, 236, .2); }
.player .bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--creme); transition: width .25s linear; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ---------- Fiche d'autothérapie ---------- */
.fiche-steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0 0; }
.fiche-steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; padding: 11px 0; border-top: 1px solid rgba(250, 246, 236, .14); font-size: 15px; }
.fiche-steps li:first-child { border-top: 0; }
.fiche-steps li::before { content: counter(s, decimal-leading-zero); font-size: 12px; color: var(--ink-mute); padding-top: 3px; }

.drop {
  display: grid; place-items: center; text-align: center; gap: 8px;
  border-radius: var(--r-lg); padding: 26px 18px; cursor: pointer;
  border: 1px dashed rgba(250, 246, 236, .4) !important;
}
.drop input { position: absolute; opacity: 0; pointer-events: none; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos button {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(62, 20, 15, .75); color: var(--creme); display: grid; place-items: center; padding: 0;
}
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-mute); margin-right: 6px; vertical-align: 1px; }
.status-dot.on { background: var(--creme); }

/* ---------- Carte (radar) ---------- */
.radar-card { border-radius: var(--r-lg); padding: 18px 10px 14px; margin-top: 24px; }
.radar { display: block; width: 100%; height: auto; overflow: visible; }
.radar text { font-family: var(--body); font-size: 10.5px; fill: var(--ink-soft); }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { border-radius: var(--r-md); padding: 14px 12px; }
.stat b { display: block; font-family: var(--title); font-weight: 400; font-size: 26px; line-height: 1; }
.stat span { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 6px; line-height: 1.3; }

.timeline { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 14px; }
.timeline span { height: 6px; border-radius: 6px; background: rgba(250, 246, 236, .18); position: relative; }
.timeline span.past { background: rgba(250, 246, 236, .7); }
.timeline span.now { background: var(--creme); box-shadow: 0 0 0 3px rgba(250, 246, 236, .2); }
.timeline span.retest::after { content: ""; position: absolute; left: 50%; top: -9px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--ambre); }
.timeline-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-mute); margin-top: 8px; }

.link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 18px 20px; border-radius: var(--r-lg); text-decoration: none; }
.link-row .t { font-size: 16px; }
.link-row .m { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Messages ---------- */
.thread { display: grid; gap: 10px; margin-top: 24px; }
.bubble { max-width: 84%; padding: 12px 16px; border-radius: 22px; font-size: 15px; line-height: 1.45; }
.bubble .when { display: block; font-size: 11px; color: var(--ink-mute); margin-top: 6px; }
.bubble.vanille { border-bottom-left-radius: 8px; }
.bubble.cliente { justify-self: end; background: rgba(250, 246, 236, .9); color: var(--oxblood); border-bottom-right-radius: 8px; }
.bubble.cliente .when { color: rgba(107, 43, 38, .6); }
.composer { margin-top: 18px; }
.composer textarea.input { min-height: 110px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 10; left: 50%; transform: translateX(-50%);
  top: calc(70px + env(safe-area-inset-top));
  max-width: calc(100% - 32px); width: max-content;
  padding: 12px 18px; border-radius: 999px; font-size: 14px;
  animation: rise .35s cubic-bezier(.2, .8, .2, 1) both;
}

/* Le CTA remplace la barre d'onglets dans les pages de détail */
body.detail .tabbar { display: none; }

@media (min-width: 900px) {
  .tabbar { bottom: 20px; }
}

.cta-inline { margin-top: 18px; }
