/* Prof IA MELEC — onglet « Différencier » */

/* Visibilité selon l'onglet actif (data-active-tab posé par prof_ia.js) */
#prof-ia-module .pia-outils-shell { display: none; }
#prof-ia-module[data-active-tab="outils"] .pia-outils-shell { display: block; }
#prof-ia-module[data-active-tab="outils"] #pia-standard-ui,
#prof-ia-module[data-active-tab="outils"] #pia-export-row,
#prof-ia-module[data-active-tab="outils"] #pia-topbar-meta > :not(#pia-access-badge):not(#pia-remaining-badge),
#prof-ia-module[data-active-tab="outils"] #pia-chatbox-shell,
#prof-ia-module[data-active-tab="outils"] #pia-document-shell,
#prof-ia-module[data-active-tab="outils"] #pia-correction-copie-shell,
#prof-ia-module[data-active-tab="outils"] #pia-composer { display: none !important; }

/* ---------- Formulaire ---------- */
#prof-ia-module .pia-outils-choices { display: grid; gap: 8px; margin: 14px 0 16px; }
#prof-ia-module .pia-outil-choice { display: block; cursor: pointer; }
#prof-ia-module .pia-outil-choice input { position: absolute; opacity: 0; pointer-events: none; }
#prof-ia-module .pia-outil-card {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1.5px solid var(--pia-border, #dbe7f3); border-radius: 14px; background: #fff;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
#prof-ia-module .pia-outil-choice:hover .pia-outil-card { border-color: #9cc0e6; }
#prof-ia-module .pia-outil-choice input:checked + .pia-outil-card {
    border-color: var(--pia-blue, #1565c0); background: #f1f7ff; box-shadow: 0 0 0 3px rgba(21, 101, 192, .12);
}
#prof-ia-module .pia-outil-choice input:focus-visible + .pia-outil-card { outline: 2px solid var(--pia-blue, #1565c0); outline-offset: 2px; }
#prof-ia-module .pia-outil-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
#prof-ia-module .pia-outil-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
#prof-ia-module .pia-outil-text strong { font-size: 14.5px; color: var(--pia-title, #0f4c81); }
#prof-ia-module .pia-outil-text small { font-size: 12.5px; color: var(--pia-text-soft, #64748b); line-height: 1.35; }
#prof-ia-module .pia-outil-cost {
    flex: 0 0 auto; font-size: 11.5px; font-weight: 700; color: #0f4c81;
    background: #e8f1fb; border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}
#prof-ia-module .pia-input {
    width: 100%; box-sizing: border-box; border: 1px solid #d5e2ef; border-radius: 14px;
    padding: 12px 14px; font-size: 15px; font-family: Arial, Helvetica, sans-serif; background: #fff; outline: none;
}
#prof-ia-module .pia-input:focus { border-color: var(--pia-blue, #1565c0); box-shadow: 0 0 0 3px rgba(21, 101, 192, .12); }
#prof-ia-module .pia-outils-link {
    margin-top: 6px; border: 0; background: none; color: var(--pia-blue, #1565c0);
    font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 0;
}
#prof-ia-module .pia-outils-link:hover { text-decoration: underline; }
#prof-ia-module .pia-status.pia-status-error { color: #b91c1c; font-weight: 600; }

/* ---------- Zone résultat ---------- */
#prof-ia-module .pia-outils-shell { padding: 6px 2px 10px; }
#prof-ia-module .pia-outils-empty { text-align: center; color: var(--pia-text-soft, #64748b); padding: 60px 20px; }
#prof-ia-module .pia-outils-empty strong { display: block; color: var(--pia-title, #0f4c81); font-size: 18px; margin: 8px 0 4px; }
#prof-ia-module .pia-outils-msg { padding: 24px; border-radius: 16px; background: #fff8e6; border: 1px solid #f5d48a; }
#prof-ia-module .pia-outils-msg p { margin: 8px 0 14px; }

#prof-ia-module .pia-outils-toolbar {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; position: sticky; top: 0; z-index: 2;
    background: rgba(255, 255, 255, .96); padding: 8px 0;
}
#prof-ia-module .po-tb-btn {
    border: 1px solid #c7d7ea; background: #fff; color: #0f4c81; border-radius: 999px;
    padding: 7px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
#prof-ia-module .po-tb-btn:hover { background: #f1f7ff; }
#prof-ia-module .po-tb-btn.po-locked { opacity: .6; }
#prof-ia-module .po-tb-btn.po-locked::after { content: " 🔒"; }
#prof-ia-module .po-tb-ghost { border-style: dashed; }

