/* Manuel Studio : espace « Manuels » de l'outil (sommaire, éditeur de blocs, aperçu, repères, points à valider). */

/* Sommaire (à gauche) */
.man-top { flex-direction: column; align-items: stretch; gap: 6px; }
.man-ttl { font-weight: 600; font-size: 13px; padding: 2px 4px; }
.man-pick { width: 100%; }
.man-tree { gap: 0; padding: 6px 6px 20px; }
.man-node { display: flex; align-items: baseline; gap: 6px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; padding: 5px 8px; border-radius: 7px; font-size: 13px; color: var(--text); line-height: 1.3; }
.man-node:hover { background: var(--surface2); }
.man-node.on { background: #fff1e8; color: #b44a05; font-weight: 600; }
.man-node .n { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.6em; font-size: 12px; }
.man-node.ch { font-weight: 600; margin-top: 8px; }
.man-node.sec { padding-left: 16px; font-size: 12.5px; }
.man-node.sec .n { min-width: 2.4em; }
.man-node.iss { font-weight: 600; margin-bottom: 4px; }
.man-node.iss .nav-n { margin-left: auto; }
.man-node .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-left: auto; flex: none; align-self: center; }
.man-side-foot { padding: 8px; border-top: 1px solid var(--line); }

/* Éditeur (au centre) */
.man-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.man-save { font-size: 12px; color: var(--muted); margin-left: 6px; }
.man-save.err { color: var(--danger); }
.rt-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.rt-bar button { border: 1px solid var(--line2); background: var(--surface); border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.rt-bar button:hover { background: var(--surface2); }
.man-ed { padding: 14px 16px 60px; display: flex; flex-direction: column; gap: 12px; }
.man-crumb { font-size: 12.5px; color: var(--muted); }
.man-h { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.man-card { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.man-card h4 { margin: 0; }
.man-in { width: 100%; border: 1px solid var(--line2); border-radius: 7px; padding: 7px 9px; font: inherit; background: var(--surface); }
.man-row { display: flex; align-items: flex-start; gap: 6px; }
.man-row > .rt { flex: 1; }
.man-row .n { color: var(--muted); font-size: 12px; min-width: 2.6em; padding-top: 4px; }
.man-row .lnk { text-align: left; }
.grow { flex: 1; }
.man-roles { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.man-danger { margin: 8px 0 0; }

/* Texte riche */
.rt { min-height: 34px; border: 1px solid var(--line2); border-radius: 7px; padding: 6px 9px; background: var(--surface); line-height: 1.5; font-size: 14px; outline: none; }
.rt:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #fde3d3; }
.rt.one { min-height: 0; }
.rt:empty::before { content: attr(data-ph); color: #a3a9b3; }
.rt[contenteditable="false"] { background: var(--surface2); }
.rt .ui { font-weight: 600; }
.rt .ui::before { content: "« "; font-weight: 400; color: var(--muted); }
.rt .ui::after { content: " »"; font-weight: 400; color: var(--muted); }
.rt .mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e8590c; color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.rt kbd, .rt code { font: 12px ui-monospace, Menlo, monospace; background: var(--surface2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

/* Blocs */
.man-blocks { display: flex; flex-direction: column; gap: 10px; }
.man-blk { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.man-blk-h { display: flex; align-items: center; gap: 2px; padding: 4px 6px 4px 10px; border-bottom: 1px solid var(--line); background: var(--surface2); border-radius: 10px 10px 0 0; }
.man-blk-t { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.man-blk-b { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.man-blk.t-note .man-blk-h { background: #fff7e6; }
.man-blk.t-figure .man-blk-h, .man-blk.t-side .man-blk-h { background: #eef2fb; }
.man-bul { color: var(--muted); font-size: 12px; min-width: 1.4em; padding-top: 7px; text-align: right; }
.man-marks { width: 64px; border: 1px solid var(--line2); border-radius: 7px; padding: 6px; font: 12px ui-monospace, Menlo, monospace; text-align: center; background: #fff3ec; }
.man-note-k { display: flex; gap: 8px; align-items: flex-start; }
.man-note-k select { border: 1px solid var(--line2); border-radius: 7px; padding: 6px; }
.man-note-k .rt { flex: 1; font-weight: 600; }
.man-tbl { overflow-x: auto; }
.man-tbl table { border-collapse: collapse; width: 100%; }
.man-tbl th, .man-tbl td { padding: 3px; vertical-align: top; min-width: 110px; }
.man-tbl th .rt { background: var(--surface2); font-weight: 600; font-size: 12.5px; }
.man-tbl .rt { font-size: 13px; min-height: 30px; }
.man-tbl-btns, .man-fig-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.man-add { display: flex; justify-content: center; }
.man-add .btn { border: 1px dashed var(--line2); }
.man-dd { position: fixed; z-index: 60; min-width: 230px; }
.man-dd .dd-h { font-size: 11.5px; color: var(--muted); padding: 6px 10px; max-width: 260px; white-space: normal; }

/* Figure dans l'éditeur */
.man-fig { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: 12px; align-items: start; }
.man-fig-img { background: transparent; font-size: 12px; }
.man-fig-img .figwrap { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.man-fig-f { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.man-fig-f select { border: 1px solid var(--line2); border-radius: 7px; padding: 6px; }
.man-fig-meta { font-size: 12px; color: var(--muted); }
.man-side-blocks { border-left: 3px solid #e1effe; padding-left: 10px; display: flex; flex-direction: column; gap: 8px; }
.man-sub { font-size: 12px; color: var(--muted); }

/* Aperçu (à droite) */
.man-bar .man-bar-t { font-weight: 600; }
.man-preview { flex: 1; overflow: auto; background: #fff; padding: 26px 20px 80px; }
.man-preview .man-doc { margin: 0 auto; }
.man-preview .man-doc section.chapter { padding-top: 0; }
.man-preview .man-doc header.cover .print-toc { display: none; }

/* Points à valider */
.man-iss-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.man-iss-top .lang-sw { background: var(--surface2); border-radius: 8px; padding: 2px; display: inline-flex; }
.man-iss-top .lang-sw button { border: 0; background: none; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.man-iss-top .lang-sw button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.man-iss-banner { background: #fff7e6; border: 1px solid #f6dfb4; border-radius: 9px; padding: 8px 12px; font-size: 13px; }
.man-iss { border: 1px solid var(--line); border-left: 4px solid #8b95a5; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.man-iss.k-q { border-left-color: #1a5fd0; }
.man-iss.k-b { border-left-color: var(--danger); }
.man-iss.k-c, .man-iss.k-p { border-left-color: var(--primary); }
.man-iss.done { opacity: .7; }
.man-iss.focus { box-shadow: 0 0 0 3px #fde3d3; }
.man-iss-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.man-k-q { background: #e1effe; color: #1e429f; }
.man-k-b { background: #fdecea; color: #9b1c1c; }
.man-k-c, .man-k-p { background: #fff1e8; color: #b44a05; }
.man-k-n { background: #e5e7eb; color: #374151; }
.man-cat { color: var(--muted); }
.man-dec { margin-left: auto; color: var(--muted); }
.man-iss-t { font-weight: 600; }
.man-iss-b { font-size: 13.5px; color: #3b4250; }
.man-iss-b code, .man-iss-t code { font-size: 12px; background: var(--surface2); padding: 0 4px; border-radius: 4px; }
.man-iss-sec { align-self: flex-start; font-size: 12.5px; }
.man-ans textarea { width: 100%; }
.man-iss-act { display: flex; gap: 8px; align-items: center; }
.man-res { color: var(--ok); font-size: 12.5px; font-weight: 600; }
.man-iss-new .modal-b { margin-top: 4px; }

/* Éditeur de repères */
.man-figed { width: min(1220px, 96vw); max-width: none; }
.mfe { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; max-height: 68vh; }
.mfe-stage { overflow: auto; background: var(--surface2); border-radius: 10px; padding: 12px; }
.mfe-img { max-width: 100%; background: transparent; }
.mfe-img .figwrap { cursor: crosshair; user-select: none; touch-action: none; }
.mfe-img img { pointer-events: none; }
.mfe-mk { position: absolute; border: 2px dashed transparent; border-radius: 6px; cursor: move; }
.mfe-mk:hover { border-color: rgba(26, 95, 208, .6); }
.mfe-mk.on { border-color: #1a5fd0; background: rgba(26, 95, 208, .08); }
.mfe-rs { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border-radius: 3px; background: #1a5fd0; cursor: nwse-resize; display: none; }
.mfe-mk.on .mfe-rs, .mfe-mk:hover .mfe-rs { display: block; }
.mfe-list { overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.mfe-row { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 8px; cursor: pointer; }
.mfe-row.on { background: #e8f0fd; }
.mfe-row select { flex: 1; border: 1px solid var(--line2); border-radius: 6px; padding: 4px; font-size: 12.5px; }
.mark-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e8590c; color: #fff; font-size: 12px; font-weight: 700; flex: none; }

/* ---------- Studios : sélecteur, page d'accueil ---------- */
.studio-sw { display: flex; align-items: center; gap: 2px; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.studio-sw button { border: 0; background: none; cursor: pointer; border-radius: 7px; padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.studio-sw button:hover { color: var(--text); background: #e9ecf1; }
.studio-sw .studio-home { padding: 6px 8px; font-size: 14px; }
.studio-sw .dot, .studio-card .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--primary); box-shadow: 4px 4px 0 -1px #5b9bd5; flex: none; }
.studio-sw .dot.m, .studio-card .dot.m { background: #1a5fd0; box-shadow: 4px 4px 0 -1px #f5a524; }
.app[data-studio="specsheet"] .studio-b[data-studio-go="specsheet"],
.app[data-studio="manuels"] .studio-b[data-studio-go="manuels"],
.app[data-studio=""] .studio-home { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.app[data-studio="specsheet"] [data-studio="manuels"],
.app[data-studio="manuels"] [data-studio="specsheet"],
.app[data-studio=""] .nav, .app[data-studio=""] .qsearch { display: none !important; }

.studios { max-width: 980px; margin: 0 auto; padding: 56px 24px 80px; }
.studios h1 { font-size: 30px; margin: 0 0 6px; }
.studios-sub { color: var(--muted); margin: 0 0 28px; }
.studio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.studio-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-align: left; padding: 26px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); transition: box-shadow .15s, border-color .15s; }
.studio-card:hover { border-color: #c9ced6; box-shadow: 0 12px 32px rgba(16,24,40,.08); }
.studio-card .studio-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #fff1e8; }
.studio-card.s-manuels .studio-ic { background: #e8f0fd; }
.studio-card .studio-ic .dot { width: 18px; height: 18px; border-radius: 5px; box-shadow: 6px 6px 0 -2px #5b9bd5; }
.studio-card.s-manuels .studio-ic .dot { box-shadow: 6px 6px 0 -2px #f5a524; }
.studio-card b { font-size: 20px; }
.studio-d { color: var(--muted); font-size: 14px; line-height: 1.5; }
.studio-k { font-size: 13px; font-weight: 600; background: var(--surface2); border-radius: 99px; padding: 3px 10px; }
.studio-go { margin-top: auto; color: var(--primary); font-weight: 600; font-size: 14px; }
.studio-card.s-manuels .studio-go { color: #1a5fd0; }

/* ---------- Manuel Studio : liste des manuels, points à valider ---------- */
.man-page { max-width: 1060px; margin: 0 auto; padding: 32px 24px 80px; display: flex; flex-direction: column; gap: 12px; }
.man-page h1 { margin: 0; font-size: 26px; }
.man-page-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.man-sub { color: var(--muted); margin: 4px 0 0; }
.man-mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.man-mcard { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.man-mcard-main { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; border: 0; background: none; padding: 18px; cursor: pointer; font: inherit; color: var(--text); }
.man-mcard-main:hover { background: var(--surface2); }
.man-mcard b { font-size: 17px; }
.man-mk { color: #1a5fd0; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.man-mstats { color: var(--muted); font-size: 13px; }
.man-mrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.man-mact { display: flex; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--surface2); }
.man-back { font-size: 12.5px; align-self: flex-start; }
.man-iss-pick { border: 1px solid var(--line2); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; }
.man-iss-m { font-weight: 700; color: var(--text); }
.man-slug { display: flex; align-items: center; gap: 4px; }
.man-slug span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.man-slug input { flex: 1; }

/* ---------- Claude dans l'éditeur ---------- */
.man-ai { display: block; border: 1px solid #d9d2f5; background: #f8f6ff; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.man-ai > * + * { margin-top: 8px; }
.man-ai summary { cursor: pointer; display: flex; justify-content: flex-start; align-items: baseline; gap: 10px; list-style: none; padding: 0; margin: 0; }
.man-ai summary::before { content: '›'; color: #5b3fd0; transition: transform .15s; }
.man-ai[open] summary::before { transform: rotate(90deg); }
.man-ai summary::-webkit-details-marker { display: none; }
.man-ai summary b { color: #5b3fd0; }
.man-ai.off { color: var(--muted); }
.man-ai textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; resize: vertical; background: var(--surface); }
.man-ai-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.man-ai-img { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.man-ai-err { color: #a5322a; margin: 0; }
.man-ai-cost { display: block; color: var(--muted); margin-top: 4px; font-size: 11.5px; }
.man-ai-diff { display: flex; flex-direction: column; gap: 6px; }
.man-ai-diff .man-doc { font-size: 12.5px; line-height: 1.45; border-radius: 7px; padding: 6px 10px; }
.man-ai-diff .man-doc > :first-child { margin-top: 0; }
.man-ai-diff .man-doc > :last-child { margin-bottom: 0; }
.man-ai-old { background: #fdf0ee; border-left: 3px solid #e3a59c; text-decoration: line-through; text-decoration-color: rgba(165, 50, 42, .45); }
.man-ai-new { background: #eef8f1; border-left: 3px solid #8fcca4; }
.man-ai-cap { color: var(--muted); font-style: italic; }
.man-iss-ai { margin: 4px 0; }
.man-review progress { display: block; width: 100%; margin-top: 6px; height: 6px; }

.man-site-h { font-size: 15px; margin: 14px 0 2px; color: var(--muted); font-weight: 600; }
.man-slug-prev { margin: -4px 0 0; font-size: 12px; }
.man-fixed { font-size: 13px; padding: 7px 0; }
.man-fixed small { color: var(--muted); display: block; }

.man-page-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.man-imp-st { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 13.5px; }
.man-imp-st > span { width: 16px; text-align: center; color: var(--muted); }
.man-imp-st.ok > span { color: var(--ok); }
.man-imp-st.err > span, .man-imp-st.err small { color: #a5322a; }
.man-imp-st.run { font-weight: 600; }
.man-imp-st.wait { color: var(--muted); }
.man-imp-st small { color: var(--muted); font-weight: 400; margin-left: auto; padding-left: 10px; }

.man-fix-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.man-fix-go { color: #5b3fd0; border-color: #d9d2f5; background: #f8f6ff; }
.man-fix { margin-top: 6px; }
.man-fix-ans { white-space: normal; background: var(--surface2); border-radius: 7px; padding: 8px 10px; }
.man-fix-fig { max-width: 420px; }

.man-trash { order: 99; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); margin-top: 14px; }
.man-trash summary { padding: 10px 14px; }
.man-trash-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.man-trash-row small { display: block; color: var(--muted); }
