/* ==========================================================================
   MIRIADE Wild — Assistance pédagogique (pedagogie.css)
   ========================================================================== */
.peda-topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.peda-topbar .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lvl-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.peda-search { position: relative; flex: 1; min-width: 220px; }
.peda-search::before { content: '🔍'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: .85rem; opacity: .6; }
.peda-search input { width: 100%; padding: 9px 12px 9px 36px; border: 1.5px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: .9rem; }
.peda-search input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.who-banner { background: var(--primary-soft); color: var(--primary-ink); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); border-radius: var(--r-lg); padding: 12px 16px; font-size: .92rem; margin-bottom: 22px; }

.peda-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.peda-nav { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow-1); }
.peda-nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 500; transition: background var(--t-fast), color var(--t-fast); }
.peda-nav-link span { width: 22px; text-align: center; }
.peda-nav-link:hover { background: var(--surface-3); color: var(--ink); }
.peda-nav-link.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.peda-main { min-width: 0; }

.peda-hero { margin-bottom: 26px; }
.peda-hero h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 3.6vw, 2.7rem); letter-spacing: -.02em; margin: 12px 0 12px; }
.peda-hero h1 em { font-style: italic; font-weight: 500; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.peda-hero p { color: var(--ink-2); font-size: 1.05rem; max-width: 70ch; }
.peda-h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.015em; margin-bottom: 12px; }
.peda-h2 { font-family: var(--font-display); font-size: 1.35rem; margin: 30px 0 14px; letter-spacing: -.01em; }
.peda-h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 22px 0 10px; }
.peda-lead { color: var(--ink-2); font-size: 1rem; line-height: 1.7; max-width: 80ch; margin-bottom: 16px; }
.peda-note { background: var(--warn-soft); color: var(--accent-ink); border-radius: var(--r); padding: 10px 14px; font-size: .88rem; margin: 10px 0 16px; }
.peda-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; }
a.ref { color: var(--primary-ink); text-decoration: none; border-bottom: 1px dotted var(--primary); font-size: .92em; }
a.ref:hover { background: var(--primary-soft); }

.peda-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 8px; }
.peda-step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 18px 16px; box-shadow: var(--shadow-1); }
.peda-step .n { position: absolute; top: -12px; left: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--grad-primary); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.peda-step h3 { font-size: 1.05rem; margin: 6px 0 6px; }
.peda-step p { color: var(--ink-2); font-size: .9rem; margin-bottom: 12px; }

.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.who-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.who-card.current { border-color: var(--primary); box-shadow: var(--ring); }
.who-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.who-head small { display: block; color: var(--ink-3); font-size: .78rem; }
.who-icon { font-size: 1.5rem; }
.who-card p { font-size: .86rem; color: var(--ink-2); }

.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.entry-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; text-decoration: none; color: var(--ink); transition: transform var(--t-fast), box-shadow var(--t-fast); }
.entry-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); border-color: var(--primary); }
.entry-icon { font-size: 1.6rem; }
.entry-card p { color: var(--ink-2); font-size: .86rem; }

.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.rule-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.rule-icon { font-size: 1.5rem; }
.rule-card h3 { font-size: 1rem; margin: 6px 0; }
.rule-card p { color: var(--ink-2); font-size: .9rem; line-height: 1.6; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.peda-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.peda-table th, .peda-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.peda-table thead th { background: var(--surface-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.peda-table tr.current td { background: var(--primary-soft); }
.peda-table tr:last-child td { border-bottom: 0; }

.checklist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 12px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .92rem; }
.check-item:last-of-type { border-bottom: 0; }
.check-item input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.check-item.done span { color: var(--ink-3); text-decoration: line-through; }
.check-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 6px 4px; font-size: .88rem; color: var(--ink-2); }

.comp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.comp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.comp-card b { display: block; margin-bottom: 4px; }
.comp-card p { font-size: .88rem; color: var(--ink-2); margin-bottom: 6px; }
.comp-card small { color: var(--ink-3); }

.stages { display: grid; gap: 16px; }
.stage-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px; box-shadow: var(--shadow-1); }
.stage-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stage-icon { font-size: 1.8rem; }
.stage-card h3 { font-family: var(--font-display); font-size: 1.25rem; }
.stage-card header small { color: var(--ink-3); }
.stage-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stage-card h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 6px; }
.stage-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: .9rem; display: grid; gap: 4px; }
.stage-foot { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.stage-foot p { font-size: .9rem; color: var(--ink-2); }
.stage-foot .avoid { background: var(--danger-soft); border-radius: var(--r); padding: 10px 12px; }
.stage-foot .avoid h4 { color: var(--danger); }

.practice-list { display: grid; gap: 10px; }
.practice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--r); padding: 12px 16px; }
.practice b { display: block; margin-bottom: 4px; }
.practice p { font-size: .9rem; color: var(--ink-2); }

