/* Panneau lateral, menu et cartes des artifacts (style Claude). */
:root { --ap-w: min(46vw, 620px); }
.artifact-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: var(--ap-w); display: flex; flex-direction: column;
  background: var(--surface, #ffffff); color: var(--ink, #1f1e1d);
  border-left: 1px solid var(--line, #e6e3da);
  box-shadow: -12px 0 40px rgba(31, 30, 29, .06);
  font-family: Figtree, system-ui, sans-serif;
}
.artifact-panel[hidden] { display: none; }
.app.artifact-open .main { margin-right: var(--ap-w); }
.ap-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line, #e6e3da); }
.ap-title { min-width: 0; flex: 1; }
.ap-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.ap-title small { color: var(--muted, #6b6a66); font-size: 12px; }
.ap-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ap-ver { font-size: 12px; color: var(--muted, #6b6a66); min-width: 34px; text-align: center; }
.ap-body { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.ap-frame { display: block; width: 100%; height: 100%; border: 0; background: transparent; visibility: hidden; }
.ap-frame.ready { visibility: visible; }
.ap-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted, #6b6a66); font-size: 14px; }
.ap-spin { width: 18px; height: 18px; border: 2px solid var(--line, #e6e3da); border-top-color: var(--ink, #1f1e1d); border-radius: 50%; animation: ap-spin .8s linear infinite; }
@keyframes ap-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ap-spin { animation-duration: 3s; } }
.ap-code { margin: 0; height: 100%; box-sizing: border-box; padding: 16px; overflow: auto; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre; }

/* Bouton et menu "Artefacts (n)" */
.ap-menu-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; border: 1px solid var(--line, #e6e3da); background: var(--surface, #ffffff); color: inherit; border-radius: 8px; padding: 5px 10px; font: 600 13px Figtree, system-ui, sans-serif; cursor: pointer; vertical-align: middle; }
.ap-menu-btn[hidden], .ap-menu[hidden] { display: none; }
.ap-menu { position: fixed; z-index: 60; width: 300px; max-height: 60vh; overflow: auto; box-sizing: border-box; padding: 6px; background: var(--surface, #ffffff); color: var(--ink, #1f1e1d); border: 1px solid var(--line, #e6e3da); border-radius: 12px; box-shadow: 0 12px 32px rgba(31, 30, 29, .14); font-family: Figtree, system-ui, sans-serif; }
.ap-menu-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: inherit; font: 14px Figtree, system-ui, sans-serif; }
.ap-menu-item:hover { background: var(--hover, #f5f3ee); }
.ap-menu-item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-menu-item small, .ap-menu-empty { color: var(--muted, #6b6a66); font-size: 12px; }
.ap-menu-empty { padding: 10px; }

/* Carte d'artifact (sous les messages et sur l'accueil) */
.ap-card { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 460px; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line, #e6e3da); border-radius: 14px; background: var(--surface, #ffffff); color: inherit; cursor: pointer; font: inherit; text-align: left; box-sizing: border-box; }
.ap-card:hover { background: var(--hover, #f5f3ee); }
.ap-card-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #f0ece3; color: #1f1e1d; }
.ap-card-txt { min-width: 0; display: flex; flex-direction: column; }
.ap-card-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-card-sub { font-size: 12px; color: var(--muted, #6b6a66); }

/* Themes sombres */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .artifact-panel, :root:not([data-theme="light"]) .ap-menu, :root:not([data-theme="light"]) .ap-menu-btn, :root:not([data-theme="light"]) .ap-card { --surface: #1e1d1b; --ink: #f5f3ee; --line: #34322e; --muted: #a3a09a; --hover: #2a2927; }
  :root:not([data-theme="light"]) .ap-card-ico { background: #2a2927; color: #f5f3ee; }
}
:root[data-theme="dark"] .artifact-panel, :root[data-theme="dark"] .ap-menu, :root[data-theme="dark"] .ap-menu-btn, :root[data-theme="dark"] .ap-card { --surface: #1e1d1b; --ink: #f5f3ee; --line: #34322e; --muted: #a3a09a; --hover: #2a2927; }
:root[data-theme="dark"] .ap-card-ico { background: #2a2927; color: #f5f3ee; }

@media (max-width: 860px) {
  :root { --ap-w: 100vw; }
  .app.artifact-open .main { display: none; }
}

/* Section "Artefacts recents" sur l'accueil du chat */
.home-artifacts { width: 100%; max-width: 760px; margin: 28px auto 0; }
.home-artifacts h3 { font: 600 14px Figtree, system-ui, sans-serif; color: var(--muted, #6b6a66); margin: 0 0 10px; }
.home-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.home-art-grid .ap-card { margin: 0; max-width: none; }

/* Section d'accueil : compacte, sous la zone de saisie */
.home-artifacts { width: 100%; max-width: 700px; margin: 18px auto 0; }
.home-artifacts h3 { font: 600 12px Figtree, system-ui, sans-serif; color: var(--muted, #6b6a66); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.home-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.home-artifacts .ap-card { margin: 0; max-width: none; padding: 7px 10px; gap: 8px; border-radius: 10px; }
.home-artifacts .ap-card-ico { width: 26px; height: 26px; flex-basis: 26px; border-radius: 7px; }
.home-artifacts .ap-card-ico svg { width: 14px; height: 14px; }
.home-artifacts .ap-card-title { font-size: 13px; font-weight: 600; }
.home-artifacts .ap-card-sub { font-size: 11px; }

/* Section d'accueil juste sous les suggestions */
.home-artifacts { margin: 14px auto 0; }

/* Section d'accueil : ligne 6 de la grille, sous les suggestions */
.student-app .hero > .home-artifacts { grid-column: 1 / -1; grid-row: 6; justify-self: center; width: min(100%, 700px); margin: 16px 0 0; }

/* Documents : panneau en pleine largeur (a cote de la barre laterale) */
.app.artifact-open.artifact-wide { --ap-w: min(calc(100vw - 260px), 1100px); }
@media (max-width: 860px) { .app.artifact-open.artifact-wide { --ap-w: 100vw; } }

/* Mobile : le panneau couvre tout l'ecran, quelles que soient les regles generales de l'application */
@media (max-width: 860px) {
  .artifact-panel { position: fixed !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; width: 100vw !important; max-width: none !important; height: 100vh !important; height: 100dvh !important; transform: none !important; display: flex !important; flex-direction: column !important; z-index: 80 !important; background: var(--surface, #ffffff) !important; }
  .artifact-panel[hidden] { display: none !important; }
  .artifact-panel .ap-body { flex: 1 1 auto !important; min-height: 0 !important; position: relative; }
  .artifact-panel .ap-frame { height: 100% !important; }
}

/* Mobile v3 : zone d'apercu a taille fixe par la grille, iframe en position absolue */
@media (max-width: 860px) {
  .artifact-panel { display: grid !important; grid-template-rows: auto minmax(0, 1fr) !important; grid-template-columns: minmax(0, 1fr) !important; }
  .artifact-panel[hidden] { display: none !important; }
  .artifact-panel .ap-head { min-width: 0; }
  .artifact-panel .ap-body { position: relative !important; width: 100% !important; min-width: 0 !important; min-height: 0 !important; height: auto !important; overflow: hidden; }
  .artifact-panel .ap-frame { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; }
  .artifact-panel .ap-loading { position: absolute; inset: 0; }
}

/* Icones de format et cartes de fichiers : icone de marque, animation au survol et a l'apparition */
.filecard .ext { background: transparent !important; box-shadow: none !important; padding: 0 !important; width: 40px !important; height: 40px !important; display: inline-flex !important; align-items: center; justify-content: center; flex-shrink: 0; }
.filecard .ext .fi { display: block; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease; border-radius: 9px; }
.filecard { animation: fc-in .35s cubic-bezier(.2,.8,.2,1) both; transition: transform .2s ease, box-shadow .2s ease; }
.filecard:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(31, 30, 29, .10); }
.filecard:hover .ext .fi { transform: scale(1.06) rotate(-3deg); box-shadow: 0 6px 14px rgba(31, 30, 29, .18); }
@keyframes fc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .filecard, .filecard .ext .fi { animation: none !important; transition: none !important; } }

/* Bibliotheque : cartes de documents avec icone, liseré de categorie et animations */
.lib-card { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 12px 14px 12px 16px; border: 1px solid var(--line, #e6e3da); border-radius: 14px; background: var(--surface, #ffffff); color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; animation: lib-in .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.lib-card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--cat, #9b9a95); }
.lib-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(31, 30, 29, .10); border-color: var(--cat, #e6e3da); }
.lib-card:focus-visible { outline: 2px solid var(--cat, #2A5BD7); outline-offset: 2px; }
.lib-card-ico { flex-shrink: 0; display: inline-flex; }
.lib-card .fi { display: block; border-radius: 9px; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease; }
.lib-card:hover .fi { transform: scale(1.07) rotate(-3deg); box-shadow: 0 6px 14px rgba(31, 30, 29, .16); }
.lib-card-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.lib-card-txt b { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card-txt small { font-size: 12px; color: var(--ink-3, #6b6a66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes lib-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lib-card, .lib-card .fi { animation: none !important; transition: none !important; } }

/* References des reponses : pastille d'icone nette et survol */
.src { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.src:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(31, 30, 29, .10); }
.src .kind { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; color: #2A5BD7; background: #eaf1fd; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.src:hover .kind { transform: scale(1.08); }
.src .kind svg { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .src .kind { color: #8fb2f5; background: #1f2b44; } }
:root[data-theme="dark"] .src .kind { color: #8fb2f5; background: #1f2b44; }
@media (prefers-reduced-motion: reduce) { .src, .src .kind { transition: none !important; } }

/* Connaissances personnelles : modal de premier login et menu "My knowledge" */
.kn-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(20, 19, 17, .45); backdrop-filter: blur(3px); animation: kn-fade .25s ease both; }
.kn-modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; box-sizing: border-box; padding: 24px; border-radius: 18px; background: var(--surface, #fff); color: var(--ink, #1f1e1d); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); animation: kn-up .35s cubic-bezier(.2,.8,.2,1) both; }
.kn-modal h2 { margin: 6px 0 8px; font: 600 22px/1.25 var(--serif, Georgia, serif); }
.kn-lead { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--ink-3, #6b6a66); }
.kn-modal label { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.kn-modal input, .kn-modal textarea, .kn-select { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line, #e6e3da); border-radius: 10px; background: var(--bg, #faf9f5); color: inherit; font: inherit; font-weight: 400; }
.kn-modal input:focus, .kn-modal textarea:focus, .kn-select:focus { outline: 2px solid #2A5BD7; outline-offset: 1px; }
.kn-steps { display: flex; gap: 6px; margin-bottom: 10px; }
.kn-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line, #e6e3da); transition: background .3s ease; }
.kn-steps span.on { background: #2A5BD7; }
.kn-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.kn-row { margin-bottom: 12px; }
.kn-drop { display: grid; place-items: center; min-height: 96px; padding: 16px; border: 2px dashed var(--line, #d8d4c8); border-radius: 14px; text-align: center; cursor: pointer; color: var(--ink-3, #6b6a66); font-weight: 500; transition: border-color .2s ease, background .2s ease; }
.kn-drop:hover, .kn-drop.over { border-color: #2A5BD7; background: rgba(42, 91, 215, .06); }
.kn-picked { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.kn-picked li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--bg, #faf9f5); animation: kn-up .3s ease both; }
.kn-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.kn-x { border: 0; background: none; color: inherit; font-size: 18px; cursor: pointer; padding: 0 4px; }
.kn-err { color: #b42318; font-size: 13px; margin: 6px 0; }
.kn-ico { flex-shrink: 0; display: inline-flex; }
.kn-ico svg { width: 36px; height: 36px; display: block; }
.kn-page { display: grid; gap: 14px; }
.kn-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kn-upload .kn-select { width: auto; min-width: 160px; }
.kn-btn-file { display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 10px; background: #2A5BD7; color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.kn-btn-file:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(42, 91, 215, .25); }
.kn-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line, #e6e3da); border-radius: 14px; background: var(--surface, #fff); animation: kn-up .35s cubic-bezier(.2,.8,.2,1) both; transition: box-shadow .2s ease, transform .2s ease; }
.kn-item:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(31, 30, 29, .08); }
.kn-meta { flex: 1; min-width: 0; display: grid; gap: 3px; }
.kn-meta b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-meta small { font-size: 12px; color: var(--ink-3, #6b6a66); }
.kn-st.ready { color: #1E8E3E; }
.kn-st.failed { color: #b42318; }
.kn-st.pending, .kn-st.processing { color: #2A5BD7; animation: kn-pulse 1.2s ease-in-out infinite; }
@keyframes kn-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kn-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes kn-pulse { 50% { opacity: .45; } }
@media (max-width: 560px) { .kn-modal { padding: 18px; } .kn-actions .btn { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .kn-overlay, .kn-modal, .kn-item, .kn-picked li, .kn-st.pending, .kn-st.processing { animation: none !important; } }

/* Panneau d'artifacts (ordinateur) : l'apercu remplit la zone disponible et defile a l'interieur */
.artifact-panel .ap-body { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.artifact-panel .ap-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Panneau d'artifacts : toute la zone de contenu defile (documents et apercus) */
.artifact-panel { display: flex !important; flex-direction: column; min-height: 0; }
.artifact-panel .ap-head { flex: 0 0 auto; }
.artifact-panel .ap-body { flex: 1 1 0; min-height: 0; min-width: 0; overflow: auto !important; position: relative; }
.artifact-panel .ap-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Le panneau fermé reste masque (l'attribut hidden doit gagner sur display) */
.artifact-panel[hidden] { display: none !important; }

/* my-knowledge-v2 */
.kn-muted { color: var(--ink-3, #6b6a66); font-size: 13px; }
.kn-empty { text-align: center; padding: 28px 12px; color: var(--ink-3, #6b6a66); font-size: 14px; animation: kn-fade .4s ease both; }
.kn-btn-file { background: #C4623F; }
.kn-btn-file:hover { box-shadow: 0 6px 16px rgba(196, 98, 63, .28); }
.kn-primary { background: #C4623F !important; color: #fff !important; border-color: #C4623F !important; }
.kn-primary:disabled { opacity: .45; }
.kn-drop-zone { border: 2px dashed var(--line, #d8d4c8); border-radius: 16px; padding: 22px 16px; text-align: center; background: var(--surface, #fff); transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.kn-drop-zone.over { border-color: #C4623F; background: rgba(196, 98, 63, .07); transform: scale(1.01); }
.kn-drop-zone.busy { opacity: .6; pointer-events: none; }
.kn-drop-inner { display: grid; justify-items: center; gap: 6px; }
.kn-drop-inner b { font-size: 15px; }
.kn-drop-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(196, 98, 63, .12); color: #C4623F; transition: transform .25s ease; }
.kn-drop-zone.over .kn-drop-ico { transform: translateY(-3px); }
.kn-drop-inner .kn-upload { margin-top: 8px; justify-content: center; }
.kn-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.kn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kn-chip { border: 1px solid var(--line, #e6e3da); background: var(--surface, #fff); color: var(--ink-2, #5e5d57); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.kn-chip span { opacity: .7; margin-left: 2px; }
.kn-chip:hover { border-color: #C4623F; }
.kn-chip[aria-pressed="true"] { background: #C4623F; border-color: #C4623F; color: #fff; }
.kn-search { min-width: 200px; flex: 0 1 260px; padding: 8px 12px; border: 1px solid var(--line, #e6e3da); border-radius: 10px; background: var(--bg, #faf9f5); color: inherit; font: inherit; font-size: 13px; }
.kn-search:focus { outline: 2px solid #C4623F; outline-offset: 1px; }
.kn-list { display: grid; gap: 10px; }
.kn-item { cursor: default; }
.kn-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.kn-viewer { position: fixed; inset: 0; z-index: 1100; display: grid; grid-template-rows: auto 1fr; background: var(--bg, #faf9f5); animation: kn-viewer-in .25s ease both; }
.kn-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line, #e6e3da); background: var(--surface, #fff); }
.kn-viewer-title { min-width: 0; display: grid; gap: 2px; }
.kn-viewer-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.kn-viewer-title small { color: var(--ink-3, #6b6a66); font-size: 12px; }
.kn-viewer-actions { display: flex; align-items: center; gap: 8px; }
.kn-viewer-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--soft-2, #f2efe8); font-size: 20px; cursor: pointer; }
.kn-viewer-body { min-height: 0; overflow: auto; position: relative; }
.kn-viewer-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.kn-viewer-image { display: block; max-width: 100%; max-height: 100%; margin: 24px auto; object-fit: contain; animation: kn-up .35s ease both; }
.kn-text { max-width: 760px; margin: 28px auto; padding: 0 20px 40px; white-space: pre-wrap; line-height: 1.75; font-size: 15px; color: var(--ink, #1f1e1d); animation: kn-up .35s ease both; }
@keyframes kn-viewer-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 560px) { .kn-search { flex: 1 1 100%; } .kn-row-actions { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .kn-viewer, .kn-viewer-image, .kn-text, .kn-empty { animation: none !important; } .kn-drop-zone, .kn-chip, .kn-drop-ico { transition: none !important; } }

/* quiz-v1 */
.kn-quiz { position: fixed; inset: 0; z-index: 1200; display: grid; grid-template-rows: auto 1fr; background: var(--bg, #faf9f5); animation: kn-viewer-in .25s ease both; }
.kn-quiz-body { min-height: 0; overflow: auto; }
.kn-quiz-card { max-width: 760px; margin: 24px auto; padding: 0 20px 40px; display: grid; gap: 16px; }
.kn-quiz-card h2 { margin: 0; font-size: 20px; }
.kn-quiz-card label { display: grid; gap: 6px; font-size: 14px; max-width: 280px; }
.kn-quiz-progress { display: grid; gap: 8px; font-size: 13px; color: var(--ink-3, #6b6a66); }
.kn-bar { height: 6px; border-radius: 99px; background: var(--soft-2, #f2efe8); overflow: hidden; }
.kn-bar i { display: block; height: 100%; background: #C4623F; border-radius: 99px; transition: width .4s ease; }
.kn-qlist { display: grid; gap: 14px; padding-left: 28px; margin: 0; }
.kn-quiz .kn-q { padding: 14px 16px; border: 1px solid var(--line, #e6e3da); border-radius: 14px; background: var(--surface, #fff); animation: kn-up .35s ease both; }
.kn-q p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.kn-choice { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.kn-choice:hover { background: var(--soft-2, #f2efe8); }
.kn-choice input { accent-color: #C4623F; }
.kn-open { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--line, #e6e3da); border-radius: 10px; font: inherit; font-size: 14px; background: var(--bg, #faf9f5); color: inherit; resize: vertical; }
.kn-open:focus { outline: 2px solid #C4623F; outline-offset: 1px; }
.kn-q.ok { border-color: #1E8E3E; }
.kn-q.ko { border-color: #b42318; }
.kn-small { font-size: 13px; color: var(--ink-2, #5e5d57); }
.kn-feedback { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--soft-2, #f2efe8); }
.kn-score { display: flex; align-items: baseline; gap: 12px; }
.kn-score b { font-size: 28px; }
.kn-score span { color: #C4623F; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .kn-quiz, .kn-quiz .kn-q, .kn-bar i { animation: none !important; transition: none !important; } }

/* quiz-history-v1 */
.kn-hist-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line, #e6e3da); border-radius: 14px; background: var(--surface, #fff); animation: kn-up .35s ease both; }
@media (max-width: 560px) { .kn-hist-item { flex-direction: column; align-items: stretch; } }

/* progress-v1 */
.pg-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pg-metric { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line, #e6e3da); border-radius: 14px; background: var(--surface, #fff); animation: kn-up .35s ease both; }
.pg-metric b { font-size: 20px; }
.pg-metric span { font-size: 12px; color: var(--ink-3, #6b6a66); }
.pg-sub { margin: 18px 0 8px; font-size: 13px; font-weight: 600; }
.pg-chart { width: 100%; height: auto; display: block; }
.pg-grid { stroke: var(--line, #e6e3da); stroke-width: 1; }
.pg-axis { font-size: 11px; fill: var(--ink-3, #6b6a66); }
.pg-line { fill: none; stroke: #C4623F; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; animation: pg-draw 1.2s ease both; }
.pg-dot { fill: #C4623F; stroke: var(--surface, #fff); stroke-width: 2; }
@keyframes pg-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .pg-line, .pg-metric { animation: none !important; } }

/* voice-call-v1 */
.vc-overlay { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 16px; background: rgba(20, 18, 16, .42); backdrop-filter: blur(6px); animation: kn-fade .25s ease both; }
.vc-card { width: min(380px, 100%); padding: 22px; border-radius: 22px; background: var(--surface, #fff); color: var(--ink, #1f1e1d); box-shadow: 0 24px 60px rgba(0, 0, 0, .22); display: grid; gap: 14px; justify-items: center; text-align: center; animation: kn-up .3s ease both; }
.vc-choice h2 { margin: 0; font-size: 18px; }
.vc-choices { display: grid; gap: 10px; width: 100%; }
.vc-choice-btn { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; text-align: left; padding: 14px; border: 1px solid var(--line, #e6e3da); border-radius: 16px; background: var(--bg, #faf9f5); color: inherit; cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.vc-choice-btn:hover { border-color: #C4623F; transform: translateY(-1px); }
.vc-choice-btn svg { grid-row: span 2; color: #C4623F; }
.vc-choice-btn b { font-size: 15px; }
.vc-choice-btn span { font-size: 13px; color: var(--ink-3, #6b6a66); }
.vc-foot { display: flex; gap: 8px; justify-content: flex-end; width: 100%; }
.vc-top { width: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-3, #6b6a66); }
.vc-badge { padding: 4px 10px; border-radius: 999px; background: rgba(196, 98, 63, .12); color: #C4623F; font-weight: 600; }
.vc-timer { font-variant-numeric: tabular-nums; }
.vc-avatar { --lvl: 0; position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
.vc-avatar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(196, 98, 63, .16); transform: scale(calc(1 + var(--lvl) * .35)); transition: transform .08s linear; }
.vc-avatar img { position: relative; width: 140px; height: 140px; object-fit: contain; transform: scale(calc(1 + var(--lvl) * .14)); transition: transform .08s linear; }
.vc-avatar[data-state="thinking"] img { animation: vc-think 1.2s ease-in-out infinite; }
.vc-avatar[data-state="muted"]::before { background: rgba(120, 120, 120, .14); }
@keyframes vc-think { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.vc-status { margin: 0; font-size: 15px; min-height: 22px; }
.vc-controls { display: flex; gap: 18px; align-items: center; }
.vc-btn { display: grid; justify-items: center; gap: 6px; border: 0; background: none; color: inherit; cursor: pointer; font-size: 12px; }
.vc-btn > svg { width: 56px; height: 56px; padding: 16px; box-sizing: border-box; border-radius: 50%; background: var(--soft-2, #f2efe8); }
.vc-btn.on > svg { background: #C4623F; color: #fff; }
.vc-hang > svg { background: #b42318; color: #fff; transform: rotate(135deg); }
.vc-rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #b42318; animation: vc-blink 1s ease-in-out infinite; }
@keyframes vc-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .vc-overlay, .vc-card, .vc-rec-dot, .vc-avatar img { animation: none !important; } .vc-avatar img, .vc-avatar::before { transition: none !important; } }

/* call-modal-v1 : appel petit, a droite, deplacable, sans bloquer la plateforme */
.vc-overlay.vc-live { position: fixed; inset: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.vc-overlay.vc-live .vc-call { position: fixed; top: 84px; right: 20px; left: auto; width: 260px; max-width: calc(100vw - 32px); margin: 0; padding: 14px; pointer-events: auto; user-select: none; }
.vc-overlay.vc-live .vc-top { cursor: move; }
.vc-overlay.vc-live .vc-avatar { width: 96px; height: 96px; margin: 10px auto; }
.vc-overlay.vc-live .vc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vc-overlay.vc-live .vc-status { margin: 4px 0 10px; font-size: 13px; }
.vc-overlay.vc-live .vc-controls { gap: 8px; }
.vc-overlay.vc-live .vc-hang, .vc-overlay.vc-live .vc-hang svg { transform: none !important; }
.vc-overlay.vc-live .vc-hang-icon { width: 22px; height: 22px; display: block; margin: 0 auto; }

/* source-cards-v1 : sources de reference en cartes */
.srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.srccard { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line, #e6e3da); border-radius: 12px; background: var(--surface, #fff); text-align: left; cursor: pointer; font: inherit; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; animation: kn-up .3s ease both; }
.srccard:hover, .srccard:focus-visible { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.08); border-color: #C4623F; outline: none; }
.srccard-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2, #f5f3ee); }
.srccard-ico svg { width: 22px; height: 22px; }
.srccard-body { display: grid; gap: 2px; min-width: 0; }
.srccard-body b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srccard-body small { font-size: 11px; color: var(--ink-3, #6b6a66); }
.srccard-body em { font-style: normal; font-size: 12px; color: var(--ink-2, #3d3c39); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.srccard-n { font-size: 11px; font-weight: 600; color: #C4623F; }
@media (prefers-reduced-motion: reduce) { .srccard { animation: none; transition: none; } }

/* doc-panel-v2 : panneau document propre, boutons blancs avec icones */
.doc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.doc-round, .doc-pill { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #fff; color: #2b2a27; border: 1px solid #e3dfd6; box-shadow: 0 1px 2px rgba(0,0,0,.05); cursor: pointer; font: inherit; font-size: 13px; transition: background .15s ease, transform .15s ease; }
.doc-round { width: 36px; height: 36px; border-radius: 50%; padding: 0; }
.doc-pill { height: 36px; padding: 0 14px; border-radius: 999px; }
.doc-round:hover, .doc-pill:hover { background: #f7f5f0; transform: translateY(-1px); }
.doc-pill:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.doc-viewer { width: 100%; background: #fff; border: 1px solid #e3dfd6; border-radius: 12px; overflow: hidden; }
.doc-viewer .original-pdf { display: block; width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 0; border-radius: 0; background: #fff; }
.doc-viewer .original-image { display: block; width: 100%; height: auto; }
.doc-viewer > .small { padding: 14px; }

/* screen-vision-v1 : panneau vision, appel plein ecran sur mobile */
.vis-panel { position: fixed; right: 20px; bottom: 20px; width: 340px; max-height: min(580px, 80vh); display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #fff; border: 1px solid #e3dfd6; border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.18); z-index: 1250; }
.vis-panel[hidden] { display: none; }
.vis-head { display: flex; align-items: center; gap: 8px; }
.vis-head b { flex: 1; font-size: 14px; }
.vis-icon { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #e3dfd6; background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.vis-icon svg { width: 14px; height: 14px; }
.vis-status { margin: 0; font-size: 12px; color: #6b6a66; }
.vis-wrap[hidden] { display: none; }
.vis-wrap video { width: 100%; max-height: 180px; object-fit: contain; border-radius: 10px; background: #111; }
.vis-actions { display: flex; gap: 8px; }
.vis-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: #fff; color: #2b2a27; border: 1px solid #e3dfd6; box-shadow: 0 1px 2px rgba(0,0,0,.05); font: inherit; font-size: 13px; cursor: pointer; transition: background .15s ease; }
.vis-btn svg { width: 16px; height: 16px; }
.vis-btn:hover { background: #f7f5f0; }
.vis-log { flex: 1; min-height: 120px; max-height: 260px; overflow: auto; display: grid; gap: 8px; align-content: start; }
.vis-msg { padding: 8px 10px; border-radius: 12px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; background: #f5f3ee; color: #2b2a27; max-width: 92%; }
.vis-msg.user { justify-self: end; background: #C4623F; color: #fff; }
.vis-ask { display: flex; gap: 8px; }
.vis-ask input { flex: 1; min-width: 0; height: 36px; border-radius: 999px; border: 1px solid #e3dfd6; padding: 0 12px; font: inherit; font-size: 13px; background: #fff; color: #2b2a27; }
@media (max-width: 700px) {
  .vis-panel { inset: 0; width: auto; max-height: none; border-radius: 0; }
  .vis-log { max-height: none; }
  .vis-overlay-call-hidden { display: none; }
}

/* Appel en direct sur mobile : plein ecran, comme un appel telephonique */
@media (max-width: 700px) {
  .vc-overlay.vc-live { background: #fff !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; pointer-events: auto !important; }
  .vc-overlay.vc-live .vc-call { position: fixed !important; inset: 0 !important; top: 0 !important; right: 0 !important; left: 0 !important; bottom: 0 !important; width: 100% !important; max-width: none !important; height: 100%; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 18px calc(40px + env(safe-area-inset-bottom)); box-shadow: none; }
  .vc-overlay.vc-live .vc-top { width: 100%; justify-content: space-between; cursor: default; }
  .vc-overlay.vc-live .vc-avatar { width: 180px !important; height: 180px !important; margin: 0 auto; }
  .vc-overlay.vc-live .vc-status { font-size: 16px; margin: 0; }
  .vc-overlay.vc-live .vc-controls { width: 100%; justify-content: space-evenly; margin-top: 24px; }
}

/* vision-v2 : icones du haut regroupees a droite, pres de la cloche */
.header-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* vision-v3 : panneau deplacable et redimensionnable, choix Taper / Appel, surlignage */
.vis-panel { width: 360px; min-width: 280px; min-height: 260px; max-width: 95vw; resize: both; overflow: auto; }
.vis-head { cursor: move; user-select: none; }
.vis-choice { display: grid; gap: 10px; }
.vis-choice[hidden], .vis-main[hidden], .vis-wrap[hidden] { display: none; }
.vis-option { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 12px; border: 1px solid #e3dfd6; border-radius: 14px; background: #fff; color: #2b2a27; font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: background .15s ease; }
.vis-option:hover { background: #f7f5f0; }
.vis-option svg { width: 20px; height: 20px; flex: 0 0 auto; }
.vis-option b { display: block; font-size: 14px; }
.vis-option small { color: #6b6a66; font-size: 12px; }
.vis-stage { position: relative; }
.vis-stage video { display: block; width: 100%; max-height: 240px; object-fit: contain; border-radius: 10px; background: #111; }
.vis-boxes { position: absolute; inset: 0; pointer-events: none; }
.vis-box { position: absolute; border: 2px solid; border-radius: 4px; box-sizing: border-box; animation: vis-pop .3s ease both; }
.vis-tag { position: absolute; left: -2px; top: -22px; font-size: 11px; padding: 2px 6px; border-radius: 6px; color: #111; white-space: nowrap; }
@keyframes vis-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.vis-copy { margin-top: 8px; height: 28px; padding: 0 10px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .vis-box { animation: none; } }

/* account-v2 : identite en haut avec photo ou icone, choix d'icone */
.acct-id { display: flex; align-items: center; gap: 14px; }
.acct-avatar { width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, #C4623F, #e09a7d); color: #fff; font-weight: 700; font-size: 20px; }
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct-avatar svg { width: 30px; height: 30px; }
.acct-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; margin-top: 12px; }
.acct-icons button { display: grid; place-items: center; height: 54px; border-radius: 14px; background: #fff; border: 1px solid #e3dfd6; color: #2b2a27; cursor: pointer; font: inherit; font-size: 13px; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: background .15s ease, transform .15s ease; }
.acct-icons button svg { width: 22px; height: 22px; }
.acct-icons button:hover { background: #f7f5f0; transform: translateY(-1px); }
.acct-icons button[aria-pressed="true"] { border-color: #C4623F; box-shadow: 0 0 0 2px rgba(196,98,63,.22); }
.acct-icons .acct-initials { font-weight: 700; }

/* study-cards-v1 : fiches de revision et maitrise par cours */
.sc-overlay { position: fixed; inset: 0; background: rgba(20, 18, 16, .45); display: grid; place-items: center; z-index: 10000; padding: 16px; }
.sc-card { width: min(520px, 100%); max-height: 88vh; overflow: auto; background: var(--surface, #fff); color: var(--text, #2b2a27); border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.sc-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #e3dfd6; }
.sc-head > div { flex: 1; min-width: 0; }
.sc-head b { display: block; }
.sc-head small { color: #7a756c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sc-close { border: 0; background: none; font-size: 24px; cursor: pointer; color: inherit; line-height: 1; }
.sc-body { padding: 18px; display: grid; gap: 14px; }
.sc-lead { margin: 0; color: #5f5a52; line-height: 1.5; }
.sc-field { display: grid; gap: 6px; font-size: 14px; }
.sc-select { padding: 8px; border-radius: 10px; border: 1px solid #e3dfd6; font: inherit; }
.sc-go { justify-self: start; }
.sc-err { color: #b3261e; margin: 0; }
.sc-count { margin: 0; color: #7a756c; font-size: 13px; }
.sc-face { border: 1px solid #e3dfd6; border-radius: 14px; padding: 18px; min-height: 120px; background: #fdfcf9; }
.sc-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #C4623F; }
.sc-text { margin: 8px 0 0; font-size: 16px; line-height: 1.5; white-space: pre-wrap; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-grade { flex: 1; min-width: 90px; }
.sc-done { margin: 0; text-align: center; color: #5f5a52; padding: 24px 0; }
/* maitrise par cours dans My progress */
.pg-courses { display: grid; gap: 12px; }
.pg-course-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.pg-bar { height: 8px; border-radius: 999px; background: #eee9df; overflow: hidden; margin: 6px 0 4px; }
.pg-bar i { display: block; height: 100%; background: #C4623F; border-radius: 999px; }
.pg-course small { color: #7a756c; }

/* notes-v1 : visionneuse blanche et fenetre de notes deplacable */
.kn-viewer-body, .kn-viewer-frame { background: #fff; }
.nt-card { position: fixed; top: 96px; right: 16px; width: min(440px, calc(100vw - 32px)); height: min(560px, 80vh); display: flex; flex-direction: column; background: var(--surface, #fff); color: var(--text, #2b2a27); border: 1px solid #e3dfd6; border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); z-index: 100000; overflow: hidden; }
.nt-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #e3dfd6; cursor: grab; touch-action: none; user-select: none; }
.nt-head > b { flex: 0 0 auto; }
.nt-head small { flex: 1; min-width: 0; color: #7a756c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-close { border: 0; background: none; font-size: 22px; cursor: pointer; color: inherit; line-height: 1; }
.nt-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #e3dfd6; }
.nt-history { padding: 6px; border-radius: 8px; border: 1px solid #e3dfd6; font: inherit; font-size: 13px; max-width: 200px; }
.nt-editor { flex: 1; width: 100%; box-sizing: border-box; border: 0; outline: none; resize: none; padding: 14px; font: 15px/1.6 system-ui, sans-serif; background: transparent; color: inherit; }
.nt-status { margin: 0; padding: 6px 14px 10px; font-size: 12px; color: #7a756c; min-height: 18px; }
@media (max-width: 700px) { .nt-card { inset: 0; width: auto; height: auto; border-radius: 0; } .nt-head { cursor: default; } }

/* notes-v2 : editeur markdown, barre d'outils a icones, apercu formate */
.nt-title { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.nt-title svg { color: #C4623F; }
.nt-icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 8px; border: 1px solid transparent; background: none; color: inherit; cursor: pointer; flex: 0 0 auto; }
.nt-icon-btn:hover:not(:disabled) { background: #f3efe7; }
.nt-icon-btn:disabled { opacity: .4; cursor: default; }
.nt-icon-btn svg { width: 17px; height: 17px; }
.nt-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px 12px; border-bottom: 1px solid #e3dfd6; }
.nt-sep { width: 1px; height: 20px; background: #e3dfd6; margin: 0 4px; }
.nt-select { display: inline-flex; align-items: center; gap: 4px; color: #7a756c; margin-left: auto; }
.nt-select-ico svg { width: 16px; height: 16px; display: block; }
.nt-body { flex: 1; min-height: 0; display: flex; }
.nt-editor { font: 15px/1.65 system-ui, sans-serif; padding: 16px; }
.nt-preview { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; line-height: 1.65; font-size: 15px; }
.nt-preview h1, .nt-preview h2, .nt-preview h3 { margin: .9em 0 .4em; line-height: 1.25; }
.nt-preview h1 { font-size: 1.35em; }
.nt-preview h2 { font-size: 1.2em; }
.nt-preview h3 { font-size: 1.05em; }
.nt-preview p { margin: .5em 0; }
.nt-preview ul, .nt-preview ol { padding-left: 1.4em; margin: .4em 0; }
.nt-preview code { background: #f3efe7; padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.nt-preview pre { background: #f3efe7; padding: 10px; border-radius: 10px; overflow: auto; }
.nt-preview blockquote { margin: .6em 0; padding-left: 12px; border-left: 3px solid #C4623F; color: #5f5a52; }
.nt-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3dfd6; }
.nt-status { flex: 1; min-width: 0; margin: 0; padding: 0; font-size: 12px; color: #7a756c; }
.nt-btn { display: inline-flex; align-items: center; gap: 6px; }
.nt-btn svg { width: 16px; height: 16px; }


/* exam-v1 : examen blanc et focus sur les passages cites */
.ex-chapters { display: grid; gap: 8px; margin: 12px 0; }
.ex-chapter { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e3dfd6; border-radius: 12px; cursor: pointer; }
.ex-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.ex-row label { display: grid; gap: 6px; font-size: 14px; }
.ex-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; background: var(--surface, #fff); }
.ex-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; color: #C4623F; }
.ex-timer.warn { color: #b3261e; }
.ex-chapter-tag { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #7a756c; }
.ex-result-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.doc-focus { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: #fff6c2; border: 1px solid #f0d96a; }
.doc-focus b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #7a5c00; margin-bottom: 4px; }
.doc-focus blockquote { margin: 0; line-height: 1.5; }


/* images-v1 : images des recherches web */
.imgstrip { display: flex; gap: 10px; overflow-x: auto; padding: 6px 0 10px; scroll-snap-type: x proximity; }
.imgcard { flex: 0 0 180px; display: grid; gap: 6px; text-decoration: none; color: inherit; scroll-snap-align: start; }
.imgcard img { width: 180px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid #e3dfd6; background: #f4f1ea; }
.imgcard small { font-size: 12px; color: #7a756c; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) { .imgcard { flex-basis: 150px; } .imgcard img { width: 150px; height: 100px; } }

/* research-panel-v1 : boutons de projet qui se chevauchaient dans le panneau etroit */
.research-workspace .research-project-controls { display: flex; flex-wrap: wrap; gap: 5px; }
.research-workspace .research-project-controls .research-project-title { flex: 1 1 100%; min-width: 0; }
.research-workspace .research-project-controls .btn { flex: 1 1 auto; min-width: 0; white-space: normal; text-align: center; line-height: 1.25; }
.research-workspace .research-results { min-width: 210px; }

/* research-simple-v1 : panneau Web research simplifie, une colonne, sans options secondaires */
.research-workspace { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 42%) minmax(0, 1fr) !important; }
.research-workspace .research-results { min-width: 0; overflow: auto; border-right: 0 !important; border-bottom: 1px solid var(--line); }
.research-workspace .research-result-list { max-height: none; flex: none; }
.research-workspace .research-verify,
.research-workspace .research-highlight,
.research-workspace .research-highlights,
.research-workspace .research-project-compare,
.research-workspace .research-project-delete,
.research-workspace .research-comparison-output { display: none !important; }
.research-workspace .research-project-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.research-workspace .research-project-controls .research-project-title { flex: 1 1 100%; min-width: 0; }
.research-workspace .research-project-controls .btn { flex: 1 1 auto; min-width: 0; }

/* research-reader-v1 : le panneau n'affiche que la page ouverte (texte et liens) */
.research-workspace { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 1fr) !important; }
.research-workspace .research-results,
.research-workspace .research-annotation,
.research-workspace .research-saved,
.research-workspace .research-projects,
.research-workspace .research-verify { display: none !important; }
.research-workspace .research-reader { min-height: 0; }
.research-workspace .research-page-text { padding: 18px 20px; }


/* research-reader-v2 : image de la page, paragraphes, bouton Copy */
.research-page-image { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; }
.research-copy-bar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.research-readable-text p { margin: 0 0 12px; line-height: 1.65; white-space: normal; }


/* drive-viewer-v1 : lecteur de fichiers Drive dans le site */
.drive-viewer { position: fixed; inset: 0; z-index: 10000; background: rgba(20, 18, 15, .45); display: grid; place-items: center; padding: 16px; }
.drive-viewer-card { width: min(960px, 100%); height: min(86vh, 900px); background: var(--bg, #fff); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.drive-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #e3dfd6; }
.drive-viewer-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-viewer-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.drive-viewer-body { flex: 1; min-height: 0; overflow: auto; display: flex; }
.drive-viewer-body iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.drive-viewer-img { max-width: 100%; max-height: 100%; margin: auto; display: block; padding: 12px; object-fit: contain; }
.drive-viewer-text { margin: 0; padding: 16px; white-space: pre-wrap; font-size: 13px; line-height: 1.6; flex: 1; }
.drive-viewer-body > p { margin: auto; padding: 20px; text-align: center; }


/* office-preview-v1 : apercu Word, PowerPoint, Excel dans le lecteur */
.original-office { display: block; width: 100%; min-height: 70vh; border: 0; background: #fff; border-radius: 8px; }

/* dark-readable-v1 : texte fonce sur les fonds clairs du lecteur, meme en mode sombre */
.doc-focus, .doc-focus b, .doc-focus blockquote { color: #2b2100 !important; }
.kn-viewer-body { color: #1d1b17 !important; }
.kn-viewer-body *:not(button):not(a):not(svg) { color: #1d1b17 !important; }

/* connectors-v1 : bouton Connecteurs (zone de chat), liste et page Connectors */
.connector-menu { position: relative; display: inline-flex; }
.connector-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 60; min-width: 260px; padding: 6px; border-radius: 12px; border: 1px solid #e5e0d6; background: #fff; color: #1d1b17; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.connector-pop[hidden] { display: none; }
.connector-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.connector-pop button:hover { background: #f4f0e8; }
.connector-pop small { margin-left: auto; opacity: .7; font-size: 12px; }
.connector-pop .cx-all { border-top: 1px solid #e5e0d6; margin-top: 4px; border-radius: 0 0 8px 8px; font-size: 13px; }
.cx-dot { width: 8px; height: 8px; border-radius: 50%; background: #bbb; flex: none; }
.cx-dot.on { background: #2e9b5f; }
.cx-card { margin-bottom: 12px; }
.cx-error { color: #b42318; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .connector-pop { background: #22201c; color: #f1ede6; border-color: #3a362e; }
  :root:not([data-theme="light"]) .connector-pop button:hover { background: #2e2b25; }
}
:root[data-theme="dark"] .connector-pop { background: #22201c; color: #f1ede6; border-color: #3a362e; }
:root[data-theme="dark"] .connector-pop button:hover { background: #2e2b25; }

/* youtube-player-v1 : lecteur YouTube dans une fenetre de la plateforme */
.yt-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.yt-box { width: min(960px, 100%); background: #111; color: #f5f5f5; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.yt-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.yt-head b { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-close { background: none; border: 0; color: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.yt-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-open { display: block; padding: 10px 14px; font-size: 13px; color: #9ecbff; }

/* connectors-logos-v1 : logos officiels des connecteurs */
.cx-logo { display: inline-block; width: 22px; height: 22px; flex: none; background: var(--brand); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.cx-tile { background: #fff !important; border: 1px solid #e5e0d6; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; }
.connector-pop button .cx-logo { width: 18px; height: 18px; }

/* artifact-editor-v2 : onglets Preview / Code, code a numeros de ligne, menu visuel */
.ap-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid rgba(128,128,128,.25); }
.ap-tab { border: 0; background: none; color: inherit; font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer; opacity: .65; }
.ap-tab.on { opacity: 1; background: rgba(128,128,128,.18); }
.ap-code-wrap { display: flex; height: 100%; min-height: 320px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ap-gutter { overflow: hidden; white-space: pre; text-align: right; padding: 12px 10px 12px 12px; min-width: 3em; color: rgba(128,128,128,.85); background: rgba(128,128,128,.08); user-select: none; }
.ap-code-src { flex: 1; border: 0; outline: none; resize: none; padding: 12px; background: transparent; color: inherit; font: inherit; white-space: pre; overflow: auto; tab-size: 2; }
.visual-pop[hidden] { display: none !important; }

/* reasoning-v1 : etapes repliables */
.steps[hidden] { display: none !important; }
.steps-toggle { border: 0; background: none; color: inherit; font: inherit; font-size: 13px; opacity: .7; cursor: pointer; padding: 4px 0; }
.steps-toggle:hover { opacity: 1; }

/* tool-lanes-v1 : un outil par ligne, pendant la reponse */
.lanes { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.lanes[hidden] { display: none !important; }
.lane { display: flex; align-items: center; gap: 8px; font-size: 13px; opacity: .8; }
.lane.error { color: #c0392b; }

/* groups-ui-v1 : groupes d'etude */
.grp { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }
.grp h3 { margin: 0; }
.grp section { display: flex; flex-direction: column; gap: 8px; }
.grp input, .grp select, .grp textarea { padding: 6px 8px; border-radius: 8px; border: 1px solid #8884; background: transparent; color: inherit; font: inherit; }
.grp form { display: flex; flex-wrap: wrap; gap: 6px; }
.grp textarea { width: 100%; box-sizing: border-box; font-family: ui-monospace, monospace; }
.grp-item { display: flex; justify-content: space-between; width: 100%; padding: 10px; margin: 4px 0; border: 1px solid #8884; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.grp-item span { opacity: .7; font-size: 13px; }
.grp-back { align-self: flex-start; background: none; border: 0; color: inherit; cursor: pointer; }
.grp-comments { font-size: 14px; }

/* groups-ui-v2 : cartes, profil, chat, invitations */
.grp-invites-box[hidden] { display: none; }
.grp-invites-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #4f6bd6; border-radius: 12px; }
.grp-invite { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.grp-invite p { margin: 4px 0 0; opacity: .8; font-size: 13px; }
.grp-card { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px; margin: 6px 0; border: 1px solid #8884; border-radius: 14px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.grp-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grp-card-text small { opacity: .75; }
.grp-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; background: #4f6bd6; color: #fff; font-weight: 600; }
.grp-avatar.lg { width: 96px; height: 96px; font-size: 36px; }
.grp-hero { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.grp-hero-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.grp-hero-text h3 { margin: 0; }
.grp-avatar-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.grp-avatar-edit { font-size: 12px; cursor: pointer; text-decoration: underline; }
.grp-desc { margin: 0; opacity: .85; }
.grp-stats { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.grp-stats span { padding: 3px 8px; border-radius: 999px; border: 1px solid #8884; }
.grp-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid #8884; padding-bottom: 6px; }
.grp-tabs button { padding: 6px 12px; border-radius: 999px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.grp-tabs button.on { background: #4f6bd622; font-weight: 600; }
.grp-chat { display: flex; flex-direction: column; gap: 8px; }
.grp-msgs { height: 48vh; min-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.grp-msg { padding: 8px 10px; border-radius: 12px; border: 1px solid #8883; max-width: 85%; }
.grp-msg p { margin: 4px 0 0; word-break: break-word; }
.grp-msg.ai { border-color: #4f6bd6; background: #4f6bd611; }
.grp-msg-head small { opacity: .6; margin-left: 6px; }
.grp-file-chip { border: 1px solid #8886; border-radius: 8px; padding: 6px 10px; background: transparent; color: inherit; cursor: pointer; margin-top: 4px; }
.grp-composer { display: flex; gap: 6px; align-items: flex-end; flex-wrap: nowrap; }
.grp-composer textarea { flex: 1; resize: vertical; }
.grp-attach { padding: 8px 10px; border: 1px solid #8884; border-radius: 8px; cursor: pointer; font-size: 13px; }
.grp-ro { opacity: .7; font-size: 13px; }
.grp-members li { margin: 4px 0; }

/* groups-ui-v3 : passe de design et animations des groupes d'etude */
@keyframes grp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes grp-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.grp { gap: 16px; }
.grp-body { display: flex; flex-direction: column; gap: 16px; max-width: 760px; margin: 0 auto; }
.grp-back { font-size: 14px; opacity: .8; transition: opacity .15s; }
.grp-back:hover { opacity: 1; }

/* Banniere de groupe : avatar qui chevauche, textes en blanc sur le degrade. */
.grp-hero {
  align-items: flex-end; padding: 18px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #3b5bdb 0%, #7048e8 55%, #15aabf 100%);
  box-shadow: 0 10px 30px #3b5bdb33;
}
.grp-hero .grp-avatar.lg { border: 4px solid #fff; box-shadow: 0 6px 18px #0004; }
.grp-hero .grp-avatar-edit { color: #fff; opacity: .9; }
.grp-hero .grp-stats span { border-color: #fff8; background: #fff2; color: #fff; }
.grp-hero .grp-desc { color: #fffd; }
.grp-hero .grp-desc-edit { background: #fff2; color: #fff; border: 1px solid #fff8; border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.grp-hero .grp-desc-edit:hover { background: #fff4; }
.grp-hero-text h3 { font-size: 22px; }

/* Onglets : soulignement anime, pas de pastilles. */
.grp-tabs { gap: 2px; padding: 0; border-bottom: 1px solid #8883; }
.grp-tabs button {
  position: relative; padding: 10px 14px; border-radius: 10px 10px 0 0; opacity: .75;
  transition: opacity .2s, background .2s, color .2s;
}
.grp-tabs button:hover { opacity: 1; background: #8881; }
.grp-tabs button.on { opacity: 1; color: #4f6bd6; background: transparent; font-weight: 600; }
.grp-tabs button.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  border-radius: 2px; background: #4f6bd6; animation: grp-pop .25s ease both;
}

/* Contenu des onglets : entree en douceur a chaque changement. */
.grp-pane > * { animation: grp-rise .28s ease both; }

/* Cartes de la liste : survol et ombre. */
.grp-card {
  padding: 14px; border-radius: 16px; background: #8881;
  border-color: transparent;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.grp-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px #0003; border-color: #4f6bd6; }
.grp-card strong { font-size: 16px; }
.grp-card-text .grp-stats span { font-size: 11px; }
.grp-card .grp-avatar { width: 52px; height: 52px; font-size: 20px; }

/* Chips de statistiques. */
.grp-stats span { transition: background .2s; }
.grp-stats span:hover { background: #8882; }

/* Chat : bulles plus douces, entree animee, etat vide. */
.grp-msgs { padding: 6px 2px; }
.grp-msgs:empty::before { content: "No messages yet. Say hello to the group."; opacity: .55; margin: auto; font-size: 14px; }
.grp-msg { border: 0; border-radius: 14px; background: #8881; animation: grp-rise .22s ease both; max-width: 82%; }
.grp-msg.ai { background: linear-gradient(135deg, #3b5bdb18, #15aabf18); box-shadow: inset 0 0 0 1px #3b5bdb55; }
.grp-msg-head strong { font-size: 13px; }
.grp-file-chip { border: 0; background: #4f6bd61a; color: #4f6bd6; font-weight: 600; transition: background .15s; }
.grp-file-chip:hover { background: #4f6bd633; }
.grp-composer textarea { border-radius: 12px; border: 1px solid #8884; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
.grp-composer textarea:focus { outline: none; border-color: #4f6bd6; box-shadow: 0 0 0 3px #4f6bd622; }
.grp-composer button {
  background: #4f6bd6; color: #fff; border: 0; border-radius: 12px; padding: 10px 18px; cursor: pointer;
  font-weight: 600; transition: filter .15s, transform .1s;
}
.grp-composer button:hover { filter: brightness(1.08); }
.grp-composer button:active { transform: scale(.97); }
.grp-attach { border-radius: 12px; padding: 10px 12px; transition: background .15s; }
.grp-attach:hover { background: #8882; }

/* Listes : separateurs et survol. */
.grp-members li, .grp-file-list li, .grp-arts li { padding: 8px 10px; border-radius: 10px; transition: background .15s; }
.grp-members li:hover, .grp-file-list li:hover, .grp-arts li:hover { background: #8881; }
.grp-invites-box { border-radius: 16px; background: #4f6bd60d; animation: grp-rise .25s ease both; }
.grp-invite .grp-invite-actions button { border-radius: 8px; }

/* Mouvement reduit si l'utilisateur le demande. */
@media (prefers-reduced-motion: reduce) {
  .grp *, .grp-pane > *, .grp-msg { animation: none !important; transition: none !important; }
  .grp-card:hover { transform: none; }
}

/* groups-ui-v4 : composants uniformes, composeur de chat, listes sans puces, formulaires alignes */
.grp { padding: 4px 2px 24px; }
.grp h3 { font-size: 20px; margin: 0; }
.grp h4 { margin: 18px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }

/* Boutons et champs uniformes dans tout le module. */
.grp button {
  font: inherit; font-size: 14px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid #8884; background: transparent; color: inherit; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.grp button:hover { background: #8881; }
.grp button:active { transform: scale(.98); }
.grp input, .grp select, .grp textarea {
  font: inherit; font-size: 14px; height: 38px; padding: 0 12px; border-radius: 10px; box-sizing: border-box;
  border: 1px solid #8884; background: transparent; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.grp input:focus, .grp select:focus, .grp textarea:focus {
  outline: none; border-color: #4f6bd6; box-shadow: 0 0 0 3px #4f6bd626;
}
.grp .grp-new button, .grp .grp-add button, .grp .grp-newart button, .grp-composer button,
.grp-invite [data-acc] {
  background: #4f6bd6; border-color: #4f6bd6; color: #fff; font-weight: 600;
}
.grp .grp-new button:hover, .grp .grp-add button:hover, .grp .grp-newart button:hover,
.grp-composer button:hover, .grp-invite [data-acc]:hover { background: #3b5bdb; }
.grp .grp-back { height: auto; padding: 4px 0; border: 0; background: none; opacity: .75; }
.grp .grp-back:hover { opacity: 1; background: none; }

.grp .grp-new { display: flex; gap: 8px; }
.grp .grp-new input { flex: 1; }

/* Invitations */
.grp .grp-invites-box { padding: 14px; }
.grp .grp-invite button { height: 32px; font-size: 13px; }
.grp .grp-invite [data-dec] { background: transparent; }

/* Cartes de la liste */
.grp .grp-card { height: auto; padding: 14px; border: 1px solid transparent; background: #8881; border-radius: 16px; }
.grp .grp-card:hover { background: #8882; }

/* Banniere : boutons en blanc */
.grp .grp-hero .grp-avatar-edit { height: auto; display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; border: 1px solid #fff8; background: #fff2; font-size: 12px; text-decoration: none; }
.grp .grp-hero .grp-desc-edit { height: 26px; padding: 0 10px; font-size: 12px; border: 1px solid #fff8; background: #fff2; color: #fff; }
.grp .grp-hero .grp-desc-edit:hover { background: #fff4; }

/* Onglets */
.grp .grp-tabs { gap: 2px; }
.grp .grp-tabs button { height: auto; padding: 10px 14px; border: 0; border-radius: 10px 10px 0 0; background: transparent; }
.grp .grp-tabs button:hover { background: #8881; }
.grp .grp-tabs button.on { background: transparent; }

/* Chat : composeur en pilule, zone de messages qui remplit le panneau */
.grp .grp-chat { height: min(70vh, 620px); display: flex; flex-direction: column; gap: 10px; }
.grp .grp-msgs { flex: 1; min-height: 0; height: auto; padding: 8px 4px; }
.grp .grp-composer {
  display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 8px; padding: 6px;
  border: 1px solid #8884; border-radius: 22px; background: #8880; transition: border-color .15s;
}
.grp .grp-composer:focus-within { border-color: #4f6bd6; }
.grp .grp-composer textarea {
  flex: 1; height: auto; min-height: 38px; max-height: 140px; resize: none; border: 0; background: transparent;
  padding: 9px 10px; box-shadow: none !important; line-height: 1.4;
}
.grp .grp-attach {
  display: inline-flex; align-items: center; height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid #8884; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.grp .grp-attach:hover { background: #8882; }
.grp .grp-composer button { height: 38px; padding: 0 20px; border-radius: 999px; }
.grp .grp-ro { margin: 0; padding: 10px; text-align: center; opacity: .7; font-size: 13px; }

/* Listes sans puces : membres, fichiers, artifacts */
.grp .grp-members, .grp .grp-file-list, .grp .grp-arts > ul {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
}
.grp .grp-members li, .grp .grp-file-list li, .grp .grp-arts li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: #8881;
}
.grp .grp-members li button { height: 30px; font-size: 12px; padding: 0 10px; }
.grp .grp-file-list li button, .grp .grp-arts li button {
  border-color: #4f6bd633; background: #4f6bd60f; color: #4f6bd6; font-weight: 600;
}

/* Upload : bouton en pointille */
.grp .grp-upload-label {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; margin-top: 12px;
  border-radius: 10px; border: 1px dashed #4f6bd6; color: #4f6bd6; font-weight: 600; font-size: 14px; cursor: pointer;
}
.grp .grp-upload-label:hover { background: #4f6bd60f; }

/* Formulaires en grille */
.grp .grp-add { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.grp .grp-newart { display: grid; grid-template-columns: 1fr 170px; gap: 8px; }
.grp .grp-newart textarea { grid-column: 1 / -1; height: auto; padding: 10px 12px; }
.grp .grp-newart button { grid-column: 1 / -1; }
.grp .grp-art-text { height: auto; padding: 10px 12px; font-family: ui-monospace, monospace; font-size: 13px; }
.grp .grp-art-actions button, .grp .grp-art-text + div button { margin-top: 8px; }

@media (max-width: 520px) {
  .grp .grp-add, .grp .grp-newart { grid-template-columns: 1fr; }
}

/* groups-ui-v5 : palette orange / rouge / bleu, icones partout, boutons icone seule */
.grp { --bl: #2563eb; --bl-d: #1d4ed8; --or: #f97316; --rd: #ef4444; }
.grp .ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.grp button, .grp label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.grp .grp-empty, .grp .grp-muted { opacity: .65; font-size: 13px; }
.grp .grp-empty { display: flex; align-items: center; gap: 8px; padding: 14px 0; }
.grp .grp-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grp h4, .grp h5 { display: flex; align-items: center; gap: 8px; }

/* Titre et bouton de retour */
.grp .grp-title { align-items: center; }
.grp .grp-title h3 { font-size: 20px; }
.grp .grp-title-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--or), var(--rd)); }
.grp .grp-title-ico .ico { width: 20px; height: 20px; }
.grp .grp-back { color: var(--bl); border: 0; background: transparent; padding: 4px 0; height: auto; font-weight: 600; }
.grp .grp-back:hover { background: transparent; text-decoration: underline; }

/* Boutons : bleu pour l'action principale, rouge pour le retrait, orange pour l'upload */
.grp .grp-new button, .grp .grp-add button, .grp .grp-newart button, .grp .grp-art-actions button, .grp .grp-row > button[data-save],
.grp .grp-invite [data-acc], .grp .grp-composer .grp-send, .grp .grp-comment .grp-send {
  background: var(--bl); border-color: var(--bl); color: #fff; font-weight: 600;
}
.grp .grp-new button:hover, .grp .grp-add button:hover, .grp .grp-newart button:hover,
.grp .grp-invite [data-acc]:hover, .grp .grp-composer .grp-send:hover, .grp .grp-comment .grp-send:hover { background: var(--bl-d); }
.grp .grp-invite [data-dec], .grp .grp-remove { color: var(--rd); border-color: #ef444466; background: transparent; }
.grp .grp-invite [data-dec]:hover, .grp .grp-remove:hover { background: #ef444414; }
.grp .grp-desc-edit, .grp .grp-hero .grp-desc-edit { height: 28px; padding: 0 10px; font-size: 12px; }
.grp .grp-comments button, .grp .grp-art-text + .grp-row button, .grp .grp-file-list button, .grp .grp-arts button { font-size: 13px; }
.grp .grp-file-list button, .grp .grp-arts button, .grp .grp-comments button {
  color: var(--or); border-color: #f9731666; background: #f973160f; font-weight: 600;
}

/* Boutons icone seule : chat */
.grp .grp-icon-btn, .grp .grp-attach, .grp .grp-composer .grp-send, .grp .grp-comment .grp-send {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
}
.grp .grp-attach { color: var(--or); border: 1px solid #f9731688; background: #f973161a; cursor: pointer; }
.grp .grp-attach:hover { background: #f9731633; }
.grp .grp-attach .ico { width: 19px; height: 19px; }
.grp .grp-composer .grp-send .ico, .grp .grp-comment .grp-send .ico { width: 18px; height: 18px; margin-left: -2px; }

/* Cartes : orange au survol, avatar en degrade */
.grp .grp-avatar { background: linear-gradient(135deg, var(--or), var(--rd)); }
.grp .grp-avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.grp .grp-card:hover { border-color: var(--or); }
.grp .grp-card-text .grp-stats span { display: inline-flex; align-items: center; gap: 4px; }
.grp .grp-card-text .grp-stats .ico { width: 14px; height: 14px; }
.grp .grp-stats .s-blue { color: var(--bl); border-color: #2563eb55; background: #2563eb12; }
.grp .grp-stats .s-orange { color: var(--or); border-color: #f9731655; background: #f9731612; }
.grp .grp-stats .s-red { color: var(--rd); border-color: #ef444455; background: #ef444412; }
.grp .grp-stats span { display: inline-flex; align-items: center; gap: 4px; }
.grp .grp-stats .ico { width: 14px; height: 14px; }
.grp .grp-hero .grp-stats span { color: #fff; border-color: #fff8; background: #fff2; }
.grp .grp-hero { background: linear-gradient(135deg, var(--or) 0%, var(--rd) 50%, var(--bl) 100%); box-shadow: 0 12px 30px #ef444426; }
.grp .grp-hero .grp-avatar-edit { color: #fff; border: 1px solid #fff8; background: #fff2; height: auto; padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.grp .grp-hero .grp-avatar-edit .ico { width: 14px; height: 14px; }

/* Onglets avec icones, actif en orange */
.grp .grp-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.grp .grp-tabs .ico { width: 16px; height: 16px; }
.grp .grp-tabs button.on { color: var(--or); }
.grp .grp-tabs button.on::after { background: var(--or); }

/* Invitations : encadrement orange */
.grp .grp-invites-box { border: 1px solid #f9731666; background: #f973160d; }
.grp .grp-invites-box h4 { margin: 0; color: var(--or); }

/* Chat */
.grp .grp-msg-head { display: flex; align-items: center; gap: 6px; }
.grp .grp-msg-head .ico { width: 14px; height: 14px; opacity: .7; }
.grp .grp-msg.ai { background: linear-gradient(135deg, #f973161a, #2563eb14); box-shadow: inset 0 0 0 1px #f9731666; }
.grp .grp-msg.ai .grp-msg-head .ico { color: var(--or); opacity: 1; }
.grp .grp-file-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--or); background: #f973161a; border: 1px solid #f9731655; }
.grp .grp-file-chip .ico { width: 16px; height: 16px; }
.grp .grp-ro { display: flex; align-items: center; justify-content: center; gap: 8px; }
.grp .grp-composer { border-color: #2563eb44; }
.grp .grp-composer:focus-within { border-color: var(--bl); box-shadow: 0 0 0 3px #2563eb22; }

/* Listes avec icones */
.grp .grp-file-list li, .grp .grp-members li, .grp .grp-arts li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grp .grp-file-name, .grp .grp-member { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.grp .grp-file-name .ico { color: var(--bl); width: 18px; height: 18px; }
.grp .grp-arts li button { border: 0; background: transparent; color: inherit; font-weight: 600; }
.grp .grp-arts li button .ico { color: var(--bl); }
.grp .grp-upload-label { color: var(--or); border-color: var(--or); }
.grp .grp-upload-label:hover { background: #f973160f; }
.grp .grp-upload-label .ico { width: 18px; height: 18px; }
.grp h4 .ico, .grp h5 .ico { width: 16px; height: 16px; color: var(--bl); }
.grp .grp-invites-box h4 .ico { color: var(--or); }
.grp .grp-comment { display: flex; gap: 8px; align-items: center; }
.grp .grp-comment input { flex: 1; }
.grp .grp-remove { height: 30px; font-size: 12px; padding: 0 10px; }
.grp .grp-remove .ico { width: 14px; height: 14px; }
.grp .grp-history li, .grp .grp-comments li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  .grp .ico { transition: none !important; }
}

/* groups-ui-v6 : statut d'envoi, messages propres, attente de l'IA */
@keyframes grp-spin-r { to { transform: rotate(360deg); } }
.grp .grp-spin { animation: grp-spin-r .9s linear infinite; }
.grp .grp-msg.mine { align-self: flex-end; background: #2563eb14; border: 1px solid #2563eb33; }
.grp .grp-msg.pending { opacity: .8; }
.grp .grp-msg.failed { border-color: #ef444499; background: #ef44440f; }
.grp .grp-msg.sys { border-color: #f9731688; background: #f973160d; }
.grp .grp-msg-head { flex-wrap: wrap; }
.grp .grp-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin-left: auto; opacity: .85; }
.grp .grp-status .ico { width: 13px; height: 13px; }
.grp .grp-msg.sent .grp-status { color: var(--bl); }
.grp .grp-msg.failed .grp-status { color: var(--rd); }
.grp .grp-ai-wait .grp-status { color: var(--or); }
.grp .grp-retry { height: 24px; font-size: 12px; padding: 0 8px; border-color: #ef444466; color: var(--rd); background: transparent; }
@media (prefers-reduced-motion: reduce) { .grp .grp-spin { animation-duration: 2.5s; } }

/* groups-ui-v7 : chargements toujours animes, meme avec le mouvement reduit du systeme */
.grp .grp-spin { animation: grp-spin-r .9s linear infinite !important; }
@media (prefers-reduced-motion: reduce) {
  .grp .grp-msg, .grp .grp-pane > *, .grp .grp-invites-box { animation: grp-rise .28s ease both !important; }
}
