/* FLEET OFFICE — agent dev environment (console 2D inspirée d'Orca).
   Palette dev-tool sombre (bleu-noir), accent froid, surfaces douces, status line. */
:root {
  --bg: #0d0f14; --bg2: #0f1218; --panel: #151922; --panel2: #1a1f2a; --raise: #1e2430;
  --line: #1d222c; --line2: #2a3140; --line3: #39414f;
  --ink: #e6e9ef; --mut: #9aa3b2; --mut2: #626b7b;

  /* accent froid (Tokyonight-ish) */
  --acc: #7aa2f7; --acc2: #89b4ff; --acc-deep: #2b3a63; --acc-ink: #cdddff;
  --violet: #bb9af7;
  --ok: #9ece6a; --okbg: rgba(158,206,106,.13);
  --del: #f7768e; --delbg: rgba(247,118,142,.13);
  --warn: #e0af68; --cyan: #7dcfff;

  /* statuts */
  --s-work: #7dcfff; --s-idle: #5f6775; --s-review: #e0af68; --s-done: #9ece6a; --s-fail: #f7768e; --s-cowork: #bb9af7;

  --rail-w: 300px; --ctx-w: 340px;
  --radius: 11px; --radius-sm: 8px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 18px 44px -20px rgba(0,0,0,.8);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: var(--fs, 13.5px); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--sb); border-radius: 6px; } ::-webkit-scrollbar-thumb:hover { background: var(--sbh); }
.hidden { display: none !important; }
code { font-family: var(--mono); }

/* ===== shell : sidebar + main (+ ctx en slide-over) ===== */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; height: 100vh; height: 100dvh; }
.rail { position: relative; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); position: relative; }

.resize-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 25; }
.resize-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: background .12s; }
.resize-handle:hover::after, .resize-handle.dragging::after { background: var(--acc); }
.resize-handle-r { right: -3.5px; } .resize-handle-l { left: -3.5px; }
body.resizing { cursor: col-resize; user-select: none; } body.resizing iframe { pointer-events: none; }

/* ===== SIDEBAR ===== */
.rail-top { display: flex; align-items: center; gap: 10px; padding: 15px 16px 10px; }
.brand { display: flex; align-items: center; gap: 9px; flex: 1; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; background: linear-gradient(135deg, var(--acc-deep), var(--panel)); border: 1px solid var(--line2); color: var(--acc); }
.brand .bt { font-size: 14px; font-weight: 600; letter-spacing: .01em; } .brand .bt b { color: var(--acc); font-weight: 700; }
.net { background: none; border: 0; cursor: pointer; padding: 6px; } .net .dot { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--mut2); }
.net.live .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.new-task { margin: 2px 14px 10px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--acc-deep); background: linear-gradient(135deg, var(--acc-deep), var(--panel)); color: var(--acc-ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.new-task:hover { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc-deep); }

.nav { padding: 0 10px 6px; display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: var(--radius-sm); color: var(--mut); background: none; border: 0; cursor: pointer; font-size: 13px; text-align: left; width: 100%; }
.nav-item .ic { width: 16px; text-align: center; opacity: .8; }
.nav-item:hover { background: var(--panel); color: var(--ink); }
.nav-item.sel { background: var(--panel); color: var(--ink); box-shadow: inset 2px 0 0 var(--acc); }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--mut2); background: var(--panel2); padding: 1px 8px; border-radius: 10px; }

.rail-search { margin: 6px 14px 8px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 8px 10px; }
.rail-search .ic { color: var(--mut2); } .rail-search input { background: none; border: 0; outline: none; width: 100%; font-size: 12.5px; }

.rail-filter { display: flex; gap: 5px; padding: 0 14px 8px; flex-wrap: wrap; }
.chip { padding: 5px 10px; border-radius: 16px; border: 1px solid var(--line2); background: var(--panel); color: var(--mut); font-size: 11.5px; cursor: pointer; }
.chip:hover { color: var(--ink); } .chip.sel { background: var(--acc-deep); border-color: var(--acc); color: var(--acc-ink); }

.rail-list { flex: 1; overflow-y: auto; padding: 2px 10px 10px; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.proj-group { margin-bottom: 12px; }
.proj-h { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut2); }
.proj-h .pname { color: var(--mut); font-weight: 600; letter-spacing: .02em; text-transform: none; font-size: 11.5px; }
.proj-h .pn { margin-left: auto; }

/* carte de tâche/agent */
.acard { display: block; width: 100%; text-align: left; border: 1px solid var(--line2); background: var(--panel); border-radius: var(--radius); padding: 10px 11px; margin-bottom: 7px; cursor: pointer; position: relative; }
.acard:hover { border-color: var(--line3); background: var(--panel2); }
.acard.sel { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc-deep); background: var(--panel2); }
.acard .ac-top { display: flex; align-items: center; gap: 8px; }
.acard .ac-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.acard .ac-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.acard .ac-badge { font-size: 13px; }
.acard .ac-branch { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-family: var(--mono); font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard .ac-branch .gi { color: var(--acc); }
.acard .ac-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 11px; color: var(--mut2); }
.acard .ac-stat .add { color: var(--ok); } .acard .ac-stat .del { color: var(--del); }
.acard .ac-chip { background: var(--panel2); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 6px; font-size: 10.5px; color: var(--mut); }
.acard .ac-host { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--mut2); }
.acard .ac-status-line { margin-top: 6px; font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard.working .ac-status-line { color: var(--cyan); }
.acard .ac-review { position: absolute; top: 9px; right: 10px; font-size: 10px; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 5px; padding: 0 5px; }
.acard .subrow { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-left: 10px; border-left: 1px dashed var(--line2); font-size: 11.5px; color: var(--mut); }
.acard .subrow .sd { width: 6px; height: 6px; border-radius: 50%; }

.rail-empty { padding: 26px 10px; text-align: center; color: var(--mut2); font-size: 12.5px; }

.statusline { border-top: 1px solid var(--line); padding: 9px 14px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--mut); background: var(--bg2); }
.statusline .sl { display: flex; align-items: center; gap: 5px; } .statusline .sl b { color: var(--ink); font-weight: 600; }
.statusline .sl .mi { color: var(--mut2); }

