:root {
  --bg: #eef0f3;
  --surface: #ffffff;
  --surface2: #f6f7f9;
  --line: #e2e5ea;
  --line2: #d3d7de;
  --text: #1d2026;
  --muted: #6a717d;
  --primary: #e8640a;
  --primary-ink: #ffffff;
  --danger: #c93a2f;
  --ok: #1f8a4c;
  --stage: #2b2d31;
  --radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }

.app { display: flex; flex-direction: column; height: 100vh; }

/* Top bar */
.topbar {
  height: 54px; flex: none; display: flex; align-items: center; gap: 28px;
  padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.logo-mark { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
.logo-mark .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--primary); box-shadow: 5px 5px 0 -1px #5b9bd5; }
.nav { display: flex; gap: 4px; }
.nav button { border: 0; background: none; padding: 8px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.nav button:hover { background: var(--surface2); color: var(--text); }
.nav button.on { background: #fff1e8; color: #b44a05; font-weight: 600; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.status { color: var(--muted); font-size: 12px; margin-right: 8px; }
.status.err { color: var(--danger); }

/* Buttons */
.btn {
  border: 1px solid var(--line2); background: var(--surface); padding: 8px 14px; border-radius: 7px;
  cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn.danger:hover { background: #fdecea; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.x {
  border: 0; background: none; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; color: var(--muted); flex: none;
}
.x:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.x:disabled { opacity: .3; cursor: default; }

/* Layout */
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr 400px; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-top { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.search, .side-top select { width: 100%; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 7px; background: var(--surface); }
.side-list { overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.item { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; width: 100%; }
.item:hover { background: var(--surface2); }
.item.on { background: #fff1e8; }
.item .thumb { width: 42px; height: 42px; flex: none; border-radius: 7px; background: #1c1c1e; display: grid; place-items: center; overflow: hidden; }
.item .thumb img { max-width: 90%; max-height: 90%; object-fit: contain; }
.item .meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.item .meta strong { font-size: 13px; }
.item .meta span, .item .meta em { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta em { font-style: normal; font-size: 11px; opacity: .8; }
.empty { color: var(--muted); padding: 12px; }

/* Stage */
.stage { background: var(--stage); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #222327; border-bottom: 1px solid #34363b; color: #d6d8dc; }
.stage-bar .btn.ghost { color: #d6d8dc; }
.stage-bar .btn.ghost:hover { background: #34363b; }
.zoom { display: flex; align-items: center; gap: 2px; }
.zoom span { min-width: 48px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.warn { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; font-size: 12px; }
.warn span { padding: 4px 10px; border-radius: 99px; }
.warn .bad { background: #5a221d; color: #ffc9c2; }
.warn .todo { background: #4a3a17; color: #ffd98a; }
.warn .ok { background: #1d3d2b; color: #a7e7c0; }
.stage-scroll { flex: 1; overflow: auto; padding: 28px; }
.zoom-box { position: relative; margin: 0 auto; }
.zoomer { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.zoomer .sheet { display: flex; flex-direction: column; gap: 28px; }
.zoomer .page { box-shadow: 0 6px 30px rgba(0,0,0,.45); }
.blank { margin: auto; text-align: center; color: #d6d8dc; }

/* Editor */
.editor { background: var(--surface); border-left: 1px solid var(--line); overflow: auto; padding: 0 0 40px; }
.ed-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 14px 16px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ed-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.ed-title { font-weight: 700; font-size: 15px; margin-top: 2px; }
.ed-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
.tip { margin: 12px 16px 4px; padding: 9px 11px; background: #f2f6fc; border-radius: 7px; color: #3c5679; font-size: 12.5px; line-height: 1.45; }
details { border-bottom: 1px solid var(--line); }
summary { padding: 13px 16px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::before { content: '›'; display: inline-block; width: 16px; transition: transform .15s; color: var(--muted); }
details[open] summary::before { transform: rotate(90deg); }
summary em { margin-left: auto; font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.pbody { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f > span { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; }
.f .count { font-style: normal; font-size: 11px; }
.f input, .f select, .f textarea, .kf input, .rowf input, .rowf textarea, .secf-t input, .chip-f input, .acc-add select, .locw input, .locw textarea, .varf input, .srcf input, .boxf input, .valf input, .valf select, .tblf input, .src-sel, .issf-h select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surface); min-width: 0;
}
.f textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid #f5b88d; outline-offset: -1px; border-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-color > div { display: flex; gap: 6px; }
.f-color input[type=color] { width: 40px; padding: 2px; height: 34px; flex: none; }
.f-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.imgf { display: flex; gap: 10px; align-items: center; }
.imgf-th { width: 76px; height: 56px; border-radius: 6px; background: #1c1c1e; display: grid; place-items: center; overflow: hidden; flex: none; }
.imgf-th img { max-width: 92%; max-height: 92%; object-fit: contain; }
.imgf-th em { color: #8a8a8e; font-size: 11px; font-style: normal; }
.imgf-b { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.imgf-b small { width: 100%; color: var(--muted); font-size: 11px; }

.kf { display: grid; grid-template-columns: 34px 1fr 1.3fr; gap: 6px; align-items: center; }
.ic-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--primary); background: #fff7f1; color: var(--primary); display: grid; place-items: center; cursor: pointer; }
.ic-btn.on { background: var(--primary); color: #fff; }
.ic-btn svg, .ic-grid svg { width: 16px; height: 16px; }
.ic-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 8px; background: var(--surface2); border-radius: 8px; }
.ic-grid button { aspect-ratio: 1; border: 1px solid transparent; background: var(--surface); border-radius: 6px; cursor: pointer; display: grid; place-items: center; color: #444; }
.ic-grid button:hover { border-color: var(--line2); }
.ic-grid button.on { border-color: var(--primary); color: var(--primary); }

.badges-f { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chip-f { display: flex; gap: 2px; align-items: center; }

.secf { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 5px; background: var(--surface2); }
.secf-h { display: flex; gap: 2px; align-items: center; }
.secf-t { font-weight: 600; text-transform: uppercase; font-size: 12px !important; letter-spacing: .03em; }
.rowf { display: grid; grid-template-columns: 1fr repeat(var(--nc, 1), 1.25fr) auto 26px 26px; gap: 4px; align-items: start; }
.rowf input, .rowf textarea { font-size: 12.5px; padding: 5px 7px; }
.rowf textarea.mini { resize: none; overflow: hidden; min-height: 29px; line-height: 1.35; }
.rowf .x { margin-top: 2px; }
.secf > .btn { align-self: flex-start; }

.accf { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.accf-h { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.acc-add { display: flex; gap: 6px; align-items: center; }
.acc-add select { flex: 1; }

/* Modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15,17,21,.45); display: grid; place-items: center; z-index: 20; }
.modal { background: var(--surface); border-radius: 12px; padding: 22px; width: min(480px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { margin: 0 0 4px; font-size: 18px; }
.modal-b { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1d2026; color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 13px; z-index: 30; transition: opacity .4s; }
.toast.out { opacity: 0; }

@media (max-width: 1100px) {
  .main { grid-template-columns: 210px 1fr 340px; }
}

/* Print: only the spec sheet copy is printed */
/* Off-screen (but laid out) so the sheet can be measured before printing. */
#print-root { position: absolute; left: -20000px; top: 0; }
.print-mode .app { display: none; }
.print-mode #print-root { position: static; }
@media print {
  @page { size: 8.5in 11in; margin: 0; }
  html, body { height: auto; background: #fff; }
  .app, #modal-root, .toast { display: none !important; }
  #print-root { position: static; }
  #print-root .page { break-after: page; }
  #print-root .page:last-child { break-after: auto; }
  #print-root .sheet-wrap:not(:last-child) .page:last-child { break-after: page; }
  #batch-chip { display: none !important; }
}

/* ---------- v2 additions ---------- */
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.btn.ok { color: var(--ok); border-color: #b9dfc7; background: #f1faf4; }
.btn.ghost-dark { background: transparent; border-color: #4a4c52; color: #e6e7ea; }
.btn.ghost-dark:hover { background: #34363b; }
.btn.primary:disabled { background: #6b5a4e; border-color: #6b5a4e; color: #c9c1bb; filter: none; }

.lt { font-style: normal; font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.lt-fr { background: #e7eefc; color: #2c4f8f; }
.lt-en { background: #fdf0dc; color: #8a5a10; }
.locw { position: relative; display: flex; gap: 4px; align-items: stretch; min-width: 0; }
.locw > input, .locw > textarea { flex: 1; min-width: 0; }
.copyfr { flex: none; border: 1px solid #ecd3a6; background: #fdf6ea; color: #8a5a10; border-radius: 6px; font-size: 10.5px; font-weight: 700; padding: 0 7px; cursor: pointer; }
.copyfr:hover { background: #fbe9c9; }

.lang-sw { display: flex; background: #18191c; border: 1px solid #3a3c41; border-radius: 8px; padding: 2px; }
.lang-sw button { border: 0; background: none; color: #a9abb1; font-weight: 700; font-size: 12px; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.lang-sw button.on { background: #e8640a; color: #fff; }
.exp { display: flex; gap: 6px; }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.dot.st-ok { background: #2fa463; } .dot.st-todo { background: #e5a52b; } .dot.st-bad { background: #d9493b; }
.st-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.st-pill.st-ok { background: #e3f5ea; color: #1f7a47; } .st-pill.st-todo { background: #fdf1d8; color: #8a5a10; } .st-pill.st-bad { background: #fde5e2; color: #a5322a; }
.stcard { margin: 12px 16px 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface2); }
.st-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.st-rev { font-size: 12px; color: var(--muted); }
.st-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.st-nums > * { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.st-nums button { cursor: pointer; }
.st-nums button:hover { border-color: var(--line2); }
.st-nums b { font-size: 18px; }
.st-nums span { font-size: 11px; color: var(--muted); line-height: 1.25; }

.cert-pick { display: flex; flex-wrap: wrap; gap: 5px; }
.cert-chip { border: 1px solid var(--line2); background: var(--surface); border-radius: 6px; padding: 4px 9px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); }
.cert-chip.on { background: #1d2026; color: #fff; border-color: #1d2026; }
.cert-chip.add { border-style: dashed; }

.list-f { display: flex; flex-direction: column; gap: 6px; }
.chip-f .locw { flex: 1; }
.varf, .srcf, .boxf, .valf { display: grid; gap: 5px; align-items: center; }
.varf { grid-template-columns: 130px 1fr 26px; }
.srcf { grid-template-columns: 26px 1fr 90px 26px; font-size: 12px; }
.boxf { grid-template-columns: 54px 1fr 26px; }
.valf { grid-template-columns: 1fr 74px auto 26px; margin-bottom: 4px; }
.src-sel { width: 52px !important; padding: 5px 2px !important; font-size: 11px; color: var(--muted); }
.secf-t { flex: 1; }
.secf-t input { font-weight: 600; text-transform: uppercase; font-size: 12px !important; letter-spacing: .03em; }

.blkf { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface2); }
.blkf-h { display: flex; align-items: center; gap: 2px; font-size: 13px; }
.blkf-h strong { flex: 1; }
.tblf { display: grid; grid-template-columns: repeat(var(--nc), 1fr) 26px; gap: 4px; }
.tblf .th input { font-weight: 700; }

.issf { border: 1px solid var(--line); border-left: 4px solid var(--line2); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.issf.iss-conflict { border-left-color: #d9493b; } .issf.iss-check { border-left-color: #e5a52b; } .issf.iss-missing { border-left-color: #3b82c4; } .issf.iss-fixed { border-left-color: #2fa463; }
.filters { display: flex; flex-direction: column; gap: 6px; }
.filters select { width: 100%; padding: 6px 9px; border: 1px solid var(--line2); border-radius: 7px; background: var(--surface); font-size: 12.5px; }
.issf.done { opacity: .6; }
.issf-h { display: flex; align-items: center; gap: 6px; }
.issf-h select { flex: 1; font-weight: 600; }
.iss-n { width: 22px; height: 22px; flex: none; border-radius: 50%; background: #f5c518; color: #1d2026; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.iss-n.done { background: #2fa463; color: #fff; }
.issf .f textarea { font-size: 12.5px; }

/* Report view */
.main.report-mode { grid-template-columns: 1fr; }
.report { overflow: auto; background: var(--surface); }
.report-bar { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 18px 28px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; z-index: 2; }
.report-bar h1 { margin: 0 0 4px; font-size: 20px; }
.report-bar p { margin: 0; color: var(--muted); font-size: 13px; max-width: 640px; }
.report-act { display: flex; gap: 8px; align-items: center; }
.report-act select { padding: 7px 10px; border: 1px solid var(--line2); border-radius: 7px; }
.report-body { padding: 8px 28px 40px; max-width: 1280px; }
.report-body h2 { font-size: 15px; color: var(--muted); font-weight: 600; }
.report-body h3, .report-print h3 { font-size: 15px; margin: 26px 0 8px; }
.report-body h3 em, .report-print h3 em { font-style: normal; color: var(--muted); font-weight: 400; }
table.rep { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.rep th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.rep td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
table.rep small { color: var(--muted); }
table.rep.sum { max-width: 820px; }
.rep-row { cursor: pointer; }
.rep-row:hover td { background: var(--surface2); }
.ann-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.report .t-conflict, .report-print .t-conflict { background: #fde5e2; color: #a5322a; }
.report .t-check, .report-print .t-check { background: #fdf1d8; color: #8a5a10; }
.report .t-missing, .report-print .t-missing { background: #e3effb; color: #24598a; }
.report .t-fixed, .report-print .t-fixed { background: #e3f5ea; color: #1f7a47; }
.report-print { font-family: 'Inter', sans-serif; color: #1d2026; padding: 0.5in; font-size: 11px; }
.report-print table.rep { font-size: 10.5px; }
.report-print td.decide { width: 150px; }
.report-print h2 { font-size: 18px; margin: 0 0 12px; }
.report-print tr { break-inside: avoid; }

/* ---------- v3: explorer, tabs, table, clickable items ---------- */
.side-list.tree { padding: 6px 6px 20px; gap: 0; }
.tcat { border-bottom: 1px solid var(--line); }
.tcat-h { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 9px 6px; cursor: pointer; text-align: left; font-size: 13px; border-radius: 6px; }
.tcat-h:hover { background: var(--surface2); }
.tcat-h b { flex: 1; font-weight: 600; }
.chev { width: 12px; color: var(--muted); transition: transform .15s; display: inline-block; }
.tcat.open .chev { transform: rotate(90deg); }
.tcat-n { font-size: 11.5px; color: var(--muted); }
.tcat-bad { font-size: 10.5px; font-weight: 700; color: #a5322a; background: #fde5e2; border-radius: 99px; padding: 1px 7px; }
.tcat-b { padding: 0 0 8px 8px; display: flex; flex-direction: column; gap: 1px; }
.tsub { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 8px 3px; }
.titem { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 5px 6px; border-radius: 7px; cursor: pointer; text-align: left; }
.titem:hover { background: var(--surface2); }
.titem.on { background: #fff1e8; }
.titem .thumb { width: 30px; height: 30px; flex: none; border-radius: 6px; background: #1c1c1e; display: grid; place-items: center; overflow: hidden; }
.titem .thumb img { max-width: 90%; max-height: 90%; object-fit: contain; }
.titem .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.titem .meta strong { font-size: 12.5px; }
.titem .meta span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tstat { display: flex; align-items: center; gap: 4px; flex: none; }
.tstat .dot { margin: 0; }
.tstat em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #8a5a10; }

.editor .stcard { margin: 12px 14px 0; }
.ptabs { position: sticky; top: 0; z-index: 3; display: flex; gap: 2px; padding: 10px 14px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.ptabs button { border: 0; background: none; padding: 8px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; }
.ptabs button.on { color: var(--text); border-bottom-color: var(--primary); }
.ptabs button b { background: #f5c518; color: #1d2026; border-radius: 99px; padding: 0 6px; font-size: 11px; margin-left: 3px; }
.ptab-body .ed-head { position: static; }
.pbody.pad { padding: 14px; }

.iss-go { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: 0; background: var(--surface2); border-radius: 6px; padding: 8px 10px; cursor: pointer; font: inherit; }
.iss-go:hover { background: #eef2f8; }
.iss-go-l { font-size: 12px; font-weight: 700; }
.iss-go-n { font-size: 12px; color: var(--muted); line-height: 1.35; }
.issf.focus { box-shadow: 0 0 0 2px #f5c518; }

.assist { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.assist-h { display: flex; gap: 10px; align-items: center; }
.assist-h .spark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #e8640a, #f5a25d); flex: none; }
.assist-h small { display: block; color: var(--muted); font-size: 12px; }
.assist-ex { display: flex; flex-wrap: wrap; gap: 6px; }
.assist-ex span { border: 1px solid var(--line2); border-radius: 99px; padding: 5px 10px; font-size: 12px; color: var(--muted); }
.assist-in { display: flex; flex-direction: column; gap: 6px; }
.assist-in textarea { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; resize: vertical; background: var(--surface2); }

.mk-pop { position: fixed; z-index: 40; width: 320px; background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.mkp-it { display: flex; gap: 8px; line-height: 1.4; }
.mkp-it small { display: block; color: var(--muted); margin-top: 2px; }
.mk-pop .btn { align-self: flex-start; }
.sheet.mode-edit .has-mk { cursor: pointer; }

.tableview .report-act input { padding: 7px 10px; border: 1px solid var(--line2); border-radius: 7px; width: 200px; }
.report-body.wide { max-width: none; }
table.rep.fiches td { vertical-align: middle; padding: 6px 10px; }
table.rep th.sortable { cursor: pointer; user-select: none; }
table.rep th.sortable.on { color: var(--text); }
.thumb.sm { width: 32px; height: 32px; border-radius: 6px; background: #1c1c1e; display: grid; place-items: center; overflow: hidden; }
.thumb.sm img { max-width: 90%; max-height: 90%; object-fit: contain; }
.bulk { position: sticky; top: 86px; z-index: 2; margin: 10px 28px 0; display: flex; gap: 8px; align-items: center; background: #1d2026; color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.bulk select { padding: 5px 8px; border-radius: 6px; border: 0; }
.bulk .btn.danger { color: #ffb4ab; }
.bulk select, .bulk .btn { color: #1d2026; }
.bulk .btn.danger { color: #c93a2f; background: #fff; }

/* ---------- online: login, users, assistant ---------- */
.login-mode .nav, .login-mode .top-r button { display: none; }
.main:has(.login) { grid-template-columns: 1fr; }
.login { display: grid; place-items: center; background: var(--bg); }
.login-card { width: min(420px, calc(100vw - 32px)); background: var(--surface); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.login-card h1 { margin: 6px 0 0; font-size: 22px; }
.login-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13.5px; }
.login-msg { background: #f2f6fc; color: #2c4f8f !important; border-radius: 8px; padding: 10px 12px; }
.me { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-right: 6px; }
.invite { display: flex; gap: 8px; margin: 12px 0 6px; }
.invite input, .invite select { padding: 8px 10px; border: 1px solid var(--line2); border-radius: 7px; }
.invite input[type=email] { width: 260px; }
.role-sel { padding: 4px 8px; border: 1px solid var(--line2); border-radius: 6px; }
.assist-ex button { border: 1px solid var(--line2); background: var(--surface); border-radius: 99px; padding: 5px 10px; font-size: 12px; color: var(--text); cursor: pointer; text-align: left; }
.assist-ex button:hover { border-color: var(--primary); }
.assist-in textarea:not(:disabled) { background: var(--surface); }
.ai-row { display: flex; justify-content: space-between; align-items: center; }
.ai-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-file { display: inline-flex; align-items: center; gap: 2px; background: var(--surface2); border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 12px; }
.ai-res { display: flex; flex-direction: column; gap: 8px; }
.ai-sum { margin: 0; font-size: 13px; line-height: 1.5; background: var(--surface2); border-radius: 8px; padding: 10px 12px; }
.ai-all { display: flex; gap: 6px; }
.ai-it { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.ai-l { font-weight: 700; font-size: 12px; }
.ai-v { line-height: 1.45; }
.ai-v s { color: #a5322a; }
.ai-v ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.ai-v small { display: block; color: var(--muted); margin-top: 2px; }
.ai-v img { max-width: 100%; max-height: 160px; border-radius: 6px; background: #fff; border: 1px solid var(--line); display: block; }
.ai-ch { display: flex; gap: 4px; }
.ai-ch button { border: 1px solid var(--line2); background: var(--surface); border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.ai-ch button.on.yes { background: var(--ok); border-color: var(--ok); color: #fff; }
.ai-ch button.on.no { background: #fde5e2; border-color: #f3b8b1; color: #a5322a; }

.ai-ch .yes { background: var(--ok); border-color: var(--ok); color: #fff; }
.ai-ch .yes:disabled { opacity: .5; }
.ai-state { font-size: 12px; font-weight: 600; color: var(--muted); padding: 3px 4px; }
.ai-state.ok { color: var(--ok); }
.ai-it.is-applied { background: #f1faf4; border-color: #b9dfc7; }
.ai-it.is-ignored { opacity: .55; }
.ai-all { align-items: center; }

/* ---------- v4: cleanup, menus, home, review, quick open ---------- */
:root { font-size: 14px; }
.topbar { gap: 22px; }
.nav button { font-size: 13.5px; }
.nav-n { font-weight: 700; font-size: 10.5px; background: #f5c518; color: #1d2026; border-radius: 99px; padding: 1px 6px; margin-left: 3px; }
.nav-n:empty { display: none; }
.qsearch { display: flex; align-items: center; gap: 18px; border: 1px solid var(--line2); background: var(--surface2); border-radius: 8px; padding: 6px 8px 6px 12px; color: var(--muted); cursor: pointer; font-size: 13px; }
.qsearch:hover { border-color: #b9bfc8; }
kbd { font-family: inherit; font-size: 11px; background: var(--surface); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); }
.btn.icon { padding: 5px 9px; font-size: 15px; line-height: 1; min-width: 32px; }
.btn.icon.on { background: #fff1e8; color: #b44a05; }
.status { font-size: 12px; color: var(--ok); }
.status.err { color: var(--danger); }
.me-av { width: 28px; height: 28px; border-radius: 50%; background: #1d2026; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; cursor: default; }

.dd-menu { position: fixed; z-index: 50; min-width: 250px; max-width: 340px; background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); padding: 6px; }
.dd-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.dd-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; }
.dd-it { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.dd-it:hover:not([disabled]) { background: var(--surface2); }
.dd-it small { color: var(--muted); font-size: 12px; }
.dd-it[disabled] { cursor: not-allowed; }
.dd-it[disabled] span { color: var(--muted); }
.dd-it[disabled] small { color: #b7791f; }
.dd-it.danger span { color: var(--danger); }

.side-row { display: flex; gap: 6px; }
.side-row .search { flex: 1; }
.filters[hidden] { display: none; }
.titem .meta strong { font-size: 13px; }
.titem .meta span { font-size: 12px; }
.tcat-h { font-size: 13.5px; }
.tprog { width: 44px; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; flex: none; }
.tprog i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.tprog.wide { width: auto; flex: 1; }
.tcat-n { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

.phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 4px; }
.phead-k { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.phead-n { font-size: 16px; line-height: 1.3; margin-top: 2px; }
.phead-n b { margin-right: 4px; }
.phead-s { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 16px 10px; font-size: 12.5px; color: var(--muted); }
.phead-s i { font-style: normal; opacity: .5; }
.lnk { border: 0; background: none; padding: 0; color: #a5322a; font-weight: 600; cursor: pointer; font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
.askbar { display: flex; align-items: center; gap: 8px; margin: 0 14px 10px; border: 1px solid var(--line2); border-radius: 10px; padding: 5px 5px 5px 10px; background: var(--surface2); }
.askbar:focus-within { border-color: var(--primary); background: var(--surface); }
.askbar .spark { width: 16px; height: 16px; border-radius: 5px; background: linear-gradient(135deg, #e8640a, #f5a25d); flex: none; }
.askbar input { flex: 1; border: 0; background: none; outline: none; font-size: 13px; min-width: 0; }
.ptabs { padding-top: 0; }
.tip { position: relative; padding-right: 32px; }
.tip .x { position: absolute; top: 4px; right: 4px; }
.f > span { font-size: 12.5px; }
.f input, .f select, .f textarea { font-size: 13.5px; }
summary { font-size: 14px; }

/* Home */
.home .home-in { max-width: 1180px; margin: 0 auto; padding: 32px 28px 60px; }
.home-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.home-top h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.01em; }
.home-top p { margin: 0; color: var(--muted); }
.home-act { display: flex; gap: 8px; }
.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 30px; letter-spacing: -.02em; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi .bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--ok); }
.c-bad { color: #a5322a; } .c-todo { color: #8a5a10; } .c-ok { color: var(--ok); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }
.home-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.home-card h3 { margin: 0 0 8px; font-size: 14px; }
.home-card > .btn { align-self: flex-start; margin-top: 8px; }
.hc-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 6px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13px; }
.hc-row:hover { background: var(--surface2); }
.hc-row > span:first-child:not(.thumb):not(.hc-av) { width: 150px; flex: none; }
.hc-row small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.hc-row b { margin-left: auto; }
.hc-m { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-av { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-weight: 700; font-size: 12px; }

/* Review */
.rv-side .side-top { gap: 8px; }
.rv-count { font-size: 13px; color: var(--muted); }
.rv-count b { font-size: 20px; color: var(--text); margin-right: 3px; }
.rv-filters { display: flex; flex-direction: column; gap: 6px; }
.rv-filters select { padding: 6px 9px; border: 1px solid var(--line2); border-radius: 7px; background: var(--surface); font-size: 12.5px; }
.rv-it { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border: 0; background: none; text-align: left; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.rv-it:hover { background: var(--surface2); }
.rv-it.on { background: #fff1e8; }
.rv-it span:last-child { color: var(--muted); font-size: 12px; }
.rv-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.rv-nav { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.rv-prod { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.rv-prod > div { flex: 1; min-width: 0; }
.rv-prod small { display: block; color: var(--muted); font-size: 11.5px; }
.rv-t { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rv-cur { background: var(--surface2); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.rv-cur small, .rv-vals > small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.rv-note { margin: 0; font-size: 14px; line-height: 1.5; }
.rv-vals { display: flex; flex-direction: column; gap: 6px; }
.rv-val { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.rv-val small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.rv-dec { font-size: 13px; color: var(--muted); }
.rv-actions { display: flex; gap: 8px; }
.main.review-mode .ann-type { font-size: 10px; }
.rv-it .ann-type, .rv-t .ann-type { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 99px; }
.main .ann-type.t-conflict { background: #fde5e2; color: #a5322a; } .main .ann-type.t-check { background: #fdf1d8; color: #8a5a10; } .main .ann-type.t-missing { background: #e3effb; color: #24598a; } .main .ann-type.t-fixed { background: #e3f5ea; color: #1f7a47; }

/* Quick open */
.qk-bg { position: fixed; inset: 0; z-index: 60; background: rgba(15,17,21,.35); display: flex; justify-content: center; padding-top: 12vh; }
.qk { width: min(620px, calc(100vw - 32px)); max-height: 66vh; background: var(--surface); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.qk input { border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 16px; outline: none; }
.qk-list { overflow: auto; padding: 6px; }
.qk-it { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.qk-it.on, .qk-it:hover { background: var(--surface2); }
.qk-m { flex: 1; min-width: 0; }
.qk-m small { display: block; color: var(--muted); font-size: 12px; }
.qk-foot { border-top: 1px solid var(--line); padding: 8px 14px; font-size: 12px; color: var(--muted); display: flex; gap: 5px; align-items: center; }

.status { color: var(--muted); }
.status.saved { color: var(--ok); }
.side-row .btn.icon { font-size: 12.5px; }
.tcat-h b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tprog { width: 34px; }
.tcat-h { flex-wrap: wrap; row-gap: 5px; padding-bottom: 8px; }
.tcat-h b { flex: 1; }
.tcat-h .tprog { order: 3; width: auto; flex: 1 0 calc(100% - 20px); margin-left: 18px; height: 3px; }
.main { grid-template-columns: 266px 1fr 400px; }
@media (max-width: 1100px) { .main { grid-template-columns: 230px 1fr 340px; } }

/* ---------- v5 : travail à plusieurs, historique, assistant en série ---------- */
#me { display: flex; align-items: center; gap: 4px; }
.me-av.other { background: #e9eefc; color: #2f4fb5; box-shadow: 0 0 0 2px var(--surface); }
.me-av.sm { width: 18px; height: 18px; font-size: 9.5px; flex: none; }
.pres { display: inline-flex; align-items: center; gap: 5px; background: #eef2fd; color: #2f4fb5; border-radius: 99px; padding: 2px 9px 2px 3px; font-weight: 600; font-size: 11.5px; }
.pres .me-av.sm { background: #2f4fb5; }
.pres.edit { background: #fff4d6; color: #8a5a10; }
.pres.edit .me-av.sm { background: #c98a12; }
.pres-dot { width: 15px; height: 15px; border-radius: 50%; background: #2f4fb5; color: #fff; font-size: 8.5px; font-weight: 700; display: grid; place-items: center; }
.pres-dot.edit { background: #c98a12; }
.hist { display: flex; flex-direction: column; gap: 8px; }
.hist-it { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: flex; flex-direction: column; gap: 5px; }
.hist-it.on { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(245,197,24,.25); }
.hist-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.hist-h small { color: var(--muted); }
.hist-h .st-pill { margin-left: auto; }
.hist-c { font-size: 12px; color: var(--muted); line-height: 1.45; }
.hist-b { display: flex; gap: 6px; }
.warn .hv { background: #fff4d6; color: #8a5a10; border-radius: 6px; padding: 3px 8px; font-weight: 600; }
.warn .btn { margin-left: 4px; }
.modal.conflict { width: min(520px, calc(100vw - 32px)); }
.modal.conflict p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.cf-diff { display: flex; flex-wrap: wrap; gap: 5px; background: var(--surface2); border-radius: 8px; padding: 10px; }
.cf-diff small { width: 100%; color: var(--muted); font-weight: 600; }
.cf-diff span { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: 12px; }
.ai-btn { display: inline-flex; align-items: center; gap: 6px; }
.ai-btn .spark, .modal h2 .spark { width: 14px; height: 14px; }
.modal h2 { display: flex; align-items: center; gap: 8px; }
#batch-chip { position: fixed; right: 18px; bottom: 18px; z-index: 25; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); max-width: calc(100vw - 32px); }
#batch-chip .bc-t { display: flex; flex-direction: column; gap: 3px; min-width: 210px; }
#batch-chip b { font-size: 13px; }
#batch-chip small { font-size: 11.5px; color: var(--muted); }
#batch-chip .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px; }
.spark.spin { animation: spark-spin 1.6s linear infinite; }
@keyframes spark-spin { to { transform: rotate(360deg); } }
.rv-src { width: 100%; }
.rv-src button { flex: 1; }
.rv-src b { background: #f5c518; color: #1d2026; border-radius: 99px; padding: 0 6px; font-size: 10.5px; margin-left: 3px; }
.rv-run { display: flex; align-items: center; gap: 6px; margin: 0; }
.rv-run .spark { width: 12px; height: 12px; }
.main .ann-type.t-ai { background: #eef2fd; color: #2f4fb5; }
.rv-q { background: var(--surface2); border-radius: 8px; padding: 9px 11px; font-size: 13px; line-height: 1.45; }
.rv-q small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.rv-done { background: #f1faf4; border: 1px solid #b9dfc7; color: var(--ok); border-radius: 8px; padding: 9px 11px; font-size: 13px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spark { display: inline-block; width: 16px; height: 16px; border-radius: 5px; background: linear-gradient(135deg, #e8640a, #f5a25d); flex: none; }
.rv-src.lang-sw { background: var(--surface2); border-color: var(--line); }
.rv-src.lang-sw button { color: var(--muted); padding: 6px 6px; font-size: 11.5px; }
.rv-src.lang-sw button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---------- v6 : export, détourage, publication, discussion, administration ---------- */
.modal.wide { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; border: 1px solid var(--line2); border-radius: 8px; padding: 6px 11px; font-size: 12.5px; background: var(--surface); }
.seg input:checked + span { border-color: var(--primary); background: #fff6db; font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }
.cut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cut-grid figure { margin: 0; }
.cut-grid figcaption { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.cut-box { height: 220px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; background: #fff; }
.cut-box img { max-width: 92%; max-height: 92%; object-fit: contain; }
.cut-box.dark { background: radial-gradient(circle at 50% 40%, #3a3d44, #16171a 75%); border-color: #16171a; }
.cut-box.checker { background: repeating-conic-gradient(#e6e7ea 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.cut-box.sm { height: 110px; }
.cut-box em { color: #a9abb1; font-size: 12px; }
.cut-ctl { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.cut-ctl .f { flex: 1; min-width: 220px; }
.cut-ctl input[type=range] { width: 100%; }
.warnline { color: #8a5a10; min-height: 1em; }
.cut-bulk { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cb-it { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 12px; cursor: pointer; position: relative; }
.cb-it input { position: absolute; top: 12px; left: 12px; z-index: 1; }
.cb-it small { color: #8a5a10; line-height: 1.3; }
.cb-it.off { opacity: .5; }
.pub { display: inline-flex; align-items: center; background: #e8f6ee; color: var(--ok); border-radius: 99px; padding: 2px 9px; font-weight: 600; font-size: 11.5px; text-decoration: none; }
.pub.stale { background: #fff4d6; color: #8a5a10; }
.linkbox { display: flex; gap: 6px; }
.linkbox input { flex: 1; padding: 7px 9px; border: 1px solid var(--line2); border-radius: 7px; font-size: 12.5px; background: var(--surface2); }
.talk { display: flex; flex-direction: column; gap: 8px; }
.talk-it { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.talk-it.done { opacity: .6; }
.talk-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.talk-h small { color: var(--muted); }
.talk-a { margin-left: auto; display: flex; gap: 4px; }
.talk-a button { border: 1px solid var(--line2); background: var(--surface); border-radius: 6px; padding: 2px 8px; font-size: 11.5px; cursor: pointer; }
.talk-b { font-size: 13px; line-height: 1.5; }
.mention { color: #2f4fb5; font-weight: 600; }
.talk-done summary { cursor: pointer; font-size: 12px; color: var(--muted); margin: 4px 0; }
.talk-new { display: flex; flex-direction: column; gap: 6px; position: relative; }
.talk-new textarea { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; resize: vertical; }
.talk-sug { display: flex; flex-wrap: wrap; gap: 4px; }
.talk-sug button { border: 1px solid #c8d3f5; background: #eef2fd; color: #2f4fb5; border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.talk-card { margin-bottom: 14px; }
.adm-h { font-size: 15px; margin: 26px 0 8px; }
.adm-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.adm-b { display: flex; gap: 6px; }
.dec-in { padding: 5px 8px; border: 1px solid var(--line2); border-radius: 6px; font-size: 12.5px; width: 140px; }
.mail-prev { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
@media (max-width: 700px) { .cut-grid { grid-template-columns: 1fr; } .cut-box { height: 170px; } }

/* ---------- v7 : liste repliable, formulaire au centre, aperçu coulissant à droite ---------- */
.main { --side-w: 266px; --split-w: 10px; }
.main.side-off { --side-w: 44px; }
.main.edit-mode { grid-template-columns: var(--side-w) minmax(380px, 1fr) var(--split-w) min(var(--pre-w, 520px), calc(100vw - var(--side-w) - 430px)); }
.main.edit-mode.pre-off { --split-w: 30px; grid-template-columns: var(--side-w) minmax(380px, 1fr) var(--split-w) 0; }
.main.review-mode { grid-template-columns: var(--side-w) 1fr 400px; }
@media (max-width: 1100px) { .main { --side-w: 230px; } .main.side-off { --side-w: 44px; } .main.review-mode { grid-template-columns: var(--side-w) 1fr 340px; } }
.edit-mode .editor { border-left: 0; }
.edit-mode .editor > * { max-width: 880px; margin-left: auto; margin-right: auto; }
.edit-mode .stage-bar { flex-wrap: wrap; row-gap: 8px; }
.pre-off .stage { display: none; }

.side-tog { flex: none; display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; }
.side-tog span { font-size: 15px; line-height: 1; }
.side-tog em { font-style: normal; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.side-tog:hover { color: var(--text); background: var(--surface2); }
.side-off .side > :not(.side-tog) { display: none !important; }
.side-off .side-tog { flex-direction: column; justify-content: flex-start; height: 100%; padding: 14px 0; gap: 10px; border-bottom: 0; }
.side-off .side-tog em { writing-mode: vertical-rl; }

.splitter { position: relative; background: var(--line); cursor: col-resize; touch-action: none; }
.splitter:hover, .dragging .splitter { background: #f3c9a8; }
.dragging, .dragging * { user-select: none; cursor: col-resize !important; }
.dragging .stage { pointer-events: none; }
.pre-tog { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 18px; height: 46px; padding: 0; border: 1px solid var(--line2); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; z-index: 2; }
.pre-tog:hover { color: var(--text); }
.pre-off .splitter { cursor: default; background: var(--surface2); border-left: 1px solid var(--line); }
.pre-off .pre-tog { position: static; transform: none; width: 100%; height: 100%; border: 0; border-radius: 0; background: none; writing-mode: vertical-rl; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 14px 0; }
/* Revue : même disposition que les fiches (liste | décision au centre | aperçu à droite) */
.main.review-mode.edit-mode { grid-template-columns: var(--side-w) minmax(380px, 1fr) var(--split-w) min(var(--pre-w, 520px), calc(100vw - var(--side-w) - 430px)); }
.main.review-mode.edit-mode.pre-off { grid-template-columns: var(--side-w) minmax(380px, 1fr) var(--split-w) 0; }
.review-mode .editor > .rv-card { max-width: 720px; padding-top: 22px; }
.editor .blank { color: var(--muted); padding: 80px 24px; max-width: 520px; }
.editor .blank h2 { color: var(--text); }
.home-card .hc-row > span.ann-type:first-child { width: 42px; flex: none; text-align: center; font-size: 12px; }
.home-card .hc-m { white-space: normal; }
.home-card .hc-m b { margin: 0; display: block; }
.home-card .hc-m small { display: block; color: var(--muted); font-size: 11.5px; white-space: normal; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr 1fr; } }
.home-card .hint .lnk { font-size: inherit; }

/* ---------- v8 : corrections en lot, réponse dans la Revue, annuler, champ suivant ---------- */
.psticky { position: sticky; top: 0; z-index: 3; background: var(--surface); }
.psticky .ptabs { position: static; }
.jumpbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.jb-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.jb-chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 10px; font-size: 12px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.jb-chips button:hover { color: var(--text); border-color: var(--line2); }
.jb-chips i { font-style: normal; background: #fdf1d8; color: #8a5a10; border-radius: 99px; padding: 0 6px; font-size: 10.5px; font-weight: 700; }
.jumpbar .btn b { background: rgba(255,255,255,.25); border-radius: 99px; padding: 0 6px; margin: 0 2px; }
.jb-ok { color: var(--ok); font-weight: 600; font-size: 12.5px; }
.fld-flash { animation: fld-flash 2.2s ease-out; border-radius: 8px; }
@keyframes fld-flash { 0%, 40% { box-shadow: 0 0 0 3px #f5c518; background: #fff9e3; } 100% { box-shadow: 0 0 0 3px transparent; } }
.toast.undo { display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; }
.toast.undo button { border: 0; background: #f5c518; color: #1d2026; font-weight: 700; border-radius: 99px; padding: 5px 14px; cursor: pointer; font-size: 12.5px; }
.rv-answer { display: flex; flex-direction: column; gap: 6px; background: #fff9e8; border: 1px solid #f3dfa4; border-radius: 10px; padding: 10px 12px; }
.rv-answer > small { font-weight: 700; font-size: 12px; color: #8a5a10; }
.rv-answer input { width: 100%; }
.rv-dec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-dec .ai-btn { margin-left: auto; }
.rv-ai { display: flex; align-items: center; gap: 8px; background: var(--surface2); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.rv-ai .spark { width: 14px; height: 14px; }
.rv-ai-res { border: 1px solid #c8d3f5; background: #f6f8fe; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.rv-ai-res > small { font-weight: 700; font-size: 12px; color: #2f4fb5; }
.btn.sm.ok { color: var(--ok); }
.fx-tools { display: flex; align-items: center; justify-content: space-between; }
.fx-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; max-height: 52vh; overflow: auto; }
.fx-it { display: grid; grid-template-columns: 22px minmax(150px, 1fr) 2fr; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.fx-it:last-child { border-bottom: 0; }
.fx-it:hover { background: var(--surface2); }
.fx-p small { display: block; color: var(--muted); font-size: 11.5px; }
.fx-v { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.fx-v s { color: #a5322a; }
.fx-v ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.fx-v > span { color: var(--muted); }
.fx-it:has(input:not(:checked)) { opacity: .5; }
.jumpbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; flex-wrap: nowrap; }
.jb-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 16px; }
.jb-chips::-webkit-scrollbar { display: none; }
.jb-chips button { flex: none; white-space: nowrap; }
.jumpbar .btn { white-space: nowrap; }

/* ---------- visite guidée ---------- */
.tour { position: fixed; inset: 0; z-index: 60; }
.tour-catch { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15,17,21,.58); outline: 2px solid #f5c518; outline-offset: 0; transition: all .25s ease; pointer-events: none; }
.tour-box { position: fixed; width: min(360px, calc(100vw - 32px)); background: var(--surface); border-radius: 12px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.3); transition: left .25s ease, top .25s ease; }
.tour-box h3 { margin: 2px 0 6px; font-size: 16px; }
.tour-box p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.tour-n { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.tour-b { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour-b > span { display: flex; gap: 6px; }
.tour-lnk { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 10px; vertical-align: middle; text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.tour-lnk:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-box { transition: none; } }
