/*
  study flow — styles.
  Toutes les couleurs passent par les variables --sf-*, calculées par js/theme.js.
  Changer de thème = changer ces variables ; rien d'autre à modifier.
*/
:root {
  --sf-bg: #F1F0EE;
  --sf-surface: #FFFFFF;
  --sf-surface-2: #F7F6F4;
  --sf-ink: #2F2622;
  --sf-muted: #6A5D54;
  --sf-line: #E7E1DA;
  --sf-primary: #7A5238;
  --sf-primary-deep: #5C3D2A;
  --sf-primary-tint: #F4EAE0;
  --sf-on-primary: #FFFFFF;
  --sf-secondary: #C26A43;
  --sf-secondary-tint: #F6E3D8;
  --sf-success: #5E7A5C;
  --sf-success-tint: #E3EBDF;
  --sf-shadow: 90, 58, 36;
  --sf-pad: 24px;
  --sf-font: "Nunito", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--sf-bg); color: var(--sf-ink); font-family: var(--sf-font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sf-primary); }
h1, h2, h3, p { margin: 0; }
img { display: block; }
:focus-visible { outline: 3px solid var(--sf-secondary); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ——— mise en page ——— */
.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: 260px; flex-shrink: 0; background: var(--sf-surface); padding: 32px 20px; display: flex; flex-direction: column; gap: 28px; transition: width .3s ease, padding .3s ease; }
.side.is-collapsed { width: 92px; padding: 32px 16px; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.side.is-collapsed .side-top { flex-direction: column; gap: 12px; padding: 0; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; color: var(--sf-ink); font-weight: 600; font-size: 15px; text-decoration: none; transition: background .2s ease; }
.nav-link:hover { background: var(--sf-surface-2); }
.nav-link.is-active { background: var(--sf-primary); color: var(--sf-on-primary); font-weight: 800; box-shadow: 0 14px 24px -12px color-mix(in srgb, var(--sf-primary) 70%, transparent); }
.side.is-collapsed .nav-link { justify-content: center; padding: 12px 0; }
.side.is-collapsed .nav-label { display: none; }
.side-bottom { margin-top: auto; }
.side.is-collapsed .side-bottom { display: flex; justify-content: center; }
.icon-btn { width: 40px; height: 40px; border: none; border-radius: 12px; background: transparent; color: var(--sf-muted); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--sf-surface-2); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; justify-content: space-between; padding: 20px 20px 8px; }
.main { width: 100%; max-width: 1220px; margin: 0 auto; padding: 36px 44px 56px; }
.bottom-nav { display: none; }

@media (max-width: 767px) {
  .side { display: none; }
  .topbar { display: flex; }
  .main { padding: 16px 20px 128px; }
  .bottom-nav { position: fixed; left: 14px; right: 14px; bottom: 16px; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--sf-surface); border-radius: 26px; box-shadow: 0 18px 34px -16px rgba(var(--sf-shadow), .5); }
  .bottom-link { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 18px; font-size: 11px; font-weight: 800; color: var(--sf-muted); text-decoration: none; }
  .bottom-link.is-active { background: var(--sf-primary); color: var(--sf-on-primary); box-shadow: 0 10px 18px -8px color-mix(in srgb, var(--sf-primary) 70%, transparent); }
}

/* ——— éléments ——— */
.stack { display: flex; flex-direction: column; gap: 24px; }
.page-head h1 { font-size: 32px; font-weight: 900; }
.page-head p { margin-top: 4px; font-size: 15px; font-weight: 600; color: var(--sf-muted); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.card { background: var(--sf-surface); border-radius: 26px; padding: var(--sf-pad); box-shadow: 0 18px 34px -24px rgba(var(--sf-shadow), .5); display: flex; flex-direction: column; gap: 18px; }
.card h2 { font-size: 20px; font-weight: 900; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meta { font-size: 13px; font-weight: 700; color: var(--sf-muted); }
.label { font-size: 14px; font-weight: 800; }
.field { display: flex; flex-direction: column; gap: 10px; }
.hint { font-size: 13px; font-weight: 600; color: var(--sf-muted); }
.span-2 { grid-column: 1 / -1; }

.btn { min-height: 44px; padding: 0 18px; border: none; border-radius: 16px; font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--sf-primary); color: var(--sf-on-primary); box-shadow: 0 14px 24px -12px color-mix(in srgb, var(--sf-primary) 70%, transparent); }
.btn-soft { background: var(--sf-surface-2); color: var(--sf-ink); }
.link-btn { border: none; background: none; padding: 0; font-size: 13px; font-weight: 800; color: var(--sf-muted); text-decoration: underline; }

.empty { display: flex; align-items: flex-start; gap: 16px; padding: 20px; border-radius: 22px; background: var(--sf-surface-2); }
.empty-icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 16px; background: var(--sf-primary-tint); color: var(--sf-primary-deep); display: flex; align-items: center; justify-content: center; }
.empty-title { font-size: 16px; font-weight: 800; }
.empty-text { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--sf-muted); }
.empty-text a { font-weight: 800; }