#prof-ia-module .po-doc { background: #fff; border: 1px solid var(--pia-border, #dbe7f3); border-radius: 18px; padding: 20px 22px; color: #1f2937; }
#prof-ia-module .po-head { margin-bottom: 14px; }
#prof-ia-module .po-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 700; }
#prof-ia-module .po-doc h2 { margin: 4px 0 0; color: #0f4c81; font-size: 1.45rem; }
#prof-ia-module .po-doc h3 { color: #0f4c81; margin: 0 0 8px; font-size: 1.08rem; }
#prof-ia-module .po-doc h4 { margin: 12px 0 6px; font-size: .98rem; color: #334155; }
#prof-ia-module .po-doc ul, #prof-ia-module .po-doc ol { margin: 4px 0 8px; padding-left: 22px; }
#prof-ia-module .po-doc li { margin: 3px 0; }
#prof-ia-module .po-pre { white-space: pre-wrap; }
#prof-ia-module .po-print-only { display: none; }
#prof-ia-module .po-mini-btn {
    border: 1px solid #c7d7ea; background: #fff; border-radius: 10px; padding: 5px 10px;
    font-size: 13px; font-weight: 600; color: #0f4c81; cursor: pointer;
}
#prof-ia-module .po-mini-btn.active { background: #0f4c81; color: #fff; border-color: #0f4c81; }
#prof-ia-module .po-teacher { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: #f8fafc; border: 1px dashed #94a3b8; }
#prof-ia-module .po-teacher summary { cursor: pointer; font-weight: 700; color: #0f4c81; }
#prof-ia-module .po-intro { background: #f7fbff; border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; }
#prof-ia-module .po-intro p { margin: 4px 0; }
#prof-ia-module .po-table { width: 100%; border-collapse: collapse; }
#prof-ia-module .po-table th, #prof-ia-module .po-table td { border: 1px solid #dbe3ee; padding: 7px 9px; text-align: left; vertical-align: top; }
#prof-ia-module .po-table th { background: #f1f7ff; }
#prof-ia-module .po-formula { font-family: "Cambria Math", Cambria, Georgia, serif; font-size: 1.05em; white-space: nowrap; }
#prof-ia-module .po-dl { margin: 0; display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px 14px; }
#prof-ia-module .po-dl dt { font-weight: 700; color: #0f4c81; }
#prof-ia-module .po-dl dd { margin: 0; }

/* ---------- Carte mentale ---------- */
#prof-ia-module .po-view-switch, #prof-ia-module .po-level-tabs {
    display: inline-flex; flex-wrap: wrap; gap: 4px; background: #eef4fb; padding: 4px; border-radius: 12px; margin-bottom: 12px;
}
#prof-ia-module .po-view-switch button, #prof-ia-module .po-level-tabs button {
    border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; color: #334155; cursor: pointer; font-size: 13.5px;
}
#prof-ia-module .po-view-switch button.active { background: #fff; color: #0f4c81; box-shadow: 0 1px 4px rgba(15, 76, 129, .15); }
#prof-ia-module .po-mindmap { overflow: auto; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; max-height: 75vh; }
#prof-ia-module .po-mindmap svg { display: block; width: 100%; min-width: 900px; height: auto; }
#prof-ia-module .po-outline ol > li { margin-bottom: 8px; }

/* ---------- Fiche mémo ---------- */
#prof-ia-module .po-memo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
#prof-ia-module .po-memo-box { border: 1px solid #e2e8f0; border-top: 5px solid var(--po-c, #1565c0); border-radius: 12px; padding: 12px 14px; background: #fff; }
#prof-ia-module .po-memo-box h3 { color: var(--po-c, #0f4c81); }
#prof-ia-module .po-memo-section { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; }
#prof-ia-module .po-warn { background: #fff7ed; border-color: #fed7aa; }
#prof-ia-module .po-flash-wrap { margin-top: 18px; }
#prof-ia-module .po-flash-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
#prof-ia-module .po-flash-head small { font-weight: 400; color: #64748b; font-size: 12.5px; }
#prof-ia-module .po-flash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
#prof-ia-module .po-flash { border: 0; padding: 0; background: none; perspective: 900px; cursor: pointer; min-height: 130px; font: inherit; text-align: center; }
#prof-ia-module .po-flash-inner { position: relative; display: block; width: 100%; height: 100%; min-height: 130px; transition: transform .45s; transform-style: preserve-3d; }
#prof-ia-module .po-flash.flipped .po-flash-inner { transform: rotateY(180deg); }
#prof-ia-module .po-flash-face {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column;
    padding: 14px; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-size: 14px; line-height: 1.35;
}
#prof-ia-module .po-front { background: linear-gradient(135deg, #1565c0, #0f4c81); color: #fff; font-weight: 600; }
#prof-ia-module .po-front em { font-style: normal; font-size: 11px; opacity: .75; margin-bottom: 6px; }
#prof-ia-module .po-back { background: #f0fdf4; border: 2px solid #86efac; color: #14532d; transform: rotateY(180deg); }