.bank { display: grid; gap: 12px; }
.bank-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.bank-card h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 10px; }
.bank-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bank-card h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 6px; }
.bank-card ul { margin: 0; padding-left: 18px; font-size: .9rem; color: var(--ink-2); display: grid; gap: 4px; }
.theme-link { color: var(--primary-ink); text-decoration: none; font-weight: 500; }
.theme-link:hover { text-decoration: underline; }

.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.lvl { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--r-pill); font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.lvl-mat { background: #fde68a; color: #78350f; } .lvl-c2 { background: #bbf7d0; color: #14532d; } .lvl-c3 { background: #bfdbfe; color: #1e3a8a; } .lvl-c4 { background: #ddd6fe; color: #4c1d95; } .lvl-lyc { background: #fbcfe8; color: #831843; }
[data-theme="dark"] .lvl-mat { background: #3a2d10; color: #fde68a; } [data-theme="dark"] .lvl-c2 { background: #0f2e1c; color: #bbf7d0; } [data-theme="dark"] .lvl-c3 { background: #172554; color: #bfdbfe; } [data-theme="dark"] .lvl-c4 { background: #2e1065; color: #ddd6fe; } [data-theme="dark"] .lvl-lyc { background: #500724; color: #fbcfe8; }

.deck-grid, .print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.deck-card, .print-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-1); }
.deck-head, .print-head { display: flex; gap: 12px; align-items: center; }
.deck-icon, .print-icon { font-size: 1.7rem; }
.deck-card h3, .print-card h3 { font-size: 1.02rem; }
.deck-head small, .print-head small { color: var(--ink-3); font-size: .78rem; }
.deck-card p, .print-card p { color: var(--ink-2); font-size: .88rem; flex: 1; }
.deck-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.slide-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.slide-jump { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; display: grid; gap: 2px; }
.slide-jump:hover { border-color: var(--primary); }
.slide-jump b { font-size: .86rem; } .slide-jump span { font-size: .76rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.seq-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-1); scroll-margin-top: calc(var(--header-h) + 16px); }
.ref-item, .peda-h1, .seance { scroll-margin-top: calc(var(--header-h) + 16px); }
.seq-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.seq-head h2 { font-family: var(--font-display); font-size: 1.45rem; margin: 6px 0 4px; letter-spacing: -.01em; }
.seq-head p { color: var(--ink-2); }
.seq-meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; color: var(--ink-2); font-size: .88rem; }
.seq-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.seq-body { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.seq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.seq-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.seq-block h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.seq-block ul { margin: 0; padding-left: 18px; font-size: .88rem; color: var(--ink-2); display: grid; gap: 4px; }
.seq-block p { font-size: .88rem; color: var(--ink-2); }
.seq-block.charte-block { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.seq-block.charte-block p { color: var(--primary-ink); }
.seance { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; background: var(--surface); }
.seance-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.seance-n { width: 32px; height: 32px; border-radius: 50%; background: var(--grad-primary); color: #fff; font-weight: 700; display: grid; place-items: center; }
.seance-head h4 { font-size: 1.05rem; }
.seance-head small { color: var(--ink-3); }
.phases { width: 100%; border-collapse: collapse; font-size: .88rem; }
.phases td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.phases .ph-name { font-weight: 600; color: var(--ink); white-space: nowrap; width: 110px; }
.phases .ph-min { white-space: nowrap; color: var(--primary-ink); font-weight: 600; width: 60px; }
.seance-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: .86rem; }
.seance-foot b { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 3px; }
.seance-foot p { color: var(--ink-2); }
.link-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.refs { line-height: 1.9; }

.fiche-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.fiche-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 18px; display: grid; gap: 12px; }
.fiche-row { display: grid; gap: 6px; }
.fiche-row label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.fiche-row input, .fiche-row textarea, .fiche-row select { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); color: var(--ink); font-size: .9rem; }
.fiche-row input:focus, .fiche-row textarea:focus, .fiche-row select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.fiche-row .inline { display: flex; gap: 8px; }
.fiche-row .inline select { flex: 1; }
.fiche-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comp-checks { display: grid; gap: 4px; margin-bottom: 6px; }
.comp-check { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--ink-2); }
.comp-check input { accent-color: var(--primary); margin-top: 3px; }
.phases-edit { display: grid; gap: 6px; }
.phase-row { display: grid; grid-template-columns: 120px 64px 1fr auto; gap: 6px; }
.fiche-buttons { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.fiche-saved { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; font-size: .88rem; }
.saved-row { display: flex; align-items: center; gap: 8px; }
.saved-row span { flex: 1; } .saved-row small { color: var(--ink-3); }
.fiche-preview { position: sticky; top: calc(var(--header-h) + 16px); }
.preview-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 6px; }
.sheet { background: #fff; color: #1c1a33; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-2); font-family: Arial, Helvetica, sans-serif; font-size: .82rem; max-height: calc(100vh - 140px); overflow: auto; }
.sheet .fiche-print .head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid #4f46e5; padding-bottom: 8px; margin-bottom: 10px; }
.sheet .fiche-print h1 { font-size: 1.2rem; margin: 4px 0; }
.sheet .fiche-print .meta span { display: inline-block; margin-right: 12px; }
.sheet .fiche-print .row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; border-bottom: 1px solid #e7e1d6; padding: 6px 0; }
.sheet .fiche-print .row b { color: #4e4c66; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.sheet .fiche-print .pre { white-space: pre-wrap; }
.sheet .pr-table { width: 100%; border-collapse: collapse; }
.sheet .pr-table th, .sheet .pr-table td { border: 1px solid #1c1a33; padding: 5px; text-align: left; vertical-align: top; }
.sheet .pr-table thead th { background: #ebe9fd; }
.sheet .pr-kicker { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: #6b6a85; }
.sheet .bilan { border: 1px solid #1c1a33; border-radius: 6px; min-height: 60px; padding: 6px; margin-top: 10px; }

.preview-body { padding: 0; height: 75vh; }
.preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }

.faq { display: grid; gap: 8px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 16px; }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 10px 0; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq-item summary::after { content: '+'; color: var(--primary); font-size: 1.2rem; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { color: var(--ink-2); font-size: .92rem; padding-bottom: 12px; line-height: 1.65; }

.ref-list { padding-left: 0; list-style: none; display: grid; gap: 6px; }
.ref-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; font-size: .88rem; color: var(--ink-2); line-height: 1.55; }
.ref-item i { color: var(--ink); }
.ref-key { display: inline-block; font-weight: 700; color: var(--primary-ink); margin-right: 6px; }
.ref-item.flash { animation: flash 2s ease; }
@keyframes flash { 0%, 60% { background: var(--primary-soft); border-color: var(--primary); } 100% { background: var(--surface); } }

/* Présentateur de diapos */
.deck { position: fixed; inset: 0; z-index: 5000; display: none; flex-direction: column; background: radial-gradient(1200px 700px at 30% 0%, #312e81, #0b0a16 60%); color: #fff; }
.deck.show { display: flex; animation: fadeIn .25s ease; }
.deck-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.deck-title { font-family: var(--font-display); font-size: 1rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-tools { display: flex; gap: 8px; }
.deck-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 0 clamp(20px, 6vw, 90px); align-items: center; }
.deck.with-notes .deck-stage { grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); }
.deck-slide { cursor: pointer; max-height: calc(100vh - 170px); overflow: auto; animation: fadeUp .35s var(--ease); }
.deck-slide h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 3.2rem); letter-spacing: -.02em; margin-bottom: 22px; color: #fff; line-height: 1.1; }
.deck-slide ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 14px; }
.deck-slide li { font-size: clamp(1.15rem, 2.2vw, 1.75rem); line-height: 1.45; padding-left: 30px; position: relative; color: rgba(255, 255, 255, .92); }
.deck-slide li::before { content: ''; position: absolute; left: 0; top: .6em; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.deck-svg { width: 100%; max-width: 760px; height: auto; margin: 0 0 18px; }
.deck-notes { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); border-radius: 16px; padding: 18px; max-height: calc(100vh - 170px); overflow: auto; font-size: 1rem; line-height: 1.6; color: rgba(255, 255, 255, .9); }
.deck-notes b { display: block; margin-bottom: 8px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.deck-notes a.ref { color: #fde68a; border-bottom-color: #fde68a; }
.deck-bottom { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 20px 20px; }

@media (max-width: 960px) {
    .peda-layout { grid-template-columns: 1fr; }
    .peda-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .peda-nav-link { font-size: .82rem; padding: 7px 10px; }
    .fiche-layout { grid-template-columns: 1fr; }
    .fiche-preview { position: static; }
    .stage-cols, .stage-foot, .bank-cols, .seance-foot, .fiche-grid { grid-template-columns: 1fr; }
    .phase-row { grid-template-columns: 1fr 64px auto; }
    .phase-row .ph-desc { grid-column: 1 / -1; }
    .deck.with-notes .deck-stage { grid-template-columns: 1fr; }
    .deck-notes { max-height: 30vh; }
}