/* ===== MAIN : accueil ===== */
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px; }
.welcome .wbig { font-size: 52px; filter: saturate(.8); } .welcome h1 { margin: 0; font-size: 26px; letter-spacing: .01em; }
.welcome p { margin: 0; color: var(--mut); max-width: 480px; line-height: 1.6; font-size: 13.5px; }
.welcome .wactions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.primary { padding: 11px 20px; border-radius: 10px; border: 1px solid var(--acc); background: linear-gradient(135deg, var(--acc), var(--acc-d)); color: var(--on-acc); font-weight: 700; font-size: 14px; cursor: pointer; }
.primary:hover { filter: brightness(1.08); }
.ghost-btn { padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font-size: 13px; cursor: pointer; }
.ghost-btn:hover { border-color: var(--line3); }

/* ===== BOARD kanban ===== */
.board { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.board-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px 0; flex: 0 0 auto; }
.segs { display: inline-flex; background: var(--panel); border: 1px solid var(--line2); border-radius: 9px; padding: 2px; }
.seg { background: none; border: 0; color: var(--mut); font-size: 12px; padding: 5px 12px; border-radius: 7px; cursor: pointer; } .seg.sel { background: var(--acc-deep); color: var(--acc-ink); }
.bb-sum { margin-left: auto; font-size: 11.5px; color: var(--mut2); }
.board-cols { flex: 1; display: flex; gap: 14px; padding: 14px 16px 16px; overflow-x: auto; min-height: 0; }
.bmore { width: 100%; background: none; border: 1px dashed var(--line2); color: var(--mut); border-radius: 9px; padding: 8px; font-size: 12px; cursor: pointer; } .bmore:hover { color: var(--ink); border-color: var(--line3); }
.bc-proj { font-size: 11px; color: var(--mut2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-proj { font-size: 11px; color: var(--mut2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-star { margin-left: auto; color: var(--mut2); font-size: 13px; padding: 0 2px; cursor: pointer; opacity: .55; } .acard:hover .ac-star, .ac-star.on { opacity: 1; } .ac-star.on { color: var(--acc); }
.ac-top .ac-badge + .ac-star { margin-left: 4px; }
.proj-h { cursor: pointer; user-select: none; } .proj-h.static { cursor: default; }
.proj-h .chev { width: 10px; color: var(--mut2); font-size: 10px; } .proj-h .pact { color: var(--s-work); font-size: 10.5px; margin-left: auto; margin-right: 4px; } .proj-h .pact + .pn { margin-left: 0; }
.proj-group.collapsed { margin-bottom: 4px; }
.bcol { flex: 1; min-width: 260px; display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; }
.bcol-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.bcol-h .bdot { width: 8px; height: 8px; border-radius: 50%; } .bcol-h .bn { margin-left: auto; color: var(--mut2); font-weight: 500; }
.bcol-body { flex: 1; overflow-y: auto; padding: 10px; min-height: 0; }
.bcol-empty { color: var(--mut2); font-size: 12px; text-align: center; padding: 22px 8px; }
.bcard { border: 1px solid var(--line2); background: var(--panel); border-radius: var(--radius); padding: 11px 12px; margin-bottom: 9px; cursor: pointer; }
.bcard:hover { border-color: var(--line3); background: var(--panel2); }
.bcard .bc-top { display: flex; align-items: center; gap: 8px; }
.bcard .bc-dot { width: 8px; height: 8px; border-radius: 50%; }
.bcard .bc-name { font-size: 13px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard .bc-model { font-size: 10.5px; color: var(--mut2); background: var(--panel2); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 6px; }
.bcard .bc-branch { font-family: var(--mono); font-size: 11px; color: var(--mut); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard .bc-branch .gi { color: var(--acc); }
.bcard .bc-foot { display: flex; align-items: center; gap: 9px; margin-top: 8px; font-size: 11px; color: var(--mut2); }
.bcard .bc-stat .add { color: var(--ok); } .bcard .bc-stat .del { color: var(--del); }
.bcard .bc-host { margin-left: auto; font-family: var(--mono); font-size: 10.5px; }
.bcard .bc-actions { display: flex; gap: 6px; margin-top: 9px; }
.bcard .bc-actions button { flex: 1; padding: 6px; border-radius: 7px; border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); font-size: 11.5px; cursor: pointer; }
.bcard .bc-actions .review:hover { border-color: var(--warn); color: var(--warn); }
.bcard .bc-actions .merge { background: linear-gradient(135deg, var(--acc), var(--acc-d)); border-color: var(--acc); color: var(--on-acc); font-weight: 600; }

/* ===== SESSION ===== */
.session { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sess-head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sess-head .sh-av { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--ink); flex: 0 0 auto; }
.sess-head .sh-id { min-width: 0; }
.sess-head .sh-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.sess-head .sh-name .rename-btn { background: none; border: 0; color: var(--mut2); cursor: pointer; font-size: 12px; }
.sess-head .sh-sub { display: flex; align-items: center; gap: 9px; margin-top: 3px; font-size: 11.5px; color: var(--mut); flex-wrap: wrap; }
.sess-head .sh-sub .d { width: 7px; height: 7px; border-radius: 50%; }
.sess-head .sh-branch { font-family: var(--mono); color: var(--acc); }
.sess-head .sh-chip { background: var(--panel); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 7px; font-size: 10.5px; color: var(--mut); }
.sess-head .sh-chip.bedrock { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.sess-head .sh-act { margin-left: auto; display: flex; gap: 6px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; font-size: 14px; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--line3); }

.sess-tabs { display: flex; gap: 2px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.ctab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; background: none; color: var(--mut); font-size: 12.5px; cursor: pointer; border-radius: 7px 7px 0 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ctab:hover { color: var(--ink); background: var(--panel); } .ctab.sel { color: var(--ink); border-bottom-color: var(--acc); }
.ctab-n { font-size: 10px; background: var(--acc-deep); color: var(--acc-ink); border-radius: 9px; padding: 1px 7px; }

/* conversation */
.conv > * { flex-shrink: 0; }
.conv { flex: 1; overflow-y: auto; padding: 18px 20px; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.conv .empty, .view .empty, .diff-wrap .empty { color: var(--mut2); text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .big { font-size: 40px; opacity: .5; }
.msg { max-width: 860px; } .msg.you { align-self: flex-end; }
.mh { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; font-size: 11px; color: var(--mut2); }
.mh .mav { font-size: 13px; } .mh .mwho { letter-spacing: .03em; text-transform: uppercase; font-size: 10px; }
.mbody { background: var(--panel); border: 1px solid var(--line2); border-radius: 11px; padding: 11px 14px; font-size: 13.5px; line-height: 1.62; word-wrap: break-word; }
.msg.you .mbody { background: var(--acc-deep); border-color: var(--you-line); color: var(--acc-ink); }
.msg.result .mbody { background: var(--result-bg); border-color: var(--result-line); }
.mbody.md p { margin: 0 0 8px; } .mbody.md p:last-child { margin: 0; }
.mbody.md h4 { margin: 10px 0 6px; font-size: 15px; } .mbody.md h5, .mbody.md h6 { margin: 8px 0 5px; font-size: 13px; }
.mbody.md ul, .mbody.md ol { margin: 6px 0; padding-left: 20px; } .mbody.md li { margin: 2px 0; }
.mbody.md code { background: var(--code); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.mbody.md pre { background: var(--code); border: 1px solid var(--line2); border-radius: 8px; padding: 11px; overflow-x: auto; } .mbody.md pre code { border: 0; background: none; padding: 0; }
.mbody.md blockquote { border-left: 3px solid var(--line3); margin: 6px 0; padding: 2px 0 2px 12px; color: var(--mut); }
.mbody.md a { color: var(--acc); }
.tool { max-width: 860px; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; background: var(--panel); }
.tool .th { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 12px; color: var(--mut); }
.tool .th .ok { color: var(--ok); } .tool .th .chev { color: var(--mut2); }
.tool .th .tool-sum { flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool pre { margin: 0; padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; color: var(--ink2); background: var(--code); border-top: 1px solid var(--line); overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.tool .res pre { background: var(--code); color: var(--add-ink); }
.conv-loadmore-wrap { text-align: center; padding: 4px 0 8px; } .conv-loadmore-wrap.done { color: var(--mut2); font-size: 11px; }
.loadmore-btn { background: var(--panel); border: 1px solid var(--line2); color: var(--mut); border-radius: 16px; padding: 6px 14px; font-size: 12px; cursor: pointer; }

/* composer */
.composer { border-top: 1px solid var(--line); padding: 12px 16px; background: var(--bg2); }
.tray { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 7px; padding: 4px 8px; font-size: 11.5px; }
.fchip.pending { opacity: .6; } .fchip .fx { background: none; border: 0; color: var(--mut2); cursor: pointer; }
.suggest, .quickreply { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.sg-l { font-size: 11px; color: var(--mut2); } .sg-chip, .qr-chip { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--ink); }
.sg-chip:hover, .qr-chip:hover { border-color: var(--acc); }
.slash { position: relative; } .slash-dd { position: absolute; bottom: 4px; left: 0; background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; z-index: 5; box-shadow: var(--shadow); min-width: 220px; }
.slash-item { padding: 8px 12px; font-family: var(--mono); font-size: 12px; cursor: pointer; } .slash-item:hover { background: var(--acc-deep); }
.cbox { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 10px; }
.cbox:focus-within { border-color: var(--acc); }
.cbox textarea { width: 100%; background: none; border: 0; outline: none; resize: none; font-size: 13.5px; line-height: 1.5; max-height: 160px; }
.crow { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.cbtn { background: none; border: 0; cursor: pointer; font-size: 16px; opacity: .8; } .cbtn:hover { opacity: 1; } .cbtn:disabled { opacity: .3; cursor: default; }
.spacer { flex: 1; } .busyline { font-size: 11px; color: var(--warn); }
.send-btn { background: linear-gradient(135deg, var(--acc), var(--acc-d)); border: 0; color: var(--on-acc); font-weight: 700; border-radius: 9px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.send-btn:hover { filter: brightness(1.08); }

/* ===== DIFF ===== */
.diff-wrap { flex: 1; overflow-y: auto; min-height: 0; }
.diff-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.diff-branch { font-family: var(--mono); font-size: 11.5px; color: var(--mut); } .diff-branch b { color: var(--acc); }
.diff-stat { font-family: var(--mono); font-size: 11px; color: var(--mut2); } .diff-stat .add { color: var(--ok); } .diff-stat .del { color: var(--del); }
.diff-actions { margin-left: auto; display: flex; gap: 8px; }
.diff-actions button { padding: 8px 14px; border-radius: 8px; font-size: 12px; cursor: pointer; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); }
.diff-actions .merge { background: linear-gradient(135deg, var(--acc), var(--acc-d)); border-color: var(--acc); color: var(--on-acc); font-weight: 600; }
.diff-actions .merge:hover { filter: brightness(1.1); } .diff-actions .discard:hover { border-color: var(--del); color: var(--del); }
.diff-files { padding: 10px 18px; }
.dfile { border: 1px solid var(--line2); border-radius: 9px; margin-bottom: 12px; overflow: hidden; background: var(--panel2); }
.dfile-h { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; background: var(--panel); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.dfile-h .dchev { color: var(--mut2); width: 10px; } .dfile-h .dpath { color: var(--ink); word-break: break-all; } .dfile-h .dnum { margin-left: auto; font-size: 11px; white-space: nowrap; }
.dfile-h .dnum .add { color: var(--ok); } .dfile-h .dnum .del { color: var(--del); }
.dfile-body { font-family: var(--mono); font-size: 12px; line-height: 1.5; overflow-x: auto; }
.dline { display: flex; white-space: pre; }
.dline .gut { flex: 0 0 auto; width: 48px; text-align: right; padding: 0 8px; color: var(--mut2); user-select: none; border-right: 1px solid var(--line); opacity: .7; }
.dline .code { flex: 1; padding: 0 10px; }
.dline.hunk { background: var(--hunk); color: var(--mut); } .dline.add { background: var(--okbg); } .dline.add .code { color: var(--add-ink); }
.dline.del { background: var(--delbg); } .dline.del .code { color: var(--del-ink); } .dline.ctx .code { color: var(--mut); }
.dline.commentable { cursor: text; } .dline.commentable:hover { background: var(--hover); } .dline.commentable:hover .code::after { content: " 💬"; opacity: .5; }
.dcomment { background: var(--panel2); border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: 8px 10px 8px 58px; display: flex; gap: 8px; }
.dcomment textarea { flex: 1; background: var(--code); border: 1px solid var(--line2); border-radius: 6px; color: var(--ink); font-family: var(--mono); font-size: 12px; padding: 7px 9px; resize: vertical; min-height: 34px; }
.dcomment button { align-self: flex-start; padding: 7px 12px; border-radius: 7px; border: 1px solid var(--acc); background: var(--acc-deep); color: var(--acc-ink); font-size: 12px; cursor: pointer; }
.diff-pending { margin: 10px 18px; padding: 10px 12px; border: 1px dashed var(--acc); border-radius: 9px; background: var(--acc-deep); font-size: 12.5px; display: flex; align-items: center; gap: 10px; }
.diff-pending b { color: var(--acc-ink); }
.diff-pending button { margin-left: auto; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--acc); background: linear-gradient(135deg, var(--acc), var(--acc-d)); color: var(--on-acc); cursor: pointer; font-size: 12px; font-weight: 600; }

/* fan-out bar */
.fanout-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--fan-bg); border-bottom: 1px solid var(--line); }
.fanout-bar .fo-l { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut2); }
.fo-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 18px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; font-size: 12px; }
.fo-chip.sel { border-color: var(--violet); box-shadow: 0 0 0 1px color-mix(in srgb, var(--violet) 30%, transparent) inset; }
.fo-chip .fo-dot { width: 7px; height: 7px; border-radius: 50%; } .fo-chip .fo-win { color: var(--warn); }

/* terminal panel */
.termpanel { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--code); }
.term-topbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.term-sub { font-family: var(--mono); font-size: 12px; color: var(--mut); flex: 1; }
.term-status { font-size: 11px; color: var(--mut2); } .term-status.live { color: var(--ok); } .term-status.err { color: var(--del); }
.term-body { flex: 1; min-height: 0; padding: 8px 10px; }

/* preview / design */
.preview { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.design-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.design-bar { display: flex; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--bg); align-items: center; }
.dz-url { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; color: var(--ink); font-family: var(--mono); font-size: 12.5px; padding: 9px 11px; }
.dz-btn { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.dz-btn:hover { border-color: var(--acc); } .dz-btn.on { background: linear-gradient(135deg, var(--acc), var(--acc-d)); border-color: var(--acc); color: var(--on-acc); }
.dz-target { background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; color: var(--ink); font-size: 12px; padding: 9px 10px; max-width: 200px; }
.design-stage { flex: 1; position: relative; min-height: 0; background: var(--code); }
.dz-frame { width: 100%; height: 100%; border: 0; background: #fff; display: none; } .dz-frame.show { display: block; }
.dz-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; color: var(--mut); padding: 30px; }
.dz-empty .big { font-size: 40px; opacity: .5; } .dz-empty code { background: var(--panel); padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 12px; color: var(--acc); }
.dz-card { position: absolute; right: 16px; bottom: 16px; width: min(420px, calc(100% - 32px)); z-index: 6; background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); padding: 13px 14px; }
.dz-card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dz-sel { font-family: var(--mono); font-size: 12.5px; color: var(--acc); flex: 1; word-break: break-all; } .dz-sz { font-size: 11px; color: var(--mut2); } .dz-x { background: none; border: 0; color: var(--mut2); cursor: pointer; }
.dz-styles { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; max-height: 76px; overflow: auto; }
.dz-st { font-family: var(--mono); font-size: 10.5px; color: var(--mut); background: var(--panel); border: 1px solid var(--line2); border-radius: 5px; padding: 2px 6px; } .dz-st b { color: var(--mut2); font-weight: 500; }
.dz-html { font-family: var(--mono); font-size: 11px; color: var(--ink2); background: var(--panel); border: 1px solid var(--line2); border-radius: 7px; padding: 9px; max-height: 120px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0 0 9px; }
.dz-note { width: 100%; background: var(--panel); border: 1px solid var(--line2); border-radius: 7px; color: var(--ink); font-size: 12.5px; padding: 8px 10px; resize: vertical; min-height: 44px; margin-bottom: 9px; }
.dz-send { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--acc); background: linear-gradient(135deg, var(--acc), var(--acc-d)); color: var(--on-acc); font-weight: 600; font-size: 13px; cursor: pointer; }

/* ===== vues secondaires (machines / skills / audit) ===== */
.view { flex: 1; overflow-y: auto; min-height: 0; }
.mach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 18px; align-content: start; }
.skills-wrap { padding: 18px; }
.card2 { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card2 h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); display: flex; align-items: center; gap: 8px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12.5px; } .kv .k { color: var(--mut2); } .kv .v { color: var(--ink); text-align: right; }
.v.grn { color: var(--ok); } .v.red { color: var(--del); } .v.amber { color: var(--warn); }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 10px; }
.meter { text-align: center; } .meter .ml { font-size: 10px; color: var(--mut2); text-transform: uppercase; letter-spacing: .05em; } .meter .mv { font-size: 18px; font-weight: 600; margin: 2px 0 6px; }
.ring { --p: 0; height: 5px; border-radius: 4px; background: var(--line2); overflow: hidden; position: relative; }
.ring i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p) * 1%); background: var(--acc); } .ring.hot i { background: var(--warn); } .ring.crit i { background: var(--del); }
.qa { display: flex; gap: 8px; } .qa button { flex: 1; padding: 9px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); font-size: 12px; cursor: pointer; }
.qa .warn:hover { border-color: var(--warn); color: var(--warn); } .qa .danger:hover { border-color: var(--del); color: var(--del); }
.prog { height: 5px; border-radius: 4px; background: var(--line2); overflow: hidden; margin: 6px 0; } .prog i { display: block; height: 100%; background: var(--acc); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.mach-card h3 { justify-content: space-between; } .linkbtn2 { margin-top: 8px; background: none; border: 0; color: var(--acc); font-size: 12px; cursor: pointer; padding: 0; }
.ftree { font-size: 12.5px; } .ftree-root { color: var(--mut); margin-bottom: 6px; } .froot-path { font-family: var(--mono); color: var(--mut2); }
.ftree-folder { display: flex; align-items: center; gap: 6px; padding: 4px 2px; cursor: pointer; color: var(--mut); } .ftree-folder .fchev { color: var(--mut2); } .fcount { margin-left: 6px; font-size: 10px; color: var(--mut2); }
.ftree-agents, .ftree-children { padding-left: 16px; }
.ftree-leaf { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; } .ftree-leaf:hover { background: var(--panel); }
.ftree-leaf .fdot { width: 7px; height: 7px; border-radius: 50%; } .ftree-leaf .fnm { font-size: 12.5px; } .ftree-leaf .frole { margin-left: auto; font-size: 11px; color: var(--mut2); }
.skills-asst { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.asst-h { font-size: 12px; color: var(--mut); margin-bottom: 8px; } .asst-log { max-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.asst-msg { font-size: 12px; padding: 5px 9px; border-radius: 7px; background: var(--panel2); } .asst-msg.me { align-self: flex-end; background: var(--acc-deep); color: var(--acc-ink); } .asst-msg.ok { color: var(--ok); } .asst-msg.err { color: var(--del); }
.asst-row { display: flex; gap: 8px; } .asst-row input { flex: 1; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; color: var(--ink); font-size: 12px; padding: 8px 10px; } .asst-row button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--acc); background: var(--acc-deep); color: var(--acc-ink); cursor: pointer; }
.skills-cat h3 { justify-content: flex-start; } .badge { background: var(--panel2); border-radius: 10px; padding: 1px 8px; font-size: 11px; color: var(--mut2); } .catbtn { margin-left: auto; background: none; border: 0; color: var(--acc); font-size: 11px; cursor: pointer; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.skill-card { position: relative; border: 1px solid var(--line2); border-radius: 9px; padding: 11px; cursor: pointer; background: var(--panel); } .skill-card:hover { border-color: var(--line3); }
.skill-card .sn { font-size: 13px; font-weight: 600; } .skill-card .sd { font-size: 11.5px; color: var(--mut); margin: 4px 0; line-height: 1.4; } .skill-card .sm { font-family: var(--mono); font-size: 10px; color: var(--mut2); } .skx { position: absolute; top: 6px; right: 6px; background: none; border: 0; color: var(--mut2); cursor: pointer; }
.audit-list { display: flex; flex-direction: column; gap: 2px; } .audit-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; } .audit-row:hover { background: var(--panel); } .aic { font-size: 15px; } .adesc { flex: 1; font-size: 12.5px; } .ats { font-size: 11px; color: var(--mut2); }

/* ===== CONTEXTE (slide-over) ===== */
.ctx { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: var(--ctx-w); max-width: 92vw; background: var(--bg2); border-left: 1px solid var(--line2); display: flex; flex-direction: column; z-index: 45; transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--shadow); }
.app.ctx-open .ctx { transform: none; }
.ctx-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; flex-wrap: wrap; }
.ctx-head h2 { margin: 0; font-size: 14px; flex: 1; } .ctx-head #ctx-close { margin-left: auto; }
.ctx-tabs { display: flex; gap: 2px; width: 100%; margin-top: 10px; border-bottom: 1px solid var(--line); }
.ctx-tab { padding: 8px 12px; border: 0; background: none; color: var(--mut); font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; } .ctx-tab.sel { color: var(--ink); border-bottom-color: var(--acc); }
.ctx-body { flex: 1; overflow-y: auto; padding: 14px 16px; min-height: 0; }