/* ---------- 3 niveaux ---------- */
#prof-ia-module .po-level-tabs button.active { background: #fff; color: var(--po-c, #0f4c81); box-shadow: 0 1px 4px rgba(15, 76, 129, .15); }
#prof-ia-module .po-level { display: none; border: 1px solid #e2e8f0; border-top: 6px solid var(--po-c); border-radius: 14px; padding: 14px 16px; }
#prof-ia-module .po-level.active { display: block; }
#prof-ia-module .po-levels.po-all { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
#prof-ia-module .po-level h3 { color: var(--po-c); }
#prof-ia-module .po-profil { font-size: 13px; color: #64748b; font-style: italic; margin: -2px 0 8px; }
#prof-ia-module .po-questions > li { margin-bottom: 10px; }
#prof-ia-module .po-questions p { margin: 0 0 4px; }
#prof-ia-module .po-aide { background: #fffbeb; border-radius: 8px; padding: 4px 10px; font-size: 14px; }
#prof-ia-module .po-aide summary { cursor: pointer; font-weight: 700; color: #92400e; }
#prof-ia-module .po-answer-lines { display: none; }

/* ---------- DYS / FALC ---------- */
#prof-ia-module .po-dys-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; color: #475569; }
#prof-ia-module .po-dys {
    font-family: Verdana, Tahoma, Arial, sans-serif; font-size: var(--po-dys-size, 19px);
    line-height: 1.8; letter-spacing: .03em; word-spacing: .12em; text-align: left;
    border-radius: 14px; padding: 4px 6px; transition: background .2s;
}
#prof-ia-module .po-dys.po-cream { background: #fdf6e3; }
#prof-ia-module .po-dys.po-alt-lines p:nth-child(even) { background: #eef6ff; }
#prof-ia-module .po-dys-section { margin-bottom: 18px; }
#prof-ia-module .po-dys h3 { font-size: 1.1em; display: flex; align-items: center; gap: 10px; }
#prof-ia-module .po-dys p { margin: 0 0 .6em; max-width: 62ch; }
#prof-ia-module .po-num {
    display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em;
    border-radius: 50%; background: #0f4c81; color: #fff; font-size: .8em; flex: 0 0 auto;
}
#prof-ia-module .po-key { background: #fff8e1; border-left: 6px solid #f59e0b; border-radius: 10px; padding: 8px 14px; margin-top: 8px; }
#prof-ia-module .po-dys-consignes ol > li { margin-bottom: .4em; }
#prof-ia-module .po-dys .po-dl { grid-template-columns: 1fr; }

/* ---------- Coups de pouce ---------- */
#prof-ia-module .po-cdp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
#prof-ia-module .po-cdp { border: 2px dashed #94a3b8; border-top: 8px solid var(--po-c); border-radius: 14px; padding: 12px 14px; background: #fff; }
#prof-ia-module .po-cdp-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--po-c); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
#prof-ia-module .po-cdp-num {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
    background: var(--po-c); color: #fff; font-size: 14px;
}
#prof-ia-module .po-cdp h3 { color: #1f2937; font-size: 1rem; }

@media (max-width: 640px) {
    #prof-ia-module .po-doc { padding: 14px; border-radius: 14px; }
    #prof-ia-module .po-dl { grid-template-columns: 1fr; }
    #prof-ia-module .po-dys { --po-dys-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
    #prof-ia-module .po-flash-inner { transition: none; }
}

/* Prof IA : liens vers les pages professeur */
#prof-ia-module .pia-prof-links {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 12px 16px;
    border-radius: 16px; background: #f1f7ff; border: 1px solid #c7d7ea; font-size: 14px; color: #334155;
}
#prof-ia-module .pia-prof-link {
    text-decoration: none; font-weight: 700; color: #fff; background: #0f4c81; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
}
#prof-ia-module .pia-prof-link:hover { background: #1565c0; }