.hero { position: relative; overflow: hidden; border-radius: 30px; background: var(--sf-primary); color: var(--sf-on-primary); box-shadow: 0 24px 40px -22px color-mix(in srgb, var(--sf-primary) 75%, transparent); }
.hero-img { position: absolute; right: 0; top: 0; width: 55%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.hero-body { position: relative; max-width: 470px; padding: 34px; display: flex; flex-direction: column; gap: 8px; }
.hero-kicker { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.hero-title { font-size: 25px; font-weight: 900; line-height: 1.2; }
.hero-text { font-size: 15px; font-weight: 600; opacity: .92; }
.hero-text a { color: inherit; font-weight: 800; }
@media (max-width: 639px) { .hero-img { display: none; } .hero-body { padding: 26px; } }

/* interrupteurs et pastilles */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--sf-line); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 15px; font-weight: 700; }
.switch { width: 52px; height: 30px; flex-shrink: 0; padding: 3px; border: none; border-radius: 999px; background: var(--sf-line); display: flex; justify-content: flex-start; transition: background .2s ease; }
.switch[aria-checked="true"] { background: var(--sf-primary); justify-content: flex-end; }
.switch span { width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 16px; background: var(--sf-surface-2); align-self: flex-start; }
.seg button { min-height: 40px; padding: 0 16px; border: none; border-radius: 12px; background: transparent; font-size: 14px; font-weight: 800; color: var(--sf-muted); }
.seg button[aria-pressed="true"] { background: var(--sf-surface); color: var(--sf-ink); box-shadow: 0 6px 14px -8px rgba(var(--sf-shadow), .5); }

.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 479px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.theme-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: none; border-radius: 18px; background: var(--sf-surface-2); color: var(--sf-ink); text-align: left; box-shadow: 0 0 0 1px var(--sf-line); }
.theme-card.is-dark { background: #2A2420; color: #EDE4D9; }
.theme-card[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--sf-surface), 0 0 0 5px var(--sf-primary); }
.theme-dots { display: flex; gap: 4px; }
.theme-dots span { width: 24px; height: 24px; border-radius: 8px; }
.theme-name { font-size: 14px; font-weight: 800; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: none; border-radius: 14px; background: var(--sf-surface-2); font-size: 13px; font-weight: 800; box-shadow: 0 0 0 1px var(--sf-line); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--sf-primary); }
.swatch i { width: 28px; height: 28px; border-radius: 10px; border: 1px solid var(--sf-line); }
.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.color-pick { display: inline-flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px; border-radius: 16px; background: var(--sf-surface-2); font-size: 14px; font-weight: 800; cursor: pointer; }
.color-pick input { width: 40px; height: 40px; padding: 0; border: none; border-radius: 12px; background: none; cursor: pointer; }
.hex { width: 112px; height: 40px; padding: 0 12px; border: 1px solid var(--sf-line); border-radius: 12px; background: var(--sf-surface); font-family: ui-monospace, Menlo, monospace; font-size: 14px; }

/* statut de sauvegarde */
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--sf-surface-2); color: var(--sf-muted); }
.status.is-ok { background: var(--sf-success-tint); color: var(--sf-success); }
.status.is-bad { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.status button { border: none; background: none; padding: 0; font-weight: 800; color: inherit; text-decoration: underline; }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 6px; line-height: 1; color: var(--sf-primary-deep); letter-spacing: -0.02em; text-decoration: none; }
.logo b { font-weight: 900; font-size: 1.14em; }
.logo span { font-weight: 300; }
.mark { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; background: var(--sf-primary-tint); color: var(--sf-primary-deep); box-shadow: 0 10px 24px -16px rgba(var(--sf-shadow), .45); }
.mark-letters { line-height: .9; letter-spacing: -0.04em; }

