/* Thème additif MrJam.Carnet. Les styles de contrôle restent dans le paquet partagé. */
:root { color-scheme: light; font-size: 16px; --prune: #623451; --encre: #30282f; --papier: #faf7f1; --ligne: #e0d7cf; }
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; min-height: 100%; }
body { background: var(--papier); }
.theme-carnet { min-height: 100dvh; height: auto !important; max-width: 100%; }
.theme-carnet input, .theme-carnet textarea, .theme-carnet select { font: inherit; line-height: 1.55; }
.theme-carnet input, .theme-carnet textarea { font-size: 1rem !important; }
.theme-carnet textarea { resize: vertical !important; }
.theme-carnet button { min-width: 44px; min-height: 44px; }
.theme-carnet button, .theme-carnet select { cursor: pointer; }
.theme-carnet button > *, .theme-carnet label { max-width: 100%; }
.theme-carnet a, .theme-carnet button, .theme-carnet input, .theme-carnet textarea, .theme-carnet select { -webkit-tap-highlight-color: transparent; }
.theme-carnet :focus-visible { outline: 3px solid #623451 !important; outline-offset: 4px; }
.theme-carnet .carnet-texte { font-size: 1.0625rem; line-height: 1.6 !important; white-space: pre-line; overflow-wrap: anywhere; }
.theme-carnet .carnet-petit { font-size: .875rem; line-height: 1.6 !important; white-space: pre-line; overflow-wrap: anywhere; }
.theme-carnet .carnet-surtitre { font-size: .8125rem; line-height: 1.5; }
.theme-carnet .carnet-titre { font-size: clamp(2.1rem, 4.4vw, 2.875rem); line-height: 1.18 !important; letter-spacing: -.02em; }
.theme-carnet .carnet-soustitre { font-size: 1.65rem; line-height: 1.28 !important; letter-spacing: -.012em; }
.theme-carnet .carnet-bouton, .theme-carnet .carnet-onglet { line-height: 1.35 !important; font-size: 1rem; }
.theme-carnet .carnet-nav-item > * { width: 100% !important; text-align: left !important; }
.theme-carnet .carnet-sidebar { position: sticky; top: 0; min-height: calc(100dvh - 34px); max-width: 276px; }
.theme-carnet .carnet-couverture { box-shadow: -8px 0 0 #4d263d, 7px 5px 0 #e4dbcf, 11px 9px 0 #f2ece3, 12px 14px 35px #30282f18; border-left: 1px solid #ffffff44; min-height: 385px; }
.theme-carnet .chapter-footer { border-radius: 0 0 12px 12px; }
.theme-carnet .current-chapter { box-shadow: 0 6px 20px #30282f05; }
.carnet-select { display: grid; gap: 8px; width: 100%; color: #30282f; font: inherit; }
.carnet-select > span { font-size: .9375rem; font-weight: 600; line-height: 1.5; }
.carnet-select select { width: 100%; min-width: 0; min-height: 48px; padding: 11px; border: 1px solid #e0d7cf; border-radius: 8px; background: #fffffd; color: #30282f; font-size: 1rem !important; }
.carnet-checkbox { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0; cursor: pointer; line-height: 1.5; font-size: 1rem; }
.carnet-checkbox input { width: 22px; height: 22px; flex: 0 0 22px; accent-color: #623451; }
.theme-carnet .landscape-zone { border: 1px solid transparent; }
.theme-carnet .zone-coeur { background: #efe0e9; border-color: #d5b7c9; }
.theme-carnet .zone-autour { background: #e6eee5; border-color: #c6d7c4; }
.theme-carnet .zone-horizon { background: #f2e9d7; border-color: #dfd0b3; }
.theme-carnet .zone-explorer { background: #e7eaf1; border-color: #cdd2df; }
.theme-carnet .zone-limites { background: #f5e4df; border-color: #dfc1b8; }
.theme-carnet .landscape-zone .carnet-soustitre { font-size: 1.18rem; letter-spacing: 0; }
.theme-carnet .landscape-zone .carnet-onglet { white-space: normal; width: 100% !important; background: #ffffffd9; box-shadow: 0 2px 3px #30282f06; }
.theme-carnet .secret-code { overflow-wrap: anywhere; word-break: break-all; line-height: 1.6; }
.theme-carnet .save-status { width: auto !important; flex: 1 1 180px !important; }
.theme-carnet .skip-link { position: absolute !important; left: 10px; top: -90px; z-index: 200; background: white; color: #623451; padding: 14px; border: 2px solid #623451; }
.theme-carnet .skip-link:focus { top: 10px; }
.theme-carnet .carnet-panneau { transition: border-color .15s ease; }
/* Un onglet change de feuille. Une capsule se déploie dans le flux de la sienne. */
.theme-carnet .classeur, .theme-carnet .classeur-papier, .theme-carnet .classeur-feuilles, .theme-carnet .feuille-parcours, .theme-carnet .capsule { flex: 0 0 auto !important; height: auto !important; min-height: auto !important; min-width: 0; }
.theme-carnet .classeur-navigation { position: sticky !important; top: var(--hauteur-bandeau, 73px); z-index: 40; flex: 0 0 auto !important; height: auto !important; background: var(--papier); padding-top: 9px; }
.theme-carnet .classeur-onglets { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 0; width: 100%; padding: 0; border-bottom: 1px solid #bda9b5; }
.theme-carnet .classeur-onglet { position: relative; flex: 1 1 0; min-width: 0; min-height: 54px; margin-bottom: -1px; padding: 14px 12px; border: 1px solid #bda9b5; border-radius: 12px 12px 0 0; color: var(--prune); background: #eee5ea; font: inherit; font-size: 1rem; line-height: 1.35; cursor: pointer; white-space: nowrap; }
.theme-carnet .classeur-onglet + .classeur-onglet { margin-left: -1px; }
.theme-carnet .classeur-onglet[aria-selected="true"] { z-index: 2; background: #fffffd; border-bottom-color: #fffffd; font-weight: 700; }
.theme-carnet .classeur-onglet[aria-selected="true"]::before { content: ""; position: absolute; top: -1px; left: 12px; right: 12px; height: 3px; background: var(--prune); border-radius: 2px; }
.theme-carnet .onglet-court { display: none; }
.theme-carnet .classeur-papier { background: #fffffd; border: 1px solid #bda9b5; border-top: 0; border-radius: 0 0 8px 8px; box-shadow: 4px 5px 0 #eee5dc, 7px 8px 0 #f7f0e8; }
.theme-carnet .carnet-annexe { background: #fffffd; border: 1px solid var(--ligne); border-radius: 12px; }
.theme-carnet .classeur-feuilles { position: relative; width: 100%; overflow: hidden; isolation: isolate; }
.theme-carnet .classeur-feuille { min-width: 0; width: 100%; background: #fffffd; }
.theme-carnet .classeur-feuille[data-active="true"] { position: relative; z-index: 1; }
.theme-carnet .classeur-feuille[data-active="false"] { position: absolute; top: 0; left: 0; pointer-events: none; }
.theme-carnet .classeur-feuilles[data-moving="false"] > .classeur-feuille[data-active="false"] { display: none !important; }
.theme-carnet .classeur-feuilles[data-moving="true"] > .classeur-feuille { will-change: opacity; }
.theme-carnet .capsule { border: 1px solid var(--ligne); border-radius: 20px; background: var(--papier); overflow: hidden; }
.theme-carnet .capsule[data-open="true"] { border: 1px solid #a67c95; background: #fffffd; }
.theme-carnet .capsule[data-nature="bilan"] { border-left: 4px solid #a5b9a3; }
.theme-carnet .capsule-entete { position: relative; padding-right: 48px !important; }
.theme-carnet .capsule-entete > .s.r, .theme-carnet .capsule-entete > .s.r > .s.c { position: static !important; }
.theme-carnet .capsule-entete:hover { background: #f4edf1; }
.theme-carnet .capsule-titre { position: static !important; margin: 0; font-family: Georgia, serif; line-height: 1.3 !important; letter-spacing: -.012em; overflow-wrap: anywhere; scroll-margin-top: 90px; }
.theme-carnet .capsule-ouvrir { position: static; display: block; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; color: inherit; background: transparent; text-align: left; font: inherit; line-height: inherit; white-space: normal; overflow-wrap: anywhere; }
.theme-carnet .capsule-ouvrir::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.theme-carnet .capsule-ouvrir::before { content: ""; position: absolute; right: 22px; top: 30px; width: 9px; height: 9px; border-right: 2px solid var(--prune); border-bottom: 2px solid var(--prune); transform: rotate(45deg); }
.theme-carnet .capsule-ouvrir[aria-expanded="true"]::before { transform: rotate(225deg); }
.theme-carnet .capsule-ouvrir:focus-visible { outline: none !important; }
.theme-carnet .capsule-ouvrir:focus-visible::after { outline: 3px solid var(--prune); outline-offset: -4px; }
.theme-carnet .capsule-corps { display: grid !important; grid-template-columns: minmax(0, 1fr); flex: 0 0 auto !important; height: auto !important; min-height: 0 !important; width: 100%; overflow: hidden; }
.theme-carnet .capsule-interieur { height: auto !important; min-height: 0 !important; min-width: 0; overflow: hidden; align-self: stretch !important; }
.theme-carnet .capsule-zoom { transform-origin: center top; height: auto !important; min-height: 0; }
.theme-carnet .capsule-corps[inert]:not([data-moving="true"]) .capsule-interieur { visibility: hidden; }
.theme-carnet .marque-carnet { padding: 0; text-align: left; }
.theme-carnet .compte-zone { position: relative; z-index: 60; }
.theme-carnet .compte-commande { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #bda9b5; border-radius: 50%; color: var(--prune); background: #eee5ea; }
.theme-carnet .compte-commande[aria-expanded="true"] { background: #eee5ea; border-color: #bda9b5; }
.theme-carnet .compte-options { position: absolute !important; right: 0; top: calc(100% + 8px); max-width: calc(100vw - 32px); background: #fffffd; border: 1px solid #bda9b5; border-radius: 14px; box-shadow: 0 12px 32px #30282f20; }
.theme-carnet .compte-options > .carnet-bouton { width: 100%; text-align: left; z-index: 2; }
.theme-carnet .compte-fond { position: fixed; inset: 0; z-index: -1; width: 100vw; height: 100vh; padding: 0; border: 0; background: transparent; cursor: default; }
html[data-sober="true"] .classeur-papier { box-shadow: none; }
html[data-sober="true"] .classeur-onglet { background: #fff; }
html[data-sober="true"] .capsule { background: #fff; border-radius: 4px; }
@media (max-width: 620px) {
  .theme-carnet .classeur-onglet { padding: 12px 5px; font-size: .9375rem; min-height: 48px; }
  .theme-carnet .onglet-complet { display: none; }
  .theme-carnet .onglet-court { display: inline; }
  .theme-carnet .marque-carnet > .s.r { gap: 8px; }
}
/* ElmUI shrink utilise flex-basis:0 ; les fenêtres avec overflow et les grilles
   ont besoin de leur hauteur intrinsèque, aussi sur WebKit/Firefox. */
.theme-carnet .continuite-fenetre { flex: 0 0 auto !important; height: auto !important; min-height: auto !important; position: relative; width: 100%; min-width: 0; overflow: hidden; isolation: isolate; }
.theme-carnet .continuite-panneau { width: 100%; min-width: 0; }
.theme-carnet .continuite-panneau[data-active="true"] { z-index: 1; background: var(--papier); }
.theme-carnet .continuite-panneau[data-active="false"] { position: absolute; top: 0; left: 0; pointer-events: none; }
.theme-carnet .continuite-fenetre[data-moving="false"] > .continuite-panneau[data-active="false"] { display: none !important; }
.theme-carnet .continuite-fenetre[data-moving="true"] > .continuite-panneau { will-change: translate; }
.theme-carnet [data-swipe-moment] { touch-action: pan-y pinch-zoom; }
.theme-carnet .continuite-fenetre[data-glissement="true"] > .continuite-panneau[data-active="false"] { display: flex !important; }
.theme-carnet .plan-grille { flex: 0 0 auto !important; height: auto !important; min-height: auto !important; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, 1fr); gap: 0; align-items: stretch; position: relative; overflow: hidden; border: 1px solid var(--ligne); border-radius: 12px; }
.theme-carnet .plan-case { height: auto !important; align-self: stretch !important; width: 100% !important; padding: 10px 8px; min-height: 108px !important; border-bottom: 1px solid var(--ligne); }
.theme-carnet .plan-case .carnet-petit { font-size: .76rem; line-height: 1.45 !important; }
.theme-carnet .plan-case .carnet-onglet { padding: 8px 6px !important; font-size: .86rem; width: 100% !important; border-color: transparent !important; background: transparent !important; }
.theme-carnet .plan-case .carnet-onglet[aria-pressed="true"] { font-weight: 700; }
.theme-carnet .plan-repere { pointer-events: none; position: absolute; left: 0; top: 0; width: 50%; height: 33.333333%; border-radius: 10px; background: #efe1e9; box-shadow: inset 0 0 0 2px var(--prune); }
.theme-carnet .plan-branche { border-left: 2px solid var(--prune); }
.theme-carnet .continuite-ruban { width: 100%; height: 3px; background: var(--ligne); overflow: hidden; }
.theme-carnet .continuite-ruban-repere { height: 3px; background: var(--prune); }
.theme-carnet .moments-ligne { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; width: 100%; }
.theme-carnet .moment-onglet { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 48px; margin: 0; padding: 8px 4px; border: 0; border-radius: 0; color: var(--encre); background: transparent; font: inherit; font-size: 1rem; line-height: 1.5; }
.theme-carnet .moment-onglet[aria-selected="true"] { color: var(--prune); font-weight: 700; }
.theme-carnet .moment-onglet:hover { color: var(--prune); }
.theme-carnet .carnet-onglet > .s.p, .theme-carnet .carnet-bouton > .s.p { width: 100% !important; min-width: 0; max-width: 100%; }
.theme-carnet .carnet-onglet .s.t, .theme-carnet .carnet-bouton .s.t { white-space: normal !important; display: inline; overflow-wrap: anywhere; }
.theme-carnet .moments-navigation .carnet-petit { font-size: .82rem; }
.theme-carnet .carnet-chemin .carnet-petit { width: auto !important; flex-grow: 0 !important; flex-basis: auto !important; }
.theme-carnet .sommaire-grid { flex: 0 0 auto !important; height: auto !important; min-height: auto !important; display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: stretch !important; }
.theme-carnet .sommaire-grid > .carnet-panneau { width: 100% !important; height: 100% !important; justify-content: flex-start; }
.theme-carnet .sommaire-grid .carnet-soustitre { font-size: 1.45rem; }
html[data-sober="true"] .plan-repere { background: #fff; }
html[data-sober="true"] .plan-grille { border-radius: 3px; }
html[data-sober="true"] .continuite-panneau[data-active="true"] { background: #fff; }
html[data-motion="off"] .continuite-panneau { will-change: auto !important; }
html[data-large="true"] { font-size: 20px; }
html[data-sober="true"] .theme-carnet { background: #fff !important; }
html[data-sober="true"] .carnet-couverture, html[data-sober="true"] .current-chapter { box-shadow: none !important; }
html[data-sober="true"] .landscape-zone { background: #fff !important; border-color: #b6abb3 !important; }
html[data-sober="true"] .carnet-panneau { border-radius: 3px !important; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .continuite-panneau { will-change: auto !important; }
}
@media (min-width: 601px) and (max-width: 1049px) {
  .theme-carnet .plan-case { min-height: 88px !important; }
}
@media (max-width: 600px) {
  .theme-carnet .plan-case { min-height: 86px !important; padding: 6px 10px; }
  .theme-carnet .plan-case .carnet-petit { font-size: .75rem; }
  .theme-carnet .carnet-panneau { padding: 20px !important; }
  .theme-carnet .carnet-couverture { padding: 28px !important; min-height: 310px; }
  .theme-carnet .carnet-couverture p { font-size: 2rem !important; }
  .theme-carnet .carnet-soustitre { font-size: 1.45rem; }
  .theme-carnet .prototype-banner p { font-size: .75rem; }
}
@media print {
  .prototype-banner { display: none !important; }
}

/* Le bandeau reste accessible ; son contour n'ajoute aucune ligne de statut. */
.theme-carnet .bandeau-carnet { position: sticky !important; top: 0; z-index: 70; flex: 0 0 auto !important; height: auto !important; }
.theme-carnet .programme-nom { margin: 0; font-size: 1.25rem; line-height: 1.3 !important; white-space: normal; }
.theme-carnet .statut-discret { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.theme-carnet .compte-avatar { position: relative; display: block; width: 24px; height: 27px; }
.theme-carnet .compte-avatar::before { content: ""; position: absolute; left: 8px; top: 2px; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; }
.theme-carnet .compte-avatar::after { content: ""; position: absolute; left: 3px; bottom: 1px; width: 19px; height: 11px; border: 1.5px solid currentColor; border-radius: 10px 10px 5px 5px; }
.theme-carnet .explication-classeur { position: absolute !important; top: 100%; left: 0; max-height: 75dvh; overflow: auto; background: #fffffd; border-bottom: 1px solid var(--ligne); box-shadow: 0 12px 32px #30282f20; }
html[data-ancrage="true"], html[data-ancrage="true"] * { overflow-anchor: none !important; }
/* Une réserve de papier, uniquement si la fin de la feuille borne le scroll. */
.theme-carnet .ancrage-reserve { flex: 0 0 auto !important; width: 100%; height: var(--reserve-carnet, 0px) !important; min-height: var(--reserve-carnet, 0px) !important; }

.capsule-indisponible { opacity: .55; filter: grayscale(1); }

.support-cours, .sondage { max-width: 55rem; margin: 2rem auto; padding: 1.5rem; line-height: 1.7; }
.sondage button,.sondage input,.sondage textarea { display: block; margin: .8rem 0; padding: .7rem; max-width: 100%; }
.sondage canvas,.sondage video { max-width:100%; }
@media print { .support-cours a { display:none; } }
