/* ================= Apprendre : un écran, une décision ================= */

.learn-screen { max-width: 640px; }

/* ---------- barre du haut ---------- */
.sub-top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin: -8px 0 4px -8px; }
.sub-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px 0 4px; border: 0; background: none; color: var(--primary-strong); font: inherit; font-size: var(--fs-4); font-weight: 600; cursor: pointer; border-radius: var(--r-sm); }
.sub-back .icon { width: 22px; height: 22px; }
.sub-actions { display: flex; gap: 4px; }
.sub-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--text); border-radius: var(--r-sm); cursor: pointer; }
.sub-icon .icon { width: 22px; height: 22px; }
.sub-icon:hover, .sub-back:hover { background: var(--surface-2); }

/* ---------- titre ---------- */
.screen-head { margin: 0 0 var(--s-5); }
.screen-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; color: var(--text); }
.screen-sub { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-4); }
.group-label-sm { margin: 0 4px var(--s-2); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.learn-block { margin-bottom: var(--s-6); }

/* ---------- listes ---------- */
.list-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.list-box > .list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row:disabled { cursor: default; opacity: .6; }
.list-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-row-title { font-size: var(--fs-4); font-weight: 600; line-height: 1.3; }
.list-row.is-strong .list-row-title { font-weight: 700; }
.list-row-meta { font-size: var(--fs-3); color: var(--muted); }
.list-row-go { flex: 0 0 auto; color: var(--muted); display: grid; }
.list-row-go .icon { width: 20px; height: 20px; }
.list-tile { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--primary-tint); color: var(--primary-strong); }
.list-tile .icon { width: 21px; height: 21px; }
.list-tile.is-solid { background: var(--primary); color: var(--on-primary, #fff); }
.list-done { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 700; font-size: var(--fs-3); }
.list-done .icon { width: 18px; height: 18px; }
.list-state { flex: 0 0 auto; font-size: var(--fs-3); font-weight: 700; color: var(--primary-strong); }
.mini-bar { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.mini-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.list-more { margin-top: var(--s-3); }
.list-count { font-size: var(--fs-3); color: var(--muted); }

/* ---------- carte « à faire maintenant » ---------- */
.now-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: var(--s-6); padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.now-k { margin: 0; font-size: 13px; font-weight: 700; color: var(--primary-strong); }
.now-title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; color: var(--text); }
.now-meta { margin: 4px 0 0; font-size: var(--fs-3); color: var(--muted); }
.now-progress { display: flex; align-items: center; gap: 12px; font-size: var(--fs-3); color: var(--muted); white-space: nowrap; }
.now-progress .mini-bar { flex: 1; margin: 0; }
.now-card .btn { min-height: 52px; font-size: var(--fs-4); }

/* ---------- onglets et barre de liste ---------- */
.learn-screen .seg { margin-bottom: var(--s-4); }
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--s-3); }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-3); font-weight: 600; cursor: pointer; }
.pill-btn .icon { width: 18px; height: 18px; }
.pill-btn.is-on { border-color: var(--primary); color: var(--primary-strong); }

/* ---------- recherche ---------- */
.search-top { display: flex; align-items: center; gap: 8px; margin-bottom: var(--s-4); }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; background: var(--surface); border: 2px solid var(--primary); border-radius: 14px; }
.search-field .icon { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-4); }
.search-cancel { flex: 0 0 auto; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--primary-strong); font: inherit; font-size: var(--fs-4); font-weight: 600; cursor: pointer; }
.search-hint { padding: 0 4px; color: var(--muted); font-size: var(--fs-3); }

/* ---------- bouton principal collé en bas ---------- */
.sticky-cta { position: sticky; bottom: 0; z-index: 2; margin: var(--s-6) calc(-1 * var(--s-4)) 0; padding: 16px var(--s-4); background: var(--bg); border-top: 1px solid var(--border); }
.sticky-cta .btn { width: 100%; min-height: 52px; font-size: var(--fs-4); }
@media (max-width: 639px) {
  .sticky-cta { bottom: calc(66px + env(safe-area-inset-bottom)); }
}

/* ---------- fiche avant de commencer ---------- */
.brief-tag { align-self: flex-start; padding: 4px 10px; border-radius: 8px; background: var(--primary-tint); color: var(--primary-strong); font-size: 13px; font-weight: 700; }
.brief-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s-5); }
.brief-head h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.25; }
.brief-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--s-5); }
.brief-fact { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; text-align: center; }
.brief-fact .icon { width: 22px; height: 22px; color: var(--primary-strong); }
.brief-fact b { font-size: 17px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brief-fact span { font-size: 13px; color: var(--muted); }
.brief-lead { margin: 0 0 var(--s-4); font-size: var(--fs-4); line-height: 1.55; }
.brief-notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: var(--fs-3); }
.brief-notes li { display: flex; gap: 8px; }
.brief-notes li::before { content: ""; flex: 0 0 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--border-strong); }

/* ---------- leçons d'un module ---------- */
.step-dot { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--border); color: var(--muted); font-size: var(--fs-3); font-weight: 700; }
.step-dot.is-done { border-color: var(--green); background: var(--green); color: #fff; }
.step-dot.is-done .icon { width: 18px; height: 18px; }
.step-dot.is-next { border-color: var(--primary); background: var(--primary); color: var(--on-primary, #fff); }

/* ---------- panneau du bas ---------- */
.bsheet-wrap { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: flex-end; justify-content: center; }
.bsheet-backdrop { position: absolute; inset: 0; background: rgba(11, 10, 22, .5); }
.bsheet { position: relative; width: 100%; max-width: 520px; max-height: 85vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 24px 24px 0 0; }
.bsheet-grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--border); }
.bsheet-head { display: flex; align-items: center; justify-content: space-between; }
.bsheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.bsheet-group { margin: 0 0 8px; padding: 0; border: 0; }
.bsheet-group legend { padding: 8px 4px 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bsheet-opt { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 4px; border-bottom: 1px solid var(--border); font-size: var(--fs-4); cursor: pointer; }
.bsheet-opt input { width: 22px; height: 22px; accent-color: var(--primary); }
.bsheet-apply { min-height: 52px; margin-top: 8px; font-size: var(--fs-4); }
@media (min-width: 640px) {
  .bsheet-wrap { align-items: center; }
  .bsheet { border-radius: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .bsheet { animation: bsheet-up .18s ease-out; }
  @keyframes bsheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