/* message plein écran (configuration, session) */
.notice { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.notice p { max-width: 460px; font-size: 16px; font-weight: 600; color: var(--sf-muted); }

/* ——— écran de chargement ——— */
.splash { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: var(--sf-bg); transition: opacity .5s ease; }
.splash.is-leaving { opacity: 0; pointer-events: none; }
.splash-blur { position: absolute; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); object-fit: cover; filter: blur(28px); opacity: .9; }
.splash-fade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--sf-bg) 92%, transparent) 78%, var(--sf-bg) 100%); }
.splash-art { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: min(700px, 120vw); aspect-ratio: 634 / 560; overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 48%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 48%, #000 62%, transparent 100%); }
.splash-art img, .splash-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.splash-mist { position: absolute; left: -10%; right: -10%; top: 34%; height: 15%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.55), rgba(255,255,255,0)); }
.splash-z { position: absolute; left: 60%; top: 41%; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(60,30,10,.4); }
.splash-z span { position: absolute; }
.splash-fly { position: absolute; border-radius: 50%; background: #FFE9A8; box-shadow: 0 0 10px #FFE9A8; }
.splash-brand { position: absolute; left: 0; right: 0; top: min(74vh, 590px); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 24px; text-align: center; }
.splash.no-mascot .splash-brand { top: 38vh; }
.splash-brand p { font-size: 16px; font-weight: 600; color: var(--sf-muted); }
.splash-bar-wrap { position: absolute; left: 0; right: 0; bottom: 56px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.splash-bar { width: 240px; height: 12px; padding: 3px; border-radius: 999px; background: var(--sf-surface); box-shadow: 0 10px 24px -16px rgba(var(--sf-shadow), .45); }
.splash-bar div { height: 6px; border-radius: 999px; background: var(--sf-primary); }
.splash-bar-wrap p { font-size: 14px; font-weight: 800; color: var(--sf-muted); }

@keyframes sf-zoom { 0% { transform: scale(1.02) } 100% { transform: scale(1.09) translate(-1%, -1%) } }
@keyframes sf-breathe { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.018) translateY(-1px) } }
@keyframes sf-z { 0% { opacity: 0; transform: translate(0, 0) scale(.6) } 25% { opacity: 1 } 100% { opacity: 0; transform: translate(26px, -60px) scale(1.15) } }
@keyframes sf-mist { 0% { transform: translateX(-12%) } 100% { transform: translateX(12%) } }
@keyframes sf-fly { 0%, 100% { transform: translateY(0); opacity: .3 } 50% { transform: translateY(-12px); opacity: 1 } }
@keyframes sf-bar { 0% { width: 8% } 75% { width: 88% } 100% { width: 100% } }
@keyframes sf-appear { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.sf-zoom { animation: sf-zoom 14s ease-in-out infinite alternate; }
.sf-breathe { animation: sf-breathe 3.6s ease-in-out infinite; transform-origin: 47% 75%;
  -webkit-mask-image: radial-gradient(ellipse 38% 30% at 47% 58%, #000 60%, transparent 100%); mask-image: radial-gradient(ellipse 38% 30% at 47% 58%, #000 60%, transparent 100%); }
.sf-z1 { animation: sf-z 3.6s ease-out infinite; }
.sf-z2 { animation: sf-z 3.6s ease-out infinite 1.2s; }
.sf-z3 { animation: sf-z 3.6s ease-out infinite 2.4s; }
.sf-mist { animation: sf-mist 11s ease-in-out infinite alternate; }
.sf-fly1 { animation: sf-fly 4s ease-in-out infinite; }
.sf-fly2 { animation: sf-fly 5s ease-in-out infinite 1.5s; }
.sf-bar { animation: sf-bar 3.4s cubic-bezier(.4,.1,.2,1) infinite; }
.sf-appear { animation: sf-appear .45s ease both; }

/* animations coupées : réglage de l'appli ou préférence du système */
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===================== composants v2 ===================== */
.ic { flex-shrink: 0; }
.row-between { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.center { text-align: center; justify-content: center; }
.back-link, .meta-link { font-size: 14px; font-weight: 800; text-decoration: none; color: var(--sf-muted); }
.back-link { display: inline-block; margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--sf-surface-2); color: var(--sf-ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
.chip-primary { background: var(--sf-primary-tint); color: var(--sf-primary-deep); }
.chip-terre { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.chip-warn { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.chip-sauge { background: var(--sf-success-tint); color: var(--sf-success); }
.chip-light { background: rgba(255,255,255,.2); color: #fff; }
.bar { flex: 1; min-width: 60px; height: 8px; border-radius: 999px; background: var(--sf-primary-tint); overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; background: var(--sf-primary); transition: width .4s ease; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 13px; }
.btn-danger { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.btn-light { background: #fff; color: var(--sf-primary-deep); }
.btn:disabled { opacity: .5; cursor: default; }
a.btn { text-decoration: none; }
.icon-btn.small { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.is-on, .icon-btn[aria-pressed="true"] { background: var(--sf-primary-tint); color: var(--sf-primary-deep); }
.icon-btn.on-dark { color: #fff; }
.icon-btn.on-dark:hover, .icon-btn.on-dark.is-on { background: rgba(255,255,255,.18); color: #fff; }
.row-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-actions.center { justify-content: center; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.input { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--sf-line); border-radius: 14px; background: var(--sf-surface); color: var(--sf-ink); font-size: 15px; }
.input:focus { outline: 2px solid var(--sf-primary); outline-offset: 0; border-color: transparent; }
.input-auto { width: auto; }
.textarea { padding: 12px 14px; min-height: 90px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 10px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .form-cols, .form-cols3 { grid-template-columns: 1fr; } }
.form-split { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 22px; align-items: start; }
@media (max-width: 640px) { .form-split { grid-template-columns: 1fr; } .cover-preview { max-width: 200px; } }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sf-primary); }
.seg-wrap { flex-wrap: wrap; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.pick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pick { min-height: 38px; border: none; border-radius: 12px; background: var(--sf-surface-2); font-size: 13px; font-weight: 800; }
.pick[aria-pressed="true"] { background: var(--sf-primary); color: var(--sf-on-primary); }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.color-dot { width: 34px; height: 34px; border-radius: 12px; border: none; }
.color-dot[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--sf-surface), 0 0 0 5px var(--sf-ink); }

/* fenêtres */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(30, 22, 18, .38); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 18px; animation: sf-appear .2s ease both; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: var(--sf-surface); border-radius: 28px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.45); display: flex; flex-direction: column; }
.modal-wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 22px 6px 26px; }
.modal-head h2 { font-size: 21px; font-weight: 900; }
.modal-body { padding: 10px 26px 18px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 14px 22px 22px; border-top: 1px solid var(--sf-line); }
.modal-actions .btn-danger { margin-right: auto; }
.modal-text { font-size: 15px; font-weight: 600; color: var(--sf-muted); line-height: 1.5; }
.toasts { position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 767px) { .toasts { bottom: 100px; } }
.toast { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 16px; background: var(--sf-ink); color: var(--sf-bg); font-size: 14px; font-weight: 800; box-shadow: 0 18px 30px -14px rgba(0,0,0,.5); animation: sf-appear .3s ease both; transition: opacity .4s ease; max-width: min(520px, 92vw); }
.toast.is-leaving { opacity: 0; }
.toast-badge { background: var(--sf-primary); color: var(--sf-on-primary); }
.toast-warn { background: var(--sf-secondary); color: #fff; }
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 220px; padding: 6px; border-radius: 18px; background: var(--sf-surface); box-shadow: 0 24px 44px -18px rgba(var(--sf-shadow), .55), 0 0 0 1px var(--sf-line); display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: none; border-radius: 12px; background: transparent; font-size: 14px; font-weight: 700; color: var(--sf-ink); text-align: left; }
.menu-item:hover { background: var(--sf-surface-2); }
.menu-item.is-danger { color: var(--sf-secondary); }
.menu-wrap .icon-btn span { font-size: 13px; font-weight: 800; padding: 0 6px; }
.menu-wrap .icon-btn:has(span) { width: auto; padding: 0 8px; }

/* menu latéral : recherche */
.search-trigger { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: none; border-radius: 14px; background: var(--sf-surface-2); color: var(--sf-muted); font-size: 14px; font-weight: 700; }
.search-trigger kbd { margin-left: auto; font-family: inherit; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--sf-surface); }
.side.is-collapsed .search-trigger { justify-content: center; padding: 0; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.shell.is-reading .main { max-width: none; padding: 18px 22px 28px; }
@media (max-width: 767px) { .shell.is-reading .main { padding: 8px 10px 110px; } }

/* accueil */
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; align-items: start; }
.widget { background: var(--sf-surface); border-radius: 28px; padding: var(--sf-pad); box-shadow: 0 18px 34px -24px rgba(var(--sf-shadow), .5); display: flex; flex-direction: column; gap: 16px; min-width: 0; text-decoration: none; color: var(--sf-ink); }
.widget-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.widget-head h2 { font-size: 20px; font-weight: 900; }
.list-cards { display: flex; flex-direction: column; gap: 10px; }
.deadline-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 20px; background: var(--sf-surface-2); text-decoration: none; color: var(--sf-ink); }
.dl-icon { width: 46px; height: 46px; flex-shrink: 0; border-radius: 15px; background: var(--sf-primary-tint); color: var(--sf-primary-deep); display: flex; align-items: center; justify-content: center; }
.dl-icon.is-late { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.dl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dl-body b { font-size: 15px; font-weight: 800; }
.dl-body small, .dl-when small { font-size: 12.5px; font-weight: 600; color: var(--sf-muted); }
.dl-when { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.dl-when b { font-size: 14px; font-weight: 900; }
.is-late { color: var(--sf-secondary) !important; }
.is-soon { color: var(--sf-primary); }
.cover-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 168px); gap: 16px; overflow-x: auto; padding: 2px 4px 20px; margin: 0 -4px; }
.resume-stack { position: relative; padding-top: 18px; margin-right: 10px; }
.resume-ghost { position: absolute; inset: 40px -10px -8px 22px; border-radius: 24px; border: 2px dashed color-mix(in srgb, var(--sf-primary) 30%, transparent); }
.resume-card { position: relative; padding: 20px 86px 20px 22px; border-radius: 24px; background: var(--sf-surface); box-shadow: 0 28px 44px -24px rgba(var(--sf-shadow), .55), 0 0 0 1px var(--sf-line); display: flex; flex-direction: column; gap: 10px; }
.resume-title { font-size: 16px; font-weight: 800; }
.resume-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.resume-line small { font-size: 12.5px; font-weight: 600; color: var(--sf-muted); }
.resume-line .bar { max-width: 90px; }
.resume-play { position: absolute; right: -6px; top: 0; width: 66px; height: 66px; border-radius: 20px; background: var(--sf-primary); color: var(--sf-on-primary); display: flex; align-items: center; justify-content: center; box-shadow: 0 16px 28px -10px color-mix(in srgb, var(--sf-primary) 75%, transparent); }
.resume-play svg { fill: currentColor; }
.resume-small { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--sf-surface-2); text-decoration: none; color: var(--sf-ink); }
.resume-small b { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-small .bar { max-width: 70px; }
.resume-small small { font-size: 12px; font-weight: 600; color: var(--sf-muted); }
.progress-wrap { display: flex; gap: 22px; align-items: flex-end; flex-wrap: wrap; }
.ring-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring-card p { font-size: 13px; font-weight: 800; color: var(--sf-muted); }
.pillars { flex: 1; display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 22px; min-width: 0; }
.pillar { position: relative; flex: 1 0 64px; max-width: 86px; height: 210px; border-radius: 999px; padding: 20px 0 18px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; background: var(--sf-surface); box-shadow: 0 14px 26px -18px rgba(var(--sf-shadow), .55), 0 0 0 1px var(--sf-line); text-decoration: none; color: var(--sf-ink); }
.pillar-name { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; font-weight: 800; max-height: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pillar b { font-size: 16px; font-weight: 900; }
.pillar.is-top { background: var(--sf-primary); color: var(--sf-on-primary); box-shadow: 0 26px 34px -12px color-mix(in srgb, var(--sf-primary) 70%, transparent); }
.pillar.is-empty { background: transparent; box-shadow: none; border: 2px dashed var(--sf-line); }
.pillar-dot { position: absolute; top: 10px; right: 50%; transform: translateX(50%); width: 8px; height: 8px; border-radius: 50%; background: var(--sf-secondary); }
.level-card { flex-direction: row; align-items: center; gap: 18px; }
.level-title { font-size: 17px; font-weight: 900; }
.level-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.badge-row { display: flex; gap: 8px; margin-top: 4px; }
.badge-mini { width: 38px; height: 38px; border-radius: 13px; background: var(--sf-primary-tint); color: var(--sf-primary-deep); display: flex; align-items: center; justify-content: center; }
.week { display: flex; flex-direction: column; gap: 10px; }
.week-line { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.week-line span:nth-child(2) { flex: 1; }
.week-line b { font-size: 18px; font-weight: 900; }
.week-ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.tone-sauge { background: var(--sf-success-tint); color: var(--sf-success); }
.tone-terre { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.tone-brun { background: var(--sf-primary-tint); color: var(--sf-primary-deep); }
.tone-miel { background: #FBEFD2; color: #7A5A1C; }
.rev-card { flex-direction: row; align-items: center; gap: 16px; }
.rev-icon { width: 56px; height: 56px; flex-shrink: 0; border-radius: 18px; background: var(--sf-success-tint); color: var(--sf-success); display: flex; align-items: center; justify-content: center; }
.action-card { position: relative; overflow: hidden; background: var(--sf-secondary); color: #fff; min-height: 220px; }
.action-img { position: absolute; right: 0; top: 0; width: 46%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(90deg, transparent, #000 50%); mask-image: linear-gradient(90deg, transparent, #000 50%); }
.action-body { position: relative; display: flex; flex-direction: column; gap: 10px; max-width: 64%; }
.action-body h2 { font-size: 22px; font-weight: 900; line-height: 1.2; }
.action-body p { font-size: 14px; font-weight: 600; opacity: .95; }
.action-kicker { font-size: 12px !important; font-weight: 800 !important; letter-spacing: .12em; text-transform: uppercase; }
.action-body .btn { align-self: flex-start; margin-top: 6px; }
.hero .btn { align-self: flex-start; margin-top: 8px; }

/* couvertures */
.cover { position: relative; aspect-ratio: 200 / 240; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 30px -16px color-mix(in srgb, var(--cover-shadow) 75%, transparent); }
.cover-art, .cover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-text { position: absolute; left: 14px; right: 14px; top: 40%; display: flex; flex-direction: column; gap: 4px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.18); }
.cover-kicker { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.cover-title { font-size: 18px; font-weight: 900; line-height: 1.12; overflow-wrap: anywhere; }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 26px 20px; }
.cover-card { position: relative; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--sf-ink); min-width: 0; }
.cover-link { display: block; text-decoration: none; }
.cover-meta { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.cover-meta b { font-size: 13px; font-weight: 900; }
.cover-card .hint { padding: 0 2px; font-size: 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fav-btn { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: none; border-radius: 12px; background: rgba(255,255,255,.92); color: var(--sf-primary-deep); display: flex; align-items: center; justify-content: center; }
.fav-btn.is-on svg { fill: currentColor; }
.add-card { min-height: 240px; border: 2px dashed var(--sf-line); border-radius: 24px; background: transparent; color: var(--sf-muted); font-size: 15px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.cover-preview .cover { width: 100%; }

/* page cours */
.course-banner { position: relative; overflow: hidden; border-radius: 30px; min-height: 190px; color: #fff; display: flex; align-items: stretch; box-shadow: 0 26px 44px -24px color-mix(in srgb, var(--banner-shadow) 80%, transparent); }
.banner-art { position: absolute; right: 0; top: 0; height: 100%; width: 60%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
.banner-art .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner-body { position: relative; flex: 1; padding: 26px 30px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.banner-body h1 { font-size: 30px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.banner-back { color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; opacity: .9; }
.banner-kicker { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.banner-side { position: relative; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 18px 20px; }
.banner-ring { background: rgba(0,0,0,.18); border-radius: 50%; padding: 6px; }
.banner-ring .ring text { fill: #fff; }
.banner-ring .ring circle:first-child { stroke: rgba(255,255,255,.25); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--sf-line); }
.tabs button { min-height: 46px; padding: 0 16px; border: none; border-bottom: 3px solid transparent; background: transparent; font-size: 15px; font-weight: 700; color: var(--sf-muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--sf-primary); color: var(--sf-ink); font-weight: 900; }
.section-block { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 28px; background: color-mix(in srgb, var(--sf-surface) 55%, transparent); border: 1px solid var(--sf-line); }
.section-head { display: flex; align-items: center; gap: 10px; }
.section-head h2 { font-size: 18px; font-weight: 900; text-transform: lowercase; }
.chapter { border-radius: 20px; background: var(--sf-surface); box-shadow: 0 14px 28px -24px rgba(var(--sf-shadow), .6); }
.chapter.depth-2, .chapter.depth-3 { box-shadow: none; background: var(--sf-surface-2); margin-left: 6px; }
.chapter-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; min-height: 52px; }
.chapter-head::-webkit-details-marker { display: none; }
.chapter-head > svg:first-child { transition: transform .2s ease; color: var(--sf-muted); }
.chapter[open] > .chapter-head > svg:first-child { transform: rotate(90deg); }
.chapter-title { font-size: 15px; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.chapter-body { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 14px 40px; }
.is-highlight { outline: 3px solid color-mix(in srgb, var(--sf-primary) 45%, transparent); outline-offset: 2px; }
.status-select { min-height: 32px; padding: 0 8px; border: none; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--sf-surface-2); color: var(--sf-ink); cursor: pointer; }
.status-select.st-en_cours { background: var(--sf-primary-tint); color: var(--sf-primary-deep); }
.status-select.st-termine { background: var(--sf-success-tint); color: var(--sf-success); }
.status-select.st-a_revoir { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--sf-surface-2); min-width: 0; flex-wrap: wrap; }
.doc-kind { font-size: 10.5px; font-weight: 900; padding: 4px 7px; border-radius: 8px; background: var(--sf-primary-tint); color: var(--sf-primary-deep); text-transform: uppercase; letter-spacing: .04em; }
.kind-pdf { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.kind-audio, .kind-video { background: var(--sf-success-tint); color: var(--sf-success); }
.doc-title { font-size: 14px; font-weight: 800; color: var(--sf-ink); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
a.doc-title:hover { text-decoration: underline; }
.doc-meta { font-size: 12px; }
.assignment { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 24px; background: var(--sf-surface); box-shadow: 0 18px 34px -24px rgba(var(--sf-shadow), .55); }
.assign-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.assign-head h3 { font-size: 20px; font-weight: 900; margin: 6px 0 2px; }
.assign-ring { display: flex; align-items: center; gap: 10px; }
.assign-ring b { font-size: 14px; font-weight: 900; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 12px; border-radius: 16px; border: 1px solid var(--sf-line); flex-wrap: wrap; }
.step.is-next { border-color: color-mix(in srgb, var(--sf-primary) 45%, transparent); background: var(--sf-primary-tint); }
.step.is-done .step-title { text-decoration: line-through; color: var(--sf-muted); }
.step-box { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; border: 2px solid var(--sf-line); background: var(--sf-surface); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.step-box[aria-checked="true"] { background: var(--sf-success); border-color: var(--sf-success); }
.step-text { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; border: none; background: transparent; padding: 4px 0; text-align: left; color: var(--sf-ink); }
.step-title { font-size: 15px; font-weight: 700; }
.rendu { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--sf-line); }
.deadline-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--sf-line); flex-wrap: wrap; text-decoration: none; color: var(--sf-ink); }
.deadline-row:last-child { border-bottom: none; }
.deadline-row.is-done .step-title { text-decoration: line-through; color: var(--sf-muted); }
.when { display: flex; flex-direction: column; align-items: flex-end; min-width: 92px; text-align: right; }
.when b { font-size: 14px; font-weight: 900; }
.when small { font-size: 12px; color: var(--sf-muted); font-weight: 600; }
.avg-card { flex-direction: row; align-items: center; gap: 20px; }
.calc-out { font-size: 15px; font-weight: 800; color: var(--sf-primary-deep); background: var(--sf-primary-tint); padding: 12px 14px; border-radius: 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--sf-muted); font-weight: 800; padding: 8px; border-bottom: 1px solid var(--sf-line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--sf-line); }
.table tr.is-muted td { color: var(--sf-muted); }

/* révisions */
.kind-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.kind-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; border: none; border-radius: 22px; background: var(--sf-surface); color: var(--sf-ink); text-align: left; box-shadow: 0 14px 26px -20px rgba(var(--sf-shadow), .55); }
.kind-tile.is-on { box-shadow: 0 0 0 3px var(--sf-primary); }
.kind-tile b { font-size: 15px; font-weight: 900; }
.kind-tile small { font-size: 22px; font-weight: 900; color: var(--sf-muted); }
.rev-kind { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--sf-primary-tint); color: var(--sf-primary-deep); flex-shrink: 0; }
.k-qcm { background: #E9E6F7; color: #4A437E; }
.k-flashcard { background: #FBEFD2; color: #7A5A1C; }
.k-fiche { background: var(--sf-success-tint); color: var(--sf-success); }
.k-annale, .k-corrige { background: var(--sf-secondary-tint); color: var(--sf-secondary); }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.review-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 22px; background: var(--sf-surface); color: var(--sf-ink); text-decoration: none; box-shadow: 0 14px 26px -20px rgba(var(--sf-shadow), .55); }
.review-card b { font-size: 15px; font-weight: 900; }
.review-card small { font-size: 12.5px; color: var(--sf-muted); font-weight: 600; }
.q-row { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px 6px; border: none; border-bottom: 1px solid var(--sf-line); background: transparent; text-align: left; color: var(--sf-ink); }
.q-row:last-child { border-bottom: none; }
.q-row small { color: var(--sf-muted); font-weight: 600; }
.answers-edit { display: flex; flex-direction: column; gap: 8px; }
.answer-edit { display: flex; align-items: center; gap: 10px; }
.answer-edit .check { flex-shrink: 0; }
.play { gap: 18px; }
.play-top { display: flex; align-items: center; gap: 12px; }
.play-q { font-size: 22px; font-weight: 900; line-height: 1.3; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--sf-line); background: var(--sf-surface); font-size: 15px; font-weight: 700; color: var(--sf-ink); text-align: left; }
.choice-letter { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; background: var(--sf-surface-2); display: flex; align-items: center; justify-content: center; font-weight: 900; }
.choice.is-picked { border-color: var(--sf-primary); background: var(--sf-primary-tint); }
.choice.is-right { border-color: var(--sf-success); background: var(--sf-success-tint); }
.choice.is-wrong { border-color: var(--sf-secondary); background: var(--sf-secondary-tint); }
.choice:disabled { cursor: default; }
.explain { padding: 12px 14px; border-radius: 14px; background: var(--sf-surface-2); font-size: 14px; font-weight: 600; }
.play-end { align-items: center; text-align: center; gap: 14px; }
.big-ring { width: 120px; height: 120px; border-radius: 50%; border: 12px solid var(--sf-primary); display: flex; align-items: center; justify-content: center; }
.big-ring b { font-size: 22px; font-weight: 900; }
.flashcard { min-height: 260px; padding: 28px; border-radius: 26px; border: none; background: var(--sf-primary-tint); color: var(--sf-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; box-shadow: 0 24px 40px -26px rgba(var(--sf-shadow), .6); }
.flashcard.is-flipped { background: var(--sf-success-tint); }
.flash-side { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sf-muted); }
.flash-text { font-size: 22px; font-weight: 800; line-height: 1.35; white-space: pre-wrap; }
.flash-img { max-width: 100%; max-height: 220px; border-radius: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mini-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: none; border-radius: 18px; background: var(--sf-surface); text-align: left; color: var(--sf-ink); box-shadow: 0 12px 22px -18px rgba(var(--sf-shadow), .55); }
.mini-card small { color: var(--sf-muted); font-weight: 600; white-space: pre-wrap; }
.rich { display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.6; }
.rich h3 { font-size: 20px; font-weight: 900; }
.rich h4 { font-size: 17px; font-weight: 900; }
.rich ul { margin: 0; padding-left: 20px; }
.linked { flex-direction: row; align-items: center; gap: 12px; text-decoration: none; color: var(--sf-ink); }

/* échéances, progression */
.link-row { color: var(--sf-ink); }
.level-hero { flex-direction: row; align-items: center; gap: 26px; flex-wrap: wrap; }
.level-hero h2 { font-size: 24px; }
.hero-kicker.dark { color: var(--sf-muted); opacity: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 18px; background: var(--sf-surface-2); }
.stat b { font-size: 26px; font-weight: 900; }
.stat span { font-size: 13px; font-weight: 700; color: var(--sf-muted); }
.avg-general { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 16px; background: var(--sf-primary-tint); font-weight: 800; }
.avg-general b { font-size: 24px; font-weight: 900; color: var(--sf-primary-deep); }
.avg-list { display: flex; flex-direction: column; }
.avg-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--sf-line); font-weight: 700; }
.avg-row a { flex: 1; color: var(--sf-ink); text-decoration: none; }
.avg-row input { width: 18px; height: 18px; accent-color: var(--sf-primary); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; border-radius: 22px; background: var(--sf-surface-2); text-align: center; opacity: .55; }
.badge.is-got { opacity: 1; background: var(--sf-surface); box-shadow: 0 16px 28px -20px rgba(var(--sf-shadow), .6), 0 0 0 1px var(--sf-line); }
.badge-ic { width: 54px; height: 54px; border-radius: 18px; background: var(--sf-line); color: var(--sf-muted); display: flex; align-items: center; justify-content: center; }
.badge.is-got .badge-ic { background: #FBEFD2; color: #9A6C10; box-shadow: 0 10px 18px -10px rgba(184,138,58,.8); }
.badge b { font-size: 14px; font-weight: 900; }
.badge small { font-size: 12px; color: var(--sf-muted); font-weight: 600; }

/* passage à l'action */
.action-flow { display: flex; flex-direction: column; gap: 14px; }
.action-panda { width: 100%; height: 140px; object-fit: cover; object-position: 50% 62%; border-radius: 20px; }
.situations { display: flex; flex-direction: column; gap: 8px; }
.situation { min-height: 48px; padding: 10px 16px; border: none; border-radius: 16px; background: var(--sf-surface-2); font-size: 15px; font-weight: 700; text-align: left; color: var(--sf-ink); }
.situation:hover { background: var(--sf-primary-tint); }
.suggestion { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 22px; background: var(--sf-primary-tint); }
.sugg-icon { width: 50px; height: 50px; border-radius: 16px; background: var(--sf-surface); color: var(--sf-success); display: flex; align-items: center; justify-content: center; }
.sugg-kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sf-muted); }
.suggestion h3 { font-size: 20px; font-weight: 900; line-height: 1.25; }
.suggestion p { font-size: 15px; font-weight: 600; }

/* recherche */
.search-input { min-height: 52px; font-size: 16px; }
.search-results { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.search-group { display: flex; flex-direction: column; gap: 4px; }
.search-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: none; border-radius: 14px; background: transparent; text-align: left; color: var(--sf-ink); }
.search-item:hover, .search-item:focus-visible { background: var(--sf-surface-2); }
.search-item span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-item small { font-size: 12.5px; color: var(--sf-muted); font-weight: 600; }
.search-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px; background: var(--sf-primary-tint); color: var(--sf-primary-deep); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.snippet mark { background: #F6D766; color: inherit; border-radius: 3px; }

/* paramètres */
.settings-body { display: flex; flex-direction: column; gap: 22px; max-width: 860px; }
.widget-list { display: flex; flex-direction: column; gap: 6px; }
.widget-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 14px; background: var(--sf-surface-2); font-size: 14px; font-weight: 700; }
.widget-item.is-off span:first-child { color: var(--sf-muted); text-decoration: line-through; }
.storage { display: flex; align-items: center; gap: 18px; }
.storage b { font-size: 17px; font-weight: 900; }
.trash { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }

/* lecteurs */
.media-card { align-items: center; text-align: center; }
.media-icon { width: 72px; height: 72px; border-radius: 22px; background: var(--sf-success-tint); color: var(--sf-success); display: flex; align-items: center; justify-content: center; }
.media-audio { width: 100%; max-width: 560px; }
.media-video { width: 100%; max-height: 70vh; border-radius: 18px; background: #000; }
.viewer-img { max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 12px; }
.note-text { white-space: pre-wrap; font-family: inherit; font-size: 15px; line-height: 1.6; margin: 0; }
.reader { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 46px); min-height: 520px; position: relative; }
@media (max-width: 767px) { .reader { height: calc(100vh - 180px); } }
.reader-head { display: flex; align-items: center; gap: 12px; }
.reader-back { width: 42px; height: 42px; flex-shrink: 0; border-radius: 14px; background: var(--sf-surface); display: flex; align-items: center; justify-content: center; font-weight: 900; text-decoration: none; color: var(--sf-ink); box-shadow: 0 8px 18px -12px rgba(var(--sf-shadow), .5); }
.reader-title { flex: 1; min-width: 0; }
.reader-title h1 { font-size: 18px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 20px; background: var(--sf-surface); box-shadow: 0 14px 30px -22px rgba(var(--sf-shadow), .6); }
.tb-sep { width: 1px; height: 22px; background: var(--sf-line); margin: 0 6px; }
.page-nav { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.page-input { width: 56px; height: 34px; text-align: center; border: 1px solid var(--sf-line); border-radius: 10px; background: var(--sf-surface); font-weight: 800; }
.zoom-label { min-width: 52px; text-align: center; font-size: 13px; font-weight: 800; }
.reader-toolbar .input-auto { min-height: 36px; font-size: 13px; font-weight: 800; border-radius: 12px; }
.reader.is-focus .reader-toolbar .tb-extra, .reader.is-focus .reader-head .hint { display: none; }
.reader-body { flex: 1; min-height: 0; display: flex; gap: 14px; }
.pdf-viewer { flex: 1; min-width: 0; overflow: auto; border-radius: 22px; background: color-mix(in srgb, var(--sf-ink) 8%, var(--sf-bg)); padding: 16px; position: relative; }
.pdf-viewer[data-bg="sombre"] { background: #1A1715; }
.pdf-viewer[data-bg="sepia"] { background: #E7DAC2; }
.pdf-loading { padding: 40px; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 10px 30px -14px rgba(0,0,0,.35); border-radius: 4px; flex-shrink: 0; }
.pdf-canvas { position: absolute; inset: 0; display: block; }
.page-num { position: absolute; right: 8px; bottom: 6px; font-size: 11px; font-weight: 800; color: #999; z-index: 3; }
.hide-images .page-num { display: none; }
.ann-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ann { position: absolute; border-radius: 2px; }
.ann-highlight, .ann-comment { background: var(--ann-color); mix-blend-mode: multiply; opacity: .55; }
.ann-underline { border-bottom: 2px solid var(--ann-color); }
.ann-pin { position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; background: var(--ann-color); pointer-events: auto; padding: 0; z-index: 4; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); color: #3A2A20; }
.ann-pin.has-comment { width: 22px; height: 22px; }
.search-hit { background: rgba(246, 215, 102, .55) !important; border-radius: 2px; }
.reader-panel { width: 320px; flex-shrink: 0; overflow: auto; padding: 18px; border-radius: 22px; background: var(--sf-surface); box-shadow: 0 18px 34px -24px rgba(var(--sf-shadow), .55); display: flex; flex-direction: column; gap: 14px; }
.reader-panel[hidden] { display: none; }
@media (max-width: 900px) { .reader-body { position: relative; } .reader-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 10; width: min(340px, 92%); } }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 18px; font-weight: 900; }
.reader-panel input[type="range"] { width: 100%; accent-color: var(--sf-primary); }
.ann-item { display: flex; align-items: flex-start; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--sf-line); }
.ann-jump { flex: 1; display: flex; align-items: flex-start; gap: 10px; border: none; background: transparent; padding: 6px 4px; text-align: left; color: var(--sf-ink); font-size: 14px; font-weight: 700; }
.ann-jump > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ann-jump small { color: var(--sf-muted); font-weight: 700; }
.ann-quote { font-weight: 600; color: var(--sf-muted); font-size: 13px; }
.ann-dot { width: 14px; height: 14px; flex-shrink: 0; margin-top: 3px; border-radius: 5px; }
.sel-bar { position: absolute; z-index: 30; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 16px; background: var(--sf-surface); box-shadow: 0 18px 34px -12px rgba(0,0,0,.35), 0 0 0 1px var(--sf-line); }
.sel-bar[hidden] { display: none; }
.sel-bar .color-dot { width: 28px; height: 28px; border-radius: 50%; }
.quote { margin: 0; padding: 10px 14px; border-left: 4px solid var(--sf-primary); background: var(--sf-surface-2); border-radius: 10px; font-size: 14px; font-style: italic; }
.scan-note { padding: 10px 14px; border-radius: 14px; background: var(--sf-secondary-tint); color: var(--sf-secondary); font-size: 13px; font-weight: 700; }
.scan-note[hidden] { display: none; }
.reflow { margin: 0 auto; padding: 28px 34px 80px; background: #fff; color: #2B2522; border-radius: 10px; box-shadow: 0 10px 30px -14px rgba(0,0,0,.35); }
.reflow[hidden] { display: none; }
.pdf-viewer[data-bg="sepia"] .reflow { background: #F6ECD9; color: #47372A; }
.pdf-viewer[data-bg="sombre"] .reflow { background: #2A2420; color: #EDE4D9; }
.reflow p { margin: 0 0 var(--para-gap, .9em); }
.reflow h3 { margin: 1.2em 0 .6em; font-size: 1.25em; }
.reflow-marker { font-family: var(--sf-font); font-size: 12px !important; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9A8C80; margin: 1.6em 0 .6em !important; }
.reflow-note { font-family: var(--sf-font); font-size: 13px !important; font-weight: 700; color: #7A6A5E; background: rgba(0,0,0,.04); padding: 10px 12px; border-radius: 10px; }

/* couche de texte PDF.js (sélection) */
.textLayer { position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; letter-spacing: normal; word-spacing: normal; -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; z-index: 2; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.textLayer span, .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; -webkit-user-select: text; user-select: text; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.textLayer .markedContent { display: contents; }
.textLayer ::selection { background: rgba(122, 82, 56, .28); color: transparent; }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }
.textLayer.selecting .endOfContent { top: 0; }
[hidden] { display: none !important; }
@media (max-width: 767px) {
  .reader-toolbar .tb-sep, .reader-toolbar .tb-extra, .reader-toolbar .zoom-label { display: none; }
  .reader-toolbar { gap: 0; padding: 4px; }
  .reader-toolbar .input-auto { max-width: 150px; }
  .bottom-link span { font-size: 10.5px; }
}