/* ===== modales ===== */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); z-index: 50; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--shadow); z-index: 55; padding: 20px; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; } .modal-head h2 { margin: 0; font-size: 17px; } .modal-sub { font-size: 12px; color: var(--mut2); margin-top: 3px; }
.close { margin-left: auto; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; } .fld-l { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--mut2); } .fld-l small { text-transform: none; letter-spacing: 0; color: var(--mut2); }
.fld input, .fld textarea, .fld select { background: var(--bg2); border: 1px solid var(--line2); border-radius: 9px; color: var(--ink); font-size: 13.5px; padding: 10px 12px; } .fld input:focus, .fld textarea:focus, .fld select:focus { border-color: var(--acc); outline: none; }
.fld-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cwd-row { display: flex; gap: 8px; } .cwd-row input { flex: 1; } .browse-btn { border: 1px solid var(--line2); background: var(--bg2); border-radius: 9px; padding: 0 13px; cursor: pointer; }
.seg { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; } .seg button { flex: 1; padding: 9px; border-radius: 7px; border: 0; background: none; color: var(--mut); font-size: 12.5px; cursor: pointer; } .seg button small { color: var(--mut2); } .seg button.sel { background: var(--acc-deep); color: var(--acc-ink); }
.hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; max-height: 160px; overflow-y: auto; }
.host-pick { text-align: left; border: 1px solid var(--line2); background: var(--bg2); border-radius: 9px; padding: 8px 10px; cursor: pointer; } .host-pick.sel { border-color: var(--acc); background: var(--acc-deep); }
.host-pick .hn { display: flex; align-items: center; gap: 6px; font-size: 12.5px; } .host-pick .hi { font-family: var(--mono); font-size: 10.5px; color: var(--mut2); margin-top: 2px; } .hdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); } .hdot.off { background: var(--mut2); }
.resume-list { max-height: 150px; overflow-y: auto; border: 1px solid var(--line2); border-radius: 9px; } .resume-item { display: flex; align-items: center; gap: 8px; padding: 8px 11px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 12.5px; } .resume-item:last-child { border-bottom: 0; } .resume-item:hover { background: var(--panel2); } .resume-item.sel { background: var(--acc-deep); } .resume-item .rn { font-weight: 600; } .resume-item .rp { color: var(--mut2); flex: 1; } .resume-item .rt { color: var(--mut2); font-size: 11px; }
.dropzone { border: 1.5px dashed var(--line2); border-radius: 10px; padding: 12px; text-align: center; } .dropzone.drag { border-color: var(--acc); background: var(--acc-deep); } .dz-hint { font-size: 12px; color: var(--mut2); } .linkbtn { background: none; border: 0; color: var(--acc); cursor: pointer; font-size: 12.5px; padding: 0; }
.tm-roles { display: flex; flex-wrap: wrap; gap: 8px; } .tm-roles label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 6px 10px; cursor: pointer; } .tm-roles input { accent-color: var(--acc); } .addrole { display: flex; gap: 8px; margin-top: 8px; } .addrole input { flex: 1; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; }
.err { color: var(--del); font-size: 12.5px; min-height: 16px; } .go { width: 100%; padding: 13px; border-radius: 11px; border: 1px solid var(--acc); background: linear-gradient(135deg, var(--acc), var(--acc-d)); color: var(--on-acc); font-weight: 700; font-size: 14px; cursor: pointer; } .go:disabled { opacity: .6; }
.mode-seg { margin-bottom: 14px; } .variants { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; } .vrow { display: flex; align-items: center; gap: 8px; } .vrow select { flex: 1; background: var(--bg2); border: 1px solid var(--line2); border-radius: 7px; padding: 8px 9px; font-size: 12.5px; } .vrow .vx { background: none; border: 0; color: var(--mut2); cursor: pointer; font-size: 15px; } .vrow .vx:hover { color: var(--del); }
.chk-fld { flex-direction: row; align-items: flex-start; gap: 9px; cursor: pointer; } .chk-fld input { margin-top: 2px; accent-color: var(--acc); } .chk-fld small { color: var(--mut2); }
.sk-body { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; color: var(--ink2); background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 14px; max-height: 64vh; overflow: auto; }
.fx-modal { width: min(520px, 94vw); } .fx-path { font-family: var(--mono); font-size: 11.5px; color: var(--mut); background: var(--bg2); border: 1px solid var(--line2); border-radius: 7px; padding: 8px 10px; margin-bottom: 10px; word-break: break-all; } .fx-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line2); border-radius: 8px; } .fx-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; } .fx-row:last-child { border-bottom: 0; } .fx-row:hover { background: var(--panel2); } .fx-row .fi { color: var(--mut2); } .fx-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ===== command palette ===== */
.palette { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
.pal-box { width: min(620px, 94vw); background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.pal-in-wrap { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--line); } .pal-ic { color: var(--acc); font-size: 16px; } .pal-input { flex: 1; background: none; border: 0; outline: none; font-size: 16px; }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 6px; } .pal-item { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 9px; cursor: pointer; }
.pal-item .pi-ic { width: 22px; text-align: center; } .pal-item .pi-main { flex: 1; min-width: 0; } .pal-item .pi-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pal-item .pi-sub { font-size: 11px; color: var(--mut2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pal-item .pi-kind { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut2); background: var(--panel); padding: 2px 8px; border-radius: 6px; } .pal-item.sel { background: var(--acc-deep); } .pal-item .pi-dot { width: 7px; height: 7px; border-radius: 50%; }
.pal-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--mut2); } .pal-foot kbd { background: var(--panel); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; font-family: var(--mono); font-size: 10px; margin-right: 3px; }

.rename-btn { background: none; border: 0; color: var(--mut2); cursor: pointer; } .hn-input { background: var(--bg2); border: 1px solid var(--acc); border-radius: 6px; color: var(--ink); font-size: 15px; padding: 2px 8px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; padding: 11px 18px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; box-shadow: var(--shadow); } .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== barre mobile ===== */
.mbar { display: none; }
@media (max-width: 1100px) { :root { --rail-w: 262px; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; top: 0; bottom: 0; left: 0; height: 100vh; height: 100dvh; padding-bottom: env(safe-area-inset-bottom); z-index: 46; width: 86vw; max-width: 330px; transform: translateX(-100%); transition: transform .22s; }
  .app.rail-open .rail { transform: none; }
  .ctx { width: 92vw; }
  .app.rail-open::after, .app.ctx-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 44; }
  .mbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; z-index: 20; }
  .mbar button { background: var(--panel); border: 1px solid var(--line2); color: var(--ink); border-radius: 8px; width: 40px; height: 40px; font-size: 17px; cursor: pointer; flex: 0 0 auto; }
  .mbar .mtitle { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mbar .mtitle small { display: block; font-weight: 400; color: var(--mut2); font-size: 11px; }
  .board-cols { flex-direction: column; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; } .bcol { min-width: 0; flex: 0 0 auto; } .bcol-body { overflow: visible; }
  .nav { flex-direction: row; gap: 4px; padding: 0 10px 8px; }
  .nav-item { font-size: 0; flex: 1; justify-content: center; gap: 0; padding: 10px 0; width: auto; } .nav-item .ic { font-size: 17px; width: auto; opacity: 1; } .nav-item .count { display: none; } .nav-item.sel { box-shadow: inset 0 -2px 0 var(--acc); }
  .ac-star { opacity: 1; padding: 6px 8px; margin: -6px -4px -6px auto; }
  .dz-card { right: 8px; left: 8px; width: auto; bottom: 8px; } .dz-target { max-width: 120px; }
  .sess-head .sh-act { width: 100%; margin-left: 0; }
}

/* ===== ONGLETS (façon Orca) ===== */
.tabbar { display: flex; align-items: stretch; background: var(--bg2); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; min-height: 38px; flex: 0 0 auto; }
.tabbar::-webkit-scrollbar { display: none; }
.tab { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; min-width: 112px; max-width: 220px; flex: 0 0 auto; border-right: 1px solid var(--line); color: var(--mut); font-size: 12.5px; cursor: pointer; user-select: none; white-space: nowrap; }
.tab:hover { background: var(--panel); color: var(--ink); }
.tab.sel { background: var(--bg); color: var(--ink); box-shadow: inset 0 2px 0 var(--acc); }
.tab.pin { min-width: 0; padding-right: 14px; font-weight: 600; }
.tab .tic { opacity: .8; }
.tab .td { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.tab.work .td { animation: tabpulse 1.3s ease-in-out infinite; }
@keyframes tabpulse { 50% { opacity: .35; transform: scale(.8); } }
.tab .tn { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.tab .tr { color: var(--acc); font-size: 11px; }
.tab .tx { width: 20px; height: 20px; border-radius: 5px; border: 0; background: none; color: var(--mut2); font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center; opacity: 0; flex: 0 0 auto; }
.tab:hover .tx, .tab.sel .tx { opacity: 1; } .tab .tx:hover { background: var(--raise); color: var(--ink); }
.tab.dragover { box-shadow: inset 2px 0 0 var(--acc); }
.tab-add { flex: 0 0 auto; width: 36px; border: 0; background: none; color: var(--mut); font-size: 17px; cursor: pointer; } .tab-add:hover { color: var(--ink); background: var(--panel); }
.tab-fill { flex: 1; }

/* ===== APPARENCE ===== */
.rail-top .gear { background: none; border: 0; cursor: pointer; color: var(--mut); font-size: 16px; padding: 4px 6px; border-radius: 6px; } .rail-top .gear:hover { color: var(--ink); background: var(--panel); }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; margin-bottom: 14px; }
.th-card { position: relative; text-align: left; background: var(--bg2); border: 1px solid var(--line2); border-radius: 11px; padding: 9px; cursor: pointer; }
.th-card:hover { border-color: var(--line3); } .th-card.sel { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.th-sw { display: flex; height: 38px; border-radius: 7px; overflow: hidden; border: 1px solid rgba(128,128,128,.25); margin-bottom: 7px; }
.th-sw i { flex: 1; } .th-sw i:nth-child(1) { flex: 3; } .th-sw i:nth-child(4) { flex: 1.2; }
.th-nm { font-size: 12.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; } .th-nm small { color: var(--mut2); font-weight: 400; font-size: 10.5px; }
.th-card.add { display: grid; place-items: center; min-height: 82px; color: var(--mut); border-style: dashed; }
.th-edit { background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 14px; }
.th-edit h3 { margin: 0 0 10px; font-size: 13px; }
.th-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; color: var(--mut); }
.th-row > span { flex: 1; } .th-row input[type=color] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line3); border-radius: 7px; background: none; cursor: pointer; }
.th-row input[type=text] { flex: 1; background: var(--panel); border: 1px solid var(--line2); border-radius: 7px; padding: 7px 9px; color: var(--ink); }
.th-row .hexv { font-family: var(--mono); font-size: 11px; color: var(--mut2); width: 64px; text-align: right; }
.th-btns { display: flex; gap: 8px; margin-top: 12px; }
.th-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut2); margin: 16px 0 8px; }
html[data-mono="1"] .sess-head .sh-av { filter: grayscale(1); }

/* ===== palettes par conversation : marqueur visuel ===== */
.tab.tcol::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--tc); }
.tab.tcol { box-shadow: inset 0 2px 0 color-mix(in srgb, var(--tc) 55%, transparent); }
.tab.tcol.sel { box-shadow: inset 0 2px 0 var(--tc); }
.acard.tcol, .bcard.tcol { border-left: 3px solid var(--tc); }
#th-scope { margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; } #th-scope .modal-sub { flex-basis: 100%; }

/* ===== Markdown (md.js) ===== */
.mbody.md > :first-child { margin-top: 0; } .mbody.md > :last-child { margin-bottom: 0; }
.mbody.md h1, .mbody.md h2, .mbody.md h3, .mbody.md h4, .mbody.md h5, .mbody.md h6 { line-height: 1.3; font-weight: 650; margin: 16px 0 7px; color: var(--ink); }
.mbody.md h1 { font-size: 19px; padding-bottom: 6px; border-bottom: 1px solid var(--line2); } .mbody.md h2 { font-size: 16.5px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.mbody.md h3 { font-size: 15px; } .mbody.md h4 { font-size: 14px; } .mbody.md h5 { font-size: 13px; color: var(--ink2); } .mbody.md h6 { font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; }
.mbody.md ul, .mbody.md ol { margin: 6px 0; padding-left: 22px; } .mbody.md li > p { margin: 0; } .mbody.md li > ul, .mbody.md li > ol { margin: 3px 0; }
.mbody.md li::marker { color: var(--mut2); } .mbody.md li.task { list-style: none; margin-left: -18px; }
.md-task { color: var(--mut); margin-right: 2px; } .md-task.done { color: var(--ok); }
.mbody.md hr { border: 0; border-top: 1px solid var(--line2); margin: 14px 0; }
.mbody.md blockquote { border-left: 3px solid var(--acc); background: var(--hover); border-radius: 0 8px 8px 0; margin: 8px 0; padding: 6px 12px; color: var(--ink2); } .mbody.md blockquote > :first-child { margin-top: 0; } .mbody.md blockquote > :last-child { margin-bottom: 0; }
.mbody.md s { color: var(--mut); } .mbody.md a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line3); } .mbody.md a:hover { text-decoration-color: var(--acc); }
/* tableaux */
.md-table { overflow-x: auto; margin: 9px 0; border: 1px solid var(--line2); border-radius: 9px; -webkit-overflow-scrolling: touch; }
.md-table table { border-collapse: collapse; width: 100%; font-size: 12.5px; line-height: 1.5; }
.md-table th { background: var(--panel2); color: var(--ink); font-weight: 600; text-align: left; white-space: nowrap; }
.md-table th, .md-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: top; } .md-table td { min-width: 90px; }
.md-table tbody tr:last-child td { border-bottom: 0; } .md-table tbody tr:nth-child(even) td { background: var(--hover); } .md-table tbody tr:hover td { background: var(--panel2); }
.md-table .al-c { text-align: center; } .md-table .al-r { text-align: right; }
.md-table code { font-size: 11.5px; white-space: nowrap; }
/* blocs de code */
.md-code { margin: 9px 0; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; background: var(--code); }
.md-code-h { display: flex; align-items: center; padding: 4px 6px 4px 12px; background: var(--panel2); border-bottom: 1px solid var(--line); min-height: 28px; }
.md-lang { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--mut2); flex: 1; }
.md-copy { background: none; border: 1px solid transparent; color: var(--mut); font-size: 11px; border-radius: 6px; padding: 3px 9px; cursor: pointer; } .md-copy:hover { background: var(--raise); color: var(--ink); } .md-copy.ok { color: var(--ok); }
.mbody.md .md-code pre { margin: 0; border: 0; border-radius: 0; background: none; padding: 11px 13px; overflow-x: auto; font-size: 12px; line-height: 1.55; } .mbody.md .md-code pre code { font-family: var(--mono); font-size: inherit; }
.tk-c { color: var(--mut2); font-style: italic; } .tk-s { color: var(--ok); } .tk-n { color: var(--warn); } .tk-k { color: var(--violet); } .tk-key { color: var(--cyan); }
.d-add { display: block; background: var(--okbg); color: var(--add-ink); } .d-del { display: block; background: var(--delbg); color: var(--del-ink); } .d-hunk { display: block; color: var(--cyan); }
