/* ===== Thèmes ===== */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --r: 14px; --r-sm: 9px;
  --tree-w: 44%;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --t-message: #5eaaff; --t-voice: #34d399; --t-profile: #c084fc; --t-channel: #fbbf24; --t-danger: #f87171;
  --t-success: #4ade80; --t-warn: #fb923c; --t-member: #2dd4bf; --t-role: #f472b6; --t-server: #94a3b8;
  --t-game: #a3e635; --t-neutral: #8b95b0;
}
:root, [data-theme="dark"] {
  --bg: #090c15; --bg-2: #0e1220; --panel: #121829; --panel-2: #181f33; --panel-3: #1f2840;
  --line: #242d47; --line-2: #2f3a5a; --fg: #e9ecf8; --fg-2: #c3c9de; --muted: #8791b0;
  --accent: #7c8cff; --accent-2: #c084fc; --accent-soft: rgba(124, 140, 255, .14); --glow: rgba(124, 140, 255, .28);
  --shadow: 0 10px 40px rgba(0, 0, 0, .45); --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --hover: rgba(255, 255, 255, .045); --sel: rgba(124, 140, 255, .16);
}
[data-theme="light"] {
  --bg: #f1f3fa; --bg-2: #e9ecf6; --panel: #ffffff; --panel-2: #f6f7fc; --panel-3: #eceff9;
  --line: #dde1ee; --line-2: #c9cfe3; --fg: #1a2036; --fg-2: #3a4262; --muted: #6a7394;
  --accent: #5463f0; --accent-2: #9d4edd; --accent-soft: rgba(84, 99, 240, .10); --glow: rgba(84, 99, 240, .22);
  --shadow: 0 10px 40px rgba(40, 50, 100, .16); --shadow-sm: 0 2px 10px rgba(40, 50, 100, .10);
  --hover: rgba(30, 40, 90, .05); --sel: rgba(84, 99, 240, .12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 14px/1.5 var(--font); color: var(--fg); background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 8% -10%, rgba(124, 140, 255, .14), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(192, 132, 252, .10), transparent 60%);
  background-attachment: fixed;
  display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ===== Barre de progression ===== */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); background-size: 50% 100%; background-repeat: no-repeat;
  animation: slide 1.1s linear infinite; }
.progress.on { opacity: 1; }
@keyframes slide { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* ===== Barre du haut ===== */
.topbar { display: flex; align-items: center; gap: 18px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(14px); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-weight: 700; letter-spacing: -.01em; font-size: 16px; flex: none; }
.logo { width: 30px; height: 30px; filter: drop-shadow(0 4px 12px var(--glow)); }
.tag { font-style: normal; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: 2px 7px; border-radius: 99px;
  color: var(--accent); background: var(--accent-soft); }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.topbar-right form { margin: 0; }
.me { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--fg-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); display: grid; place-items: center; transition: .2s var(--ease); }
.icon-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ghost-btn { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--fg-2); transition: .2s var(--ease); }
.ghost-btn:hover { background: var(--hover); border-color: var(--line-2); color: var(--fg); }

/* ===== Recherche ===== */
.search { position: relative; flex: 1; max-width: 680px; margin: 0 auto; }
.search input { width: 100%; height: 42px; padding: 0 44px 0 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); outline: none; transition: .2s var(--ease); }
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--panel); }
.search-icon { position: absolute; left: 13px; top: 11px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.kbd { position: absolute; right: 11px; top: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); font: 600 12px var(--mono); background: var(--panel); pointer-events: none; }
.suggest { position: absolute; left: 0; right: 0; top: 50px; z-index: 40; max-height: min(70vh, 560px); overflow: auto; padding: 8px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--panel); box-shadow: var(--shadow); animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }
.sg-title { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.sg-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border: 0; background: none; text-align: left; border-radius: 10px; }
.sg-item:hover, .sg-item.active { background: var(--sel); }
.sg-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 15px; background: var(--panel-3); color: #fff; font-weight: 700; }
.sg-main { min-width: 0; flex: 1; }
.sg-main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-main span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-empty { padding: 22px; text-align: center; color: var(--muted); }
mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ===== Onglets ===== */
.tabs { display: flex; gap: 4px; padding: 10px 20px 0; overflow-x: auto; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent); scrollbar-width: thin; }
.tab { display: flex; align-items: center; gap: 8px; padding: 9px 15px; border: 0; background: none; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 600; white-space: nowrap; position: relative; transition: .2s var(--ease); }
.tab:hover { color: var(--fg); background: var(--hover); }
.tab[aria-selected="true"] { color: var(--fg); background: var(--panel); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 -3px 14px var(--glow); }

/* ===== Filtres ===== */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.field { display: grid; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .field select { height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); outline: none; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--fg); transition: .2s var(--ease); }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.narrow input { width: 108px; }
input[type="date"], input[type="time"] { color-scheme: dark; }
[data-theme="light"] input[type="date"], [data-theme="light"] input[type="time"] { color-scheme: light; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel-2); }
.seg button { height: 32px; padding: 0 11px; border: 0; border-right: 1px solid var(--line); background: none; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fg-2); transition: .15s; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--hover); color: var(--fg); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; min-height: 0; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 11px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 12.5px; font-weight: 600; animation: pop .18s var(--ease); }
.chip i { font-style: normal; color: var(--muted); font-weight: 500; }
.chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--panel-3); color: var(--fg-2); line-height: 1; font-size: 14px; display: grid; place-items: center; }
.chip button:hover { background: var(--t-danger); color: #fff; }

/* ===== Scène : graphe de nœuds (à la npmgraph) ===== */
.stage { flex: 1; min-height: 0; position: relative; margin: 14px 20px 20px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow-sm); }
.canvas { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; outline: none; user-select: none;
  background-image: radial-gradient(var(--line-2) 1.1px, transparent 1.2px); background-size: 26px 26px; }
.canvas.panning { cursor: grabbing; }
.canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edge { fill: none; stroke: var(--line-2); stroke-width: 1.7; stroke-linecap: round; transition: d .38s var(--ease), stroke .2s; }
.edge.hot { stroke: var(--accent); stroke-width: 2.6; filter: drop-shadow(0 0 5px var(--glow)); }

.node { position: absolute; left: 0; top: 0; width: var(--nw, 212px); height: var(--nh, 40px); display: flex; align-items: center; gap: 8px; padding: 0 26px 0 7px;
  border-radius: 12px; background: var(--panel); border: 1.6px solid color-mix(in srgb, var(--tone, var(--t-neutral)) 50%, var(--line)); cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .22); transition: transform .38s var(--ease), box-shadow .2s, border-color .2s, background .2s; animation: nodein .4s var(--ease) both; }
.node:hover { background: var(--panel-2); border-color: var(--tone, var(--accent)); box-shadow: 0 6px 22px rgba(0, 0, 0, .3), 0 0 0 4px color-mix(in srgb, var(--tone, var(--accent)) 14%, transparent); z-index: 3; }
.node.onpath { border-color: var(--accent); }
.node.sel { border-color: var(--accent); background: var(--panel-2); box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 26px rgba(0, 0, 0, .35), 0 0 22px var(--glow); z-index: 4; }
@keyframes nodein { from { opacity: 0; scale: .86; } to { opacity: 1; scale: 1; } }
.node .ico { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
.node .txt { flex: 1; min-width: 0; }
.node .title { font-size: 12.5px; line-height: 1.2; }
.node .sub { font-size: 10.5px; line-height: 1.2; }
.node .meta { gap: 5px; }
.node .badge { font-size: 10.5px; padding: 0 6px; }
.node .count { font-size: 11px; min-width: 22px; padding: 0 7px; }
.tw { position: absolute; right: -11px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3);
  border: 1.6px solid color-mix(in srgb, var(--tone, var(--t-neutral)) 55%, var(--line-2)); color: var(--fg-2); font-size: 10px; transition: transform .25s var(--ease), background .2s; }
.tw::before { content: "›"; font-size: 15px; font-weight: 800; line-height: 1; margin-top: -1px; }
.node[aria-expanded="true"] .tw { transform: rotate(90deg); background: var(--accent); border-color: var(--accent); color: #fff; }
.node.loading .tw::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.node.kind-more { border-style: dashed; background: transparent; box-shadow: none; justify-content: center; padding: 0 12px; color: var(--accent); font-weight: 700; font-size: 13px; --tone: var(--accent); }
.node.kind-more:hover { background: var(--accent-soft); }
.node.kind-root { height: 54px; border-width: 2px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--panel)), var(--panel)); --tone: var(--accent); }
.node.kind-root .ico { width: 38px; height: 38px; border-radius: 13px; font-size: 22px; overflow: hidden; padding: 0; }
.node.kind-root .ico img { width: 100%; height: 100%; object-fit: cover; }
.node.kind-root .title { font-size: 15px; font-weight: 800; }
.node.kind-group .ico { background: color-mix(in srgb, var(--accent) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.node.kind-note { cursor: default; border-style: dotted; background: transparent; box-shadow: none; --tone: var(--t-neutral); }
.node.leaf-end .tw { display: none; }

.hud { position: absolute; z-index: 6; }
.hud-info { top: 14px; left: 14px; padding: 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(10px); font-size: 12.5px; font-weight: 600; color: var(--fg-2); box-shadow: var(--shadow-sm); }
.hud-controls { left: 14px; bottom: 14px; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); }
.hud-controls button { width: 38px; height: 38px; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 18px; font-weight: 700; color: var(--fg-2); transition: .15s; }
.hud-controls button:last-child { border-bottom: 0; }
.hud-controls button:hover { background: var(--accent-soft); color: var(--accent); }
.hud-help { left: 64px; bottom: 18px; font-size: 11.5px; color: var(--muted); opacity: .75; pointer-events: none; }

/* ===== Mini-fenêtre de détail ===== */
.window { position: absolute; z-index: 20; top: 14px; right: 14px; bottom: 14px; width: min(470px, calc(100% - 28px)); display: flex; flex-direction: column; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel) 95%, transparent); backdrop-filter: blur(16px); box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .03); animation: winin .32s var(--ease) both; }
.window.dragged { bottom: auto; max-height: calc(100% - 28px); }
/* Téléphone : ouverture volontaire de la fenêtre de détail */
.show-detail { position: absolute; z-index: 19; right: 14px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 0; border-radius: 999px; color: #fff; font-weight: 600; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-sm); animation: winin .25s var(--ease) both; }
.show-detail[hidden] { display: none; }
@keyframes winin { from { opacity: 0; transform: translateX(26px) scale(.98); } to { opacity: 1; transform: none; } }
.win-head { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); cursor: grab; user-select: none; touch-action: none; }
.win-head:active { cursor: grabbing; }
.grip { color: var(--muted); letter-spacing: -2px; }
.win-title { flex: 1; font-weight: 700; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.small { width: 30px; height: 30px; font-size: 20px; line-height: 1; border-radius: 9px; }
.window .detail { flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

.skel { height: 42px; margin: 6px 4px; border-radius: 10px; background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 15px; background: color-mix(in srgb, var(--tone, var(--t-neutral)) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--t-neutral)) 35%, transparent); }
.title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; align-items: center; gap: 6px; flex: none; }
.time { font: 600 11px var(--mono); color: var(--muted); }
.count { padding: 1px 8px; border-radius: 99px; text-align: center; font-weight: 700; background: var(--panel-3); color: var(--fg-2); }
.badge { border-radius: 99px; font-weight: 600; color: var(--fg-2); background: var(--panel-3); white-space: nowrap; padding: 1px 8px; font-size: 11px; }
.tone-message { --tone: var(--t-message); } .tone-voice { --tone: var(--t-voice); } .tone-profile { --tone: var(--t-profile); }
.tone-channel { --tone: var(--t-channel); } .tone-danger { --tone: var(--t-danger); } .tone-success { --tone: var(--t-success); }
.tone-warn { --tone: var(--t-warn); } .tone-member { --tone: var(--t-member); } .tone-role { --tone: var(--t-role); }
.tone-server { --tone: var(--t-server); } .tone-game { --tone: var(--t-game); } .tone-neutral { --tone: var(--t-neutral); }

/* ===== Détail ===== */
.detail { padding: 22px; display: grid; gap: 16px; align-content: start; grid-auto-rows: max-content; }
.d-head { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--tone, var(--line)) 35%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone, var(--accent)) 15%, var(--panel-2)), var(--panel-2)); animation: fade .25s var(--ease) both; }
.d-head .ico { width: 54px; height: 54px; border-radius: 16px; font-size: 26px; }
.d-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.d-sub { color: var(--muted); margin-top: 2px; }
.d-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); overflow: hidden; animation: fade .3s var(--ease) both; }
.card > h3 { margin: 0; padding: 10px 16px; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel-3) 55%, transparent); }
.card .body { padding: 14px 16px; }
.kv { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { font-weight: 500; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.entity { border: 1px solid var(--line-2); background: var(--panel-3); border-radius: 99px; padding: 2px 11px; font-weight: 600; font-size: 13px; transition: .15s; }
.entity:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.copy { border: 1px solid var(--line-2); background: none; border-radius: 7px; padding: 1px 8px; font: 600 12px var(--mono); color: var(--muted); }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.65; }
.timeline { list-style: none; margin: 0; padding: 6px 16px 14px 30px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 41px; top: 18px; bottom: 22px; width: 2px; background: linear-gradient(var(--line-2), var(--line)); border-radius: 2px; }
.timeline li { position: relative; padding: 8px 0 8px 42px; }
.timeline .dot { position: absolute; left: 0; top: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--panel); border: 2px solid var(--line-2); }
.timeline .t-time { font: 600 11.5px var(--mono); color: var(--muted); }
.timeline .t-text { font-weight: 500; overflow-wrap: anywhere; }
.timeline .t-sub { font-size: 12.5px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 4px 8px 8px; }
.list li { padding: 9px 10px; border-radius: 10px; }
.list li + li { border-top: 1px solid var(--line); }
.list .l-text { font-weight: 600; overflow-wrap: anywhere; }
.list .l-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.list a { color: var(--accent); }
.pills { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px; }
.pill { padding: 3px 10px; border-radius: 99px; font: 600 12px var(--mono); background: color-mix(in srgb, var(--tone, var(--t-neutral)) 14%, transparent); color: var(--fg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--t-neutral)) 40%, transparent); }
.list .pills { padding: 6px 0 0; }
.diff { width: 100%; border-collapse: collapse; }
.diff th, .diff td { padding: 9px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.diff th { color: var(--muted); font-size: 12.5px; font-weight: 600; width: 28%; }
.diff .old { color: var(--t-danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.diff .new { color: var(--t-success); font-weight: 600; }
.diff tr:last-child > * { border-bottom: 0; }
.placeholder { margin: auto; text-align: center; padding: 70px 30px; color: var(--muted); }
.placeholder .big { font-size: 54px; margin-bottom: 8px; animation: float 3.2s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-7px); } }
.placeholder b { display: block; color: var(--fg); font-size: 17px; margin-bottom: 4px; }

/* ===== Notification ===== */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; animation: pop .2s var(--ease); max-width: 90vw; }
.toast.err { border-color: var(--t-danger); color: var(--t-danger); }

/* ===== Mobile ===== */
@media (max-width: 960px) {
  body { overflow: auto; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .me span:last-child { display: none; }
  .stage { margin: 10px; min-height: 70vh; }
  .hud-help { display: none; }
  .window { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 68%; border-radius: 18px 18px 14px 14px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.world.smooth { transition: transform .38s var(--ease); }
.logo.guild { border-radius: 9px; object-fit: cover; }

.d-avatar { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--line-2); }

/* ===== En-tête compact : tout tient sur ~84 px ===== */
.topbar { gap: 10px; padding: 6px 14px; }
.brand { font-size: 14px; gap: 8px; max-width: 190px; } .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .logo { width: 26px; height: 26px; }
.topbar .tabs { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; gap: 2px; margin: 0 4px; }
.topbar .tab { padding: 6px 10px; border-radius: 8px; font-size: 13px; gap: 6px; }
.topbar .tab[aria-selected="true"] { background: var(--accent-soft); color: var(--fg); }
.topbar .tab[aria-selected="true"]::after { display: none; }
.search { flex: 0 1 300px; margin: 0; }
.search input { height: 32px; font-size: 13px; padding: 0 34px 0 34px; border-radius: 9px; }
.search-icon { left: 10px; top: 7px; width: 17px; height: 17px; } .kbd { display: none; }
.topbar-right { gap: 8px; } .icon-btn { width: 30px; height: 30px; } .ghost-btn { padding: 5px 10px; font-size: 13px; }
.avatar { width: 26px !important; height: 26px !important; font-size: 12px; } .me { font-size: 13px; max-width: 130px; overflow: hidden; }
.toolbar { flex-wrap: nowrap; align-items: center; gap: 8px 12px; padding: 5px 14px; overflow-x: auto; scrollbar-width: none; }
.toolbar .field { display: flex; align-items: center; gap: 6px; font-size: 11px; flex: none; }
.toolbar .field > span { white-space: nowrap; }
.toolbar .field input, .toolbar .field select { height: 28px; font-size: 12.5px; }
.toolbar .field.narrow input { width: 86px; }
.seg button { height: 26px; padding: 0 9px; font-size: 12px; }
.chips { flex: none; flex-wrap: nowrap; gap: 6px; }
.chip { padding: 2px 4px 2px 9px; font-size: 12px; white-space: nowrap; }
.stage { margin: 8px 12px 12px; }
@media (max-width: 960px) { .topbar .tabs { order: 4; flex: 1 1 100%; overflow-x: auto; } .toolbar { flex-wrap: wrap; } }

/* ===== Correctifs : pas de défilement horizontal, recherche au-dessus du détail, fenêtre détachée ===== */
.topbar { position: relative; z-index: 60; flex-wrap: wrap; }
.suggest { z-index: 70; }
.topbar .tabs { flex-wrap: wrap; overflow: visible; }
.toolbar { flex-wrap: wrap; overflow: visible; }
.chips { flex-wrap: wrap; }
.avatar { overflow: hidden; display: grid; place-items: center; border-radius: 50%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.popup { display: flex; flex-direction: column; min-height: 100vh; overflow: auto; }
.popup .detail { flex: 1; }
.popup-head { cursor: default; position: sticky; top: 0; z-index: 2; }

/* ===== Lot d'améliorations : HUD, mini-carte, fenêtres, modales, préférences ===== */
.node { width: var(--nw, 212px); height: var(--nh, 40px); }
.node.kind-root { height: var(--rh, 54px); }
[data-density="compact"] .node .sub { display: none; }
[data-density="compact"] .node .title { font-size: 12px; }
[data-density="comfort"] .node .title { font-size: 13.5px; }
.node .title mark, .node .sub mark, .detail mark { background: color-mix(in srgb, #f5b942 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.hud-top { top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-top .hud-info { position: static; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; max-width: 60%; padding: 3px 6px; border-radius: 99px; background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.crumbs:empty { display: none; }
.crumbs button { border: 0; background: none; color: var(--fg-2); font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 99px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs button:hover { background: var(--hover); color: var(--fg); }
.crumbs button.cur { color: var(--accent); }
.crumbs .sep { color: var(--muted); font-size: 12px; }
.fresh { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--fg); border-radius: 99px; padding: 5px 12px; font-weight: 700; font-size: 12.5px; }
.updated { font-size: 11.5px; color: var(--muted); }

.hud-controls button { width: 34px; height: 32px; font-size: 16px; }
.minimap { left: 60px; bottom: 14px; width: 200px; height: 130px; border-radius: 12px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel) 90%, transparent); box-shadow: var(--shadow-sm); cursor: crosshair; }
@media (max-width: 960px) { .minimap { display: none; } .crumbs { max-width: 100%; } }

.canvas.focus .node:not(.sel):not(.onpath):not(.near):not(.kind-root) { opacity: .28; }
.canvas.focus .edge:not(.hot) { opacity: .25; }
.canvas.vertical .tw { right: auto; top: auto; left: 50%; bottom: -11px; margin: 0 0 0 -11px; transform: rotate(90deg); }
.canvas.vertical .node[aria-expanded="true"] .tw { transform: rotate(180deg); }

/* Fenêtre principale redimensionnable + fenêtres épinglées */
.window { resize: horizontal; min-width: 320px; max-width: calc(100% - 28px); }
.window.pinned { position: absolute; top: 60px; width: 400px; height: 70%; resize: both; min-height: 200px; }
.win-head .icon-btn.small { width: 26px; height: 26px; font-size: 15px; }
.card > h3 { cursor: pointer; user-select: none; position: relative; padding-right: 30px; }
.card > h3::after { content: "▾"; position: absolute; right: 12px; transition: transform .2s; }
.card.collapsed > h3::after { transform: rotate(-90deg); }
.card.collapsed > :not(h3) { display: none; }
.card.collapsed > h3 { border-bottom: 0; }
.thumb { display: block; max-width: 100%; max-height: 240px; margin-top: 8px; border-radius: 10px; border: 1px solid var(--line); }
.detail a { color: var(--accent); font-weight: 600; }
.notes { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.notes li { padding: 8px 10px; border-radius: 10px; background: var(--panel-3); }
.n-body { white-space: pre-wrap; margin-top: 3px; }
.note-form { display: flex; gap: 8px; align-items: flex-end; }
.note-form textarea { flex: 1; resize: vertical; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 8px; font: inherit; }
.linkish { border: 0; background: none; color: var(--t-danger); font-size: 12px; margin-left: 8px; cursor: pointer; }
.muted { color: var(--muted); }
.primary-btn { border: 0; border-radius: 9px; padding: 7px 14px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); cursor: pointer; }
.ghost-btn.danger:hover { border-color: var(--t-danger); color: var(--t-danger); }

/* Barre d'outils : calendrier, options, filtres enregistrés */
.datefield { position: relative; }
.calendar { position: absolute; top: calc(100% + 6px); left: 0; z-index: 80; width: 270px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); text-transform: none; letter-spacing: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--fg); text-transform: capitalize; }
.cal-head button { border: 0; background: var(--panel-2); color: var(--fg); width: 28px; height: 28px; border-radius: 8px; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); }
.cal-day { height: 30px; border: 0; border-radius: 8px; background: none; color: var(--fg-2); font-weight: 600; font-size: 12.5px; }
.cal-day:hover:not(:disabled) { background: var(--hover); }
.cal-day:disabled { opacity: .3; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.range { background: var(--accent-soft); color: var(--fg); }
.cal-day.edge { background: var(--accent); color: #fff; }
.cal-hint { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.saved { display: flex; gap: 4px; }
.saved select { max-width: 200px; }
#flags button.on { background: var(--accent-soft); color: var(--accent); }
.chip.clear { cursor: pointer; color: var(--muted); padding: 2px 10px; }

/* Modales */
.modal { border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); color: var(--fg); padding: 22px 24px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(5, 8, 16, .55); backdrop-filter: blur(3px); }
.modal h2 { margin: 0 0 12px; font-size: 18px; }
.modal h3 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.modal form { margin-top: 16px; text-align: right; }
.modal .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal input[type="text"], .modal select { height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 0 10px; flex: 1; min-width: 140px; }
.keys { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
.keys dt { font: 600 12px var(--mono); color: var(--accent); }
.keys dd { margin: 0; }
code { font: 12px var(--mono); background: var(--panel-3); padding: 1px 5px; border-radius: 5px; }
.share-result { margin-top: 12px; display: grid; gap: 10px; justify-items: start; }
.share-result img { border-radius: 10px; background: #fff; padding: 6px; }
.share-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 220px; overflow: auto; }
.share-list li { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.share-list li > div { flex: 1; min-width: 0; }
.prefs { display: grid; gap: 12px; }
.prefs label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.prefs label:has(input[type="checkbox"]) { justify-content: flex-start; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--fg); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: block; }
.dot.ok { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.dot.bad { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.center-page { display: grid; place-items: center; min-height: 100vh; }

/* Accessibilité : contraste élevé, animations réduites */
[data-contrast="high"] { --line: #6b7699; --line-2: #8a95ba; --muted: #c3c9de; --fg-2: #fff; }
[data-theme="light"][data-contrast="high"] { --line: #555e7c; --line-2: #3a4262; --muted: #2a3150; --fg-2: #000; }
[data-contrast="high"] .node { border-width: 2px; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }

/* ===== Panel de modération DFF ===== */
.tab-sep { align-self: center; margin: 0 4px 0 10px; padding-left: 12px; border-left: 1px solid var(--line-2); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tab-dff[aria-selected="true"] { background: color-mix(in srgb, var(--t-danger, #ef4444) 18%, transparent) !important; }
.panel-mode .presets, .panel-mode .datefield, .panel-mode .field.narrow, .panel-mode .saved, .panel-mode #flags { display: none !important; }
.panel-mode .hud-controls, .panel-mode .minimap, .panel-mode .crumbs, .panel-mode .fresh, .panel-mode .updated { display: none !important; }
.panel { position: absolute; inset: 52px 0 0 0; overflow: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.panel-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-tools input, .panel-tools select { height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 0 10px; }
.panel-q { min-width: 260px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 9px 12px; background: var(--panel-2); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.grid th.sorted { color: var(--accent); }
table.grid td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; max-width: 420px; }
table.grid tbody tr { cursor: pointer; border-left: 3px solid transparent; }
table.grid tbody tr:hover { background: var(--hover); }
table.grid tbody tr.sel { background: var(--accent-soft); }
table.grid tbody tr.tone-danger td:first-child { box-shadow: inset 3px 0 0 var(--t-danger); }
table.grid tbody tr.tone-warn td:first-child { box-shadow: inset 3px 0 0 var(--t-warn); }
table.grid tbody tr.active td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; }
.detail.casier { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; padding: 0; overflow: visible; }
.detail.casier .d-head { grid-column: 1 / -1; }
label.sync { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--fg-2); }

/* ===== En-tête compact : une seule barre, menus déroulants ===== */
.topbar { flex-wrap: nowrap; gap: 8px; padding: 6px 12px; min-height: 48px; }
.topbar .brand { max-width: 170px; }
.menus { display: flex; gap: 4px; flex: none; }
.menu { position: relative; flex: none; }
.menu-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg-2); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; max-width: 260px; }
.menu-btn > span { overflow: hidden; text-overflow: ellipsis; }
.menu-btn:hover, .menu.open > .menu-btn { border-color: var(--accent); color: var(--fg); }
.menu.current > .menu-btn { background: var(--accent-soft); color: var(--fg); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.menu-btn.dff { }
.menu-btn .chev { font-size: 10px; opacity: .7; transition: transform .2s; }
.menu.open .chev { transform: rotate(180deg); }
.menu-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 90; min-width: 230px; padding: 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.menu.right .menu-pop { left: auto; right: 0; }
.menu.open > .menu-pop { display: grid; gap: 2px; animation: pop .15s var(--ease); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--fg-2); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--hover); color: var(--fg); }
.menu-item.on { background: var(--accent-soft); color: var(--fg); }
.menu-item.danger:hover { color: var(--t-danger); }
.menu-item kbd, .menu-item .mi-ico + span + kbd { margin-left: auto; font: 600 10.5px var(--mono); color: var(--muted); }
.menu-item i, .mi-ico { width: 18px; text-align: center; color: var(--muted); }
.menu-item.on i, .menu-item.on .mi-ico { color: var(--accent); }
#menu-user form { margin: 0; }
#menu-user .menu-btn { padding-left: 4px; }
.count-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }

.filters-pop { width: 360px; padding: 14px; gap: 12px !important; }
.filters-pop .field { display: grid; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.filters-pop .field[hidden] { display: none; }
.filters-pop select, .filters-pop input[type="time"] { height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 0 8px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.filters-pop .row { display: flex; gap: 8px; align-items: center; }
.filters-pop .row select { flex: 1; }
.filters-pop .seg { display: flex; flex-wrap: wrap; }
.filters-pop .calendar { position: static; width: auto; box-shadow: none; margin-top: 4px; }

.search { flex: 1 1 260px; min-width: 160px; max-width: 520px; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.topbar .chips { flex: 0 1 auto; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.topbar .chip { flex: none; }
.topbar-right { margin-left: auto; gap: 6px; flex: none; }
.toolbar { display: none !important; }

/* Icônes (Font Awesome) */
.ico i, .sg-ico i, .dot i { font-size: inherit; }
.node .ico { font-size: 13px; color: var(--tone, var(--fg-2)); }
.d-head .ico { font-size: 22px; color: var(--tone, var(--fg-2)); }
.ic-on { color: #22c55e; } .ic-off { color: var(--muted); } .ic-ok { color: #22c55e; } .ic-bad { color: #ef4444; }
.badge i, .pill i, .chip i.fa-solid { margin-right: 3px; }
.card > h3 i { margin-right: 6px; color: var(--accent); }
.timeline .dot { font-size: 12px; }
.hud-controls button i { font-size: 14px; }
.win-head .grip { color: var(--muted); }

/* VirusTotal */
.vt { margin-top: 6px; padding: 6px 10px; border-radius: 9px; font-size: 12.5px; background: var(--panel-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vt.ok { color: #22c55e; background: color-mix(in srgb, #22c55e 12%, transparent); }
.vt.bad { color: #ef4444; background: color-mix(in srgb, #ef4444 14%, transparent); font-weight: 700; }
.vt.warn { color: var(--t-warn, #f5b942); }
.vt .ghost-btn { padding: 3px 9px; font-size: 12px; }

@media (max-width: 1100px) { .topbar .brand span, #me-name { display: none; } .topbar .chips { display: none; } }
@media (max-width: 760px) { .topbar { flex-wrap: wrap; } .search { order: 5; flex-basis: 100%; max-width: none; } .filters-pop { width: min(360px, calc(100vw - 24px)); } }

.filters-pop .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.filters-pop .check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--fg-2); cursor: pointer; }
.filters-pop input[type="number"] { width: 90px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 0 8px; }

.filters-pop { max-height: calc(100vh - 80px); overflow: auto; }
.filters-pop .extras { display: grid; gap: 12px; }
.filters-pop .extras input[type="text"], .filters-pop .extras select { width: 100%; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 0 8px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.seg.days button { min-width: 34px; }
.seg.days button.on { background: var(--accent-soft); color: var(--accent); }
.panel-tools .num { width: 110px; }

/* ===== Panel du staff : outils, frise, galerie, notifications, mini-fiche, thèmes ===== */
.node.probation { box-shadow: 0 0 0 2px #f59e0b, 0 3px 12px rgba(0, 0, 0, .22); }
.node.probation::after { content: "PROBATION"; position: absolute; top: -9px; left: 10px; font-size: 9px; font-weight: 800; letter-spacing: .08em;
  padding: 1px 6px; border-radius: 99px; background: #f59e0b; color: #111; }
table.grid tbody tr.probation td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.badge.warn { background: color-mix(in srgb, #f59e0b 25%, transparent); color: #f59e0b; }
.timeline li.openable, .l-text.openable { cursor: pointer; }
.timeline li.openable:hover .t-text, .l-text.openable:hover { color: var(--accent); }
.timeline li.current { background: var(--accent-soft); border-radius: 8px; }
.thumbs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.thumbs img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.wdiff { line-height: 1.6; white-space: pre-wrap; }
.wdiff del { background: color-mix(in srgb, #ef4444 25%, transparent); color: inherit; text-decoration: line-through; border-radius: 3px; }
.wdiff ins { background: color-mix(in srgb, #22c55e 25%, transparent); text-decoration: none; border-radius: 3px; }
.bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 110px; padding: 10px 14px; }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 3px; }
.bar { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(var(--accent), var(--accent-2)); }
.bar-col small { font-size: 9px; color: var(--muted); }
.gantt { padding: 10px 14px; display: grid; gap: 4px; overflow-x: auto; }
.g-axis, .g-lane { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 8px; min-width: 560px; }
.g-ticks { display: flex; justify-content: space-between; font: 600 10.5px var(--mono); color: var(--muted); }
.g-track { position: relative; height: 22px; border-radius: 6px; background: var(--panel-3); }
.g-bar { position: absolute; top: 3px; height: 16px; border: 0; border-radius: 4px; background: var(--t-voice, var(--accent)); cursor: pointer; padding: 0; }
.g-bar.tone-danger { background: var(--t-danger); }
.g-mark { position: absolute; top: -2px; width: 3px; height: 26px; border-radius: 2px; background: var(--fg-2); opacity: .7; }
.g-mark.mod { background: #f59e0b; opacity: 1; }
.g-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 10px 14px; }
.g-tile { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel-3); padding: 0; cursor: pointer; }
.g-tile img { width: 100%; height: 100%; object-fit: cover; }
.g-tile.deleted { outline: 2px solid var(--t-danger); }
.g-file { display: grid; place-items: center; gap: 6px; height: 100%; padding: 8px; color: var(--fg-2); font-size: 28px; }
.g-file small { font-size: 11px; word-break: break-all; }
.g-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 10px; background: rgba(0, 0, 0, .55); color: #fff; }
.member-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.assign { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.assign select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); }
.hovercard { position: fixed; z-index: 120; width: 290px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: 8px; animation: pop .15s var(--ease); }
.hc-head { display: flex; gap: 10px; align-items: center; }
.hc-head img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.kv.small dt, .kv.small dd { font-size: 12px; padding: 3px 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare .detail { padding: 0; }
.split2 { display: grid; grid-template-columns: 1fr 360px; gap: 14px; align-items: start; }
.rules { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.rule { padding: 8px 10px; border-radius: 10px; background: var(--panel-2); display: grid; gap: 4px; }
.live { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.live li { display: grid; grid-template-columns: 26px 130px 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); animation: pop .2s var(--ease); }
.live li.kind-alert { border-color: #f59e0b; }
.matrix td { text-align: center; }
.matrix td:first-child { text-align: left; }
.status-row { display: flex; gap: 8px; align-items: center; }
.notif-pop { width: 360px; max-height: 70vh; overflow: auto; }
.menu-item.notif.unread { background: var(--accent-soft); }
.menu-item .grow, .grow { flex: 1; min-width: 0; }
.menu-btn.icon { width: 34px; padding: 0; justify-content: center; position: relative; }
.menu-btn.icon .count-badge { position: absolute; top: -4px; right: -4px; }
.row.spread { justify-content: space-between; padding: 4px 8px; }
.pad { padding: 8px 10px; }
.keymap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; }
.key-input { width: 34px; text-align: center; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); font: 700 13px var(--mono); }
input[type="range"] { accent-color: var(--accent); }

/* Thèmes supplémentaires */
[data-theme="midnight"] { color-scheme: dark; --bg: #050b18; --bg-2: #08122a; --panel: #0b1733; --panel-2: #102042; --panel-3: #16294f;
  --line: #1c3060; --line-2: #26407a; --fg: #e6eeff; --fg-2: #b9c8ea; --muted: #7f93c2; --hover: rgba(120, 160, 255, .08); }
[data-theme="warm"] { color-scheme: light; --bg: #faf6ef; --bg-2: #f3ecdf; --panel: #fffdf8; --panel-2: #f8f2e7; --panel-3: #f0e7d6;
  --line: #e6dac4; --line-2: #d8c7a8; --fg: #2b2116; --fg-2: #4d3d2b; --muted: #8a7559; --hover: rgba(120, 80, 20, .06); }
body { font-size: 1rem; }

/* Position de la fenêtre de détail */
[data-layout="left"] .window:not(.pinned):not(.dragged) { right: auto; left: 14px; }
[data-layout="bottom"] .window:not(.pinned):not(.dragged) { top: auto; left: 14px; right: 14px; width: auto; height: 46%; resize: vertical; }

/* Mobile */
@media (max-width: 760px) {
  .topbar { gap: 6px; padding: 6px 8px; }
  .menus { order: 4; flex: 1 1 100%; }
  .menus .menu { flex: 1; } .menus .menu-btn { width: 100%; justify-content: center; }
  .menu-pop { position: fixed; left: 8px !important; right: 8px !important; top: 56px; width: auto !important; max-height: 75vh; overflow: auto; }
  .panel { inset: 46px 0 0 0; padding: 0 8px 8px; }
  table.grid thead { display: none; }
  table.grid tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 8px; border-bottom: 1px solid var(--line); }
  table.grid td { border: 0; padding: 2px 0; max-width: none; }
  .detail.casier, .compare, .split2 { grid-template-columns: 1fr; }
  .hud-controls { display: none; }
  .window { height: 78% !important; }
  .live li { grid-template-columns: 22px 1fr; } .live li .t-time { display: none; }
}

/* ===== Champs de formulaire dans le panel (accès, outils) ===== */
.panel select, .panel input[type="text"], .panel input[type="number"], .panel input[type="datetime-local"], .panel input[type="search"],
.detail select, .detail input[type="text"], .detail input[type="datetime-local"] {
  height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg);
  padding: 0 8px; font: inherit; font-size: 13px; color-scheme: dark; }
[data-theme="light"] .panel select, [data-theme="warm"] .panel select, [data-theme="light"] .detail select, [data-theme="warm"] .detail select { color-scheme: light; }
.panel select:focus, .panel input:focus, .detail select:focus, .detail input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.panel input::placeholder, .detail input::placeholder { color: var(--muted); }
.access .card .body { display: grid; gap: 10px; }
.access .card.wide { grid-column: 1 / -1; }
.access table.grid td { vertical-align: middle; }
.access table.grid td select { width: 100%; min-width: 150px; }
.add-role { display: grid; grid-template-columns: 1fr 170px; gap: 8px; }
.table-scroll { overflow-x: auto; }
.matrix { min-width: 760px; }
.matrix th { white-space: normal; font-size: 10.5px; text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; min-width: 220px; }
.matrix input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.perm-list { display: grid; gap: 6px; max-height: 420px; overflow: auto; padding-right: 4px; }
.perm-row { display: grid; grid-template-columns: 1fr 170px; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.perm-row.strong { font-weight: 700; border-bottom: 0; }
.perm-row select { width: 100%; }
.access .card .primary-btn { justify-self: start; }

.matrix .group-row td { background: var(--panel-3); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); text-align: left; }
.matrix input:disabled { opacity: .45; cursor: not-allowed; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.perm-group summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.list li.expired { opacity: .55; }
.muted.small { font-size: 11px; }

/* ===== Menu contextuel ===== */
.ctxmenu { position: fixed; z-index: 200; min-width: 230px; max-width: 320px; padding: 6px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: 1px; animation: pop .12s var(--ease); }
.ctx-title { padding: 6px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--fg-2); font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer; }
.ctx-item:hover, .ctx-item:focus { background: var(--accent-soft); color: var(--fg); outline: none; }
.ctx-item i { width: 16px; text-align: center; color: var(--muted); }
.ctx-item:hover i, .ctx-item:focus i { color: var(--accent); }
.ctx-item span { flex: 1; }
.ctx-item kbd { font: 600 10.5px var(--mono); color: var(--muted); }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--line); }

/* ===== Recherche rapide (membres) et recherche dans l'application ===== */
.ac-wrap { position: relative; display: inline-block; min-width: 220px; }
.ac-wrap > input { width: 100%; }
.ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 240px; z-index: 150; max-height: 300px; overflow: auto;
  padding: 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.ac-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none;
  color: var(--fg-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.ac-item:hover, .ac-item.active { background: var(--accent-soft); color: var(--fg); }
.ac-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; flex: none; }
@keyframes flash { 0%, 100% { box-shadow: none; } 20%, 60% { box-shadow: 0 0 0 3px var(--accent), 0 0 18px var(--glow); background: var(--accent-soft); } }
.flash { animation: flash 2.4s var(--ease); border-radius: 8px; }

/* ===== Éléments correspondant à la dernière recherche ===== */
@keyframes hitpulse { 0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 10px var(--glow); } 50% { box-shadow: 0 0 0 4px var(--accent), 0 0 22px var(--glow); } }
.search-hit { animation: hitpulse 1.6s ease-in-out infinite; border-radius: 8px; transition: box-shadow .6s, background .6s; }
.node.search-hit { border-color: var(--accent) !important; }
tr.search-hit td, .perm-row.search-hit, .l-text.search-hit, .t-text.search-hit { background: var(--accent-soft); }
.search-hit.search-fade { animation: none; box-shadow: 0 0 0 1px transparent; background: transparent; }
.reduce-motion .search-hit { animation: none !important; box-shadow: 0 0 0 3px var(--accent) !important; }

.chip.inactive { opacity: .5; border-style: dashed; }
.chip.inactive span { text-decoration: line-through; }
.chip small { font-size: 10px; color: var(--muted); font-style: italic; }

/* ===== Personnalisation ===== */
body { font-family: var(--font, system-ui, sans-serif); }
.node { border-radius: var(--node-r, 12px); }
.edge { stroke-width: var(--edge-w, 1.7); }
.edge.hot { stroke-width: calc(var(--edge-w, 1.7) + 1); }
.window:not(.pinned) { background: color-mix(in srgb, var(--panel) var(--win-alpha, 95%), transparent); }
.node, .edge, .world.smooth, .window, .menu-pop, .ctxmenu { transition-duration: calc(.38s / var(--speed, 1)); animation-duration: calc(.4s / var(--speed, 1)); }
[data-bg="grid"] .canvas { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); }
[data-bg="none"] .canvas { background-image: none; }
.hide-minimap .minimap, .hide-crumbs .crumbs, .hide-controls .hud-controls, .hide-updated .updated, .hide-treeinfo .hud-info,
.hide-subs .node .sub, .hide-badges .node .badge, .hide-times .node .time, .hide-counts .node .count, .hide-icons .node .ico { display: none !important; }
.compact-top .menu-btn > span, .compact-top .brand span, .compact-top #me-name { display: none; }
.compact-top .search { flex-basis: 200px; }
.menu-item.fav::after { content: "★"; margin-left: auto; color: var(--accent); }
.pref-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.pref-tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; padding: 8px 12px; border-bottom: 2px solid transparent; cursor: pointer; }
.pref-tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
#settingsbox { width: min(640px, calc(100vw - 32px)); }
.pref-pane { max-height: 60vh; overflow: auto; padding-right: 4px; }
.pref-row { display: grid; grid-template-columns: 1fr 230px; gap: 12px; align-items: center; font-weight: 600; }
.pref-row small { display: block; font-weight: 400; }
.pref-row select, .pref-row input[type="color"] { width: 100%; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); }
.pref-row input[type="color"] { width: 48px; padding: 2px; }
.range { display: flex; align-items: center; gap: 8px; } .range input { flex: 1; } .range output { min-width: 52px; text-align: right; font: 600 12px var(--mono); color: var(--muted); }
.cat-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }

/* ===== Performances de l'arbre ===== */
/* Le flou d'arrière-plan (backdrop-filter) recalcule toute la zone située dessous à chaque image : on le retire des éléments
   posés sur le graphe et on les rend presque opaques à la place. */
.hud-info, .hud-controls, .crumbs, .window, .minimap, .topbar { backdrop-filter: none !important; }
.hud-info, .crumbs { background: color-mix(in srgb, var(--panel) 96%, transparent); }
.hud-controls, .minimap { background: var(--panel); }
.window:not(.pinned) { background: color-mix(in srgb, var(--panel) max(var(--win-alpha, 95%), 90%), transparent); }
.edge.hot { filter: none; }
.world { will-change: transform; contain: layout style; }
.node { contain: layout style; }   /* pas « paint » : le bouton ›, la pastille PROBATION débordent du nœud */
/* Pendant un déplacement / zoom : ni ombres, ni survols, ni transitions */
.canvas.moving .node { box-shadow: none !important; transition: none !important; pointer-events: none; }
.canvas.moving .edge { transition: none !important; }
/* Gros arbres (plus de 120 nœuds affichés) : pas d'animation de mise en page */
.canvas.big .node { transition: border-color .2s, background .2s !important; animation: none !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.canvas.big .edge { transition: stroke .2s !important; }
.app-return { display: inline-block; padding: 12px 22px; border-radius: 10px; color: #fff; font-weight: 600; text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* ---------- Timeline ---------- */
.tl-tools .tl-users { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tl-range { font: 600 12px var(--mono); }
.tl { display: grid; gap: 6px; padding: 10px 2px; }
.tl-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.tl-fam { height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--tone) 60%, transparent);
  background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--fg); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tl-fam.off { opacity: .4; text-decoration: line-through; }
.tl-grid, .tl-lane { display: grid; grid-template-columns: 170px 1fr; gap: 8px; align-items: center; min-width: 620px; }
.tl-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.tl-histwrap { position: relative; }
.tl-hist { position: relative; height: 110px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); cursor: crosshair; touch-action: none; user-select: none; }
.tl-col { position: absolute; bottom: 0; display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: hidden; }
.tl-seg { display: block; flex-basis: 0; min-height: 1px; background: var(--tone); opacity: .85; }
.tl-brush { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 4px; pointer-events: none; }
.tl-now { position: absolute; right: 0; top: -4px; bottom: -4px; width: 2px; background: var(--accent); border-radius: 2px; }
.tl-axis { display: flex; justify-content: space-between; font: 600 10.5px var(--mono); color: var(--muted); }
.tl-track { position: relative; height: 34px; border-radius: 9px; background: var(--panel-3); }
.tl-dot { position: absolute; top: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--panel); padding: 0; background: var(--tone); opacity: .9; cursor: pointer; }
.tl-dot:hover, .tl-bar:hover { opacity: 1; outline: 2px solid var(--fg); z-index: 2; }
.tl-dot.strong { box-shadow: 0 0 0 2px var(--t-danger); opacity: 1; }
.tl-bar { position: absolute; top: 8px; height: 18px; border: 0; padding: 0; border-radius: 4px; background: var(--tone); opacity: .65; cursor: pointer; }
.tl-note { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); margin: 8px 0; }
.tl-note.warn { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 10%, var(--panel)); }
.tone-invite { --tone: var(--t-member); }

/* ---------- Comportements ---------- */
.split2.wide-side { grid-template-columns: 1fr 420px; }
.bh-settings { max-height: calc(100vh - 220px); overflow: auto; }
.bh-group h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bh-det { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin: 6px 0; background: var(--panel-2); }
.bh-det summary { cursor: pointer; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.bh-det p { margin: 6px 0; font-size: 12.5px; }
.bh-params { display: grid; gap: 6px; margin: 6px 0; font-size: 12.5px; }
.bh-params label { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bh-params label.check { justify-content: flex-start; }
.bh-params input[type=number] { width: 90px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 0 6px; }
.idlist { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.bh-settings .field input[type=text] { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 0 8px; }
@media (max-width: 960px) {
  .split2.wide-side { grid-template-columns: 1fr; }
  .tl-grid, .tl-lane { grid-template-columns: 110px 1fr; min-width: 480px; }
  .tl { overflow-x: auto; }
}

/* ---------- Règles d'alerte ---------- */
.rule-modal { width: min(640px, 96vw); }
.rule-modal .prefs { max-height: 70vh; overflow: auto; }
.cond-box { display: grid; gap: 6px; }
.cond-group { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--panel-2); }
.cond-group summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.cond-group > label, .cond-group > .field { margin: 6px 0; }
.cond-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.cond-row input, .cond-row select { width: 220px; max-width: 55%; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 0 8px; }
.seg.wrap { display: flex; flex-wrap: wrap; }
.rule-test .list li.openable { cursor: pointer; }

/* ---------- Systèmes avancés (systems.js) ---------- */
.sys-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.sys-split > .detail, .sys-box { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 10px 12px; min-width: 0; }
.sys-modal { width: min(560px, calc(100vw - 24px)); }
.sys-modal .recap { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; padding: 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.sys-modal .recap dt { color: var(--muted); }
.sys-modal .recap dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sys-note { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg-2); }
.sys-note.warn { border-color: color-mix(in srgb, var(--t-warn) 50%, var(--line)); }
.sys-col { display: grid; gap: 12px; align-content: start; min-width: 0; }
.who-chain { margin: 4px 0 10px; padding-left: 22px; display: grid; gap: 4px; }
.who-tree { list-style: none; margin: 4px 0; padding-left: 18px; border-left: 2px solid var(--line-2); display: grid; gap: 4px; }
.who-tree > li { position: relative; }
.who-tree > li::before { content: ""; position: absolute; left: -18px; top: 12px; width: 14px; border-top: 2px solid var(--line-2); }
.who-body .grid { width: 100%; }
.g-cell { position: relative; }
.g-cell > .g-tile { width: 100%; }
.g-ban { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--t-danger); cursor: pointer; }
.g-ban:hover { background: var(--t-danger); color: #fff; }
.bl-drop { display: grid; place-items: center; gap: 6px; padding: 18px; border: 2px dashed var(--line-2); border-radius: 12px; text-align: center; color: var(--fg-2); cursor: pointer; }
.bl-drop.over, .bl-drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.raid-gauge { display: grid; gap: 6px; }
.raid-value b { font-size: 34px; line-height: 1; }
.raid-value .pill { margin-left: 10px; vertical-align: middle; }
.raid-track { position: relative; height: 14px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.raid-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--tone, var(--accent)); transition: width .4s var(--ease); }
.raid-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg-2); opacity: .5; }
.raid-bars { height: 60px; }
.graph-box { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); min-height: 320px; overflow: hidden; }
.graph-svg { width: 100%; height: auto; display: block; }
.g-edge { stroke: var(--line-2); stroke-opacity: .8; cursor: pointer; }
.g-edge:hover { stroke-opacity: 1; filter: drop-shadow(0 0 3px var(--glow)); }
.g-node { cursor: pointer; }
.g-node circle { fill: var(--panel-3); stroke: var(--accent); stroke-width: 2; }
.g-node.depth-0 circle { fill: var(--accent); }
.g-node.depth-2 circle { stroke: var(--muted); }
.g-node text { fill: var(--fg-2); font-size: 12px; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.g-node:hover circle, .g-node:focus circle { stroke-width: 4; }
.graph-box { position: relative; background: radial-gradient(var(--line) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--panel); }
.graph-svg.live { height: min(70vh, 640px); cursor: grab; touch-action: none; user-select: none; }
.graph-svg.live.panning { cursor: grabbing; }
.graph-svg.live .g-node { transition: opacity .15s; }
.graph-svg.live .g-disc { fill: var(--panel-3); stroke: none; }
.graph-svg.live .g-initial { fill: var(--fg-2); font-weight: 700; font-size: 13px; pointer-events: none; }
.graph-svg.live .g-ring { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.graph-svg.live .g-node.center .g-ring { stroke-width: 4; stroke: var(--accent-2); filter: drop-shadow(0 0 6px var(--glow)); }
.graph-svg.live .g-node.depth-2 .g-ring { stroke: var(--muted); }
.graph-svg.live .g-node.pinned .g-ring { stroke-dasharray: 4 3; }
.graph-svg.live .g-node.expanded .g-ring { stroke-width: 3.5; }
.graph-svg.live .g-node.sel .g-ring { stroke: var(--t-warn); stroke-width: 4; }
.graph-svg.live .g-node.loading .g-ring { animation: g-pulse .8s ease-in-out infinite alternate; }
@keyframes g-pulse { from { stroke-opacity: 1; } to { stroke-opacity: .2; } }
.graph-svg.live .g-label { pointer-events: none; }
.graph-svg.live.focus .g-node:not(.near) { opacity: .25; }
.graph-svg.live.focus .g-edge:not(.near) { stroke-opacity: .12; }
.graph-svg.live .g-edge.near { stroke-opacity: 1; }
.graph-hint { position: absolute; left: 10px; bottom: 6px; font-size: 11.5px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .graph-svg.live .g-node.loading .g-ring { animation: none; } }
.et-voice { --tone: var(--t-voice); } .et-reply { --tone: var(--t-message); } .et-mention { --tone: var(--t-profile); }
.et-invite { --tone: var(--t-member); } .et-avatar { --tone: var(--t-warn); } .et-signal { --tone: var(--t-danger); } .et-linked { --tone: var(--t-role); }
.g-edge[class*="et-"] { stroke: var(--tone); }
.tl-fam[class*="et-"] { border-color: var(--tone); }
@media (max-width: 960px) { .sys-split, .split2, .split2.wide-side { grid-template-columns: 1fr; } }


/* ===== Menu Bots → DFF (botdff.js) ===== */
.bt-page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 6px 4px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.bt-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), var(--panel)); }
.bt-hero h1, .bt-title h1 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bt-hero p, .bt-title p { margin: 4px 0 0; max-width: 760px; }
.bt-hero-icon, .bt-title-icon { font-size: 30px; width: 56px; height: 56px; flex: 0 0 56px; display: grid; place-items: center; border-radius: 16px;
  background: var(--accent-soft); color: var(--accent); }
.bt-online { margin-left: auto; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: var(--t-success); padding: 5px 12px; border-radius: 99px;
  background: color-mix(in srgb, var(--t-success) 14%, transparent); }
.bt-online::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--t-success); margin-right: 7px; }
.bt-search { height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 0 14px; min-width: 220px; }
.bt-search.big { height: 46px; font-size: 15px; border-radius: 14px; width: 100%; }
.bt-search:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.bt-groups { display: grid; gap: 22px; }
.bt-group h2 { margin: 0 0 10px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.bt-tile { text-align: left; display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel); color: var(--fg); cursor: pointer; transition: transform .15s var(--ease), border-color .15s, box-shadow .15s; min-height: 170px; }
.bt-tile:hover, .bt-tile:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.bt-tile-top { display: flex; justify-content: space-between; align-items: center; }
.bt-tile-icon { font-size: 22px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-3); }
.bt-tile-title { font-weight: 800; font-size: 15px; }
.bt-tile-desc { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bt-tile-figure { margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 13px; }
.bt-tile-figure b { font-size: 24px; color: var(--fg); letter-spacing: -.02em; }
.bt-tile-figure.bad { color: var(--t-danger); font-weight: 600; }
.bt-tile-state { font-size: 12px; font-weight: 600; color: var(--accent); }
.bt-tile.t-danger .bt-tile-figure b, .bt-tile.t-danger .bt-tile-state { color: var(--t-danger); }
.bt-tile.t-warn .bt-tile-figure b { color: var(--t-warn); }
.bt-tile.t-ok .bt-tile-figure b { color: var(--t-success); }
.bt-back { justify-self: start; border: 0; background: transparent; color: var(--accent); font-weight: 700; padding: 4px 0; }
.bt-back:hover { text-decoration: underline; }
.bt-title { display: flex; gap: 16px; align-items: center; }
.bt-card { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 16px 18px; display: grid; gap: 12px; min-width: 0; }
.bt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bt-card-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.bt-count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel-3); border-radius: 99px; padding: 1px 9px; }
.bt-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bt-toolbar select { height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 0 10px; }
.bt-btn { height: 38px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); padding: 0 16px; font-weight: 700; }
.bt-btn:hover { border-color: var(--accent); }
.bt-btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.bt-btn.danger { border: 0; color: #fff; background: var(--t-danger); }
.bt-btn:disabled { opacity: .55; cursor: wait; }
.bt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.bt-stat { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 14px 16px; }
.bt-stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.bt-stat-label { color: var(--muted); font-size: 12.5px; }
.bt-stat.t-accent .bt-stat-value { color: var(--accent); }
.bt-stat.t-warn .bt-stat-value { color: var(--t-warn); }
.bt-stat.t-danger .bt-stat-value { color: var(--t-danger); }
.bt-stat.t-ok .bt-stat-value { color: var(--t-success); }
.bt-notice { border-radius: 12px; padding: 10px 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg-2); }
.bt-notice.t-info, .bt-notice.t-accent { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.bt-notice.t-ok { border-color: color-mix(in srgb, var(--t-success) 45%, transparent); background: color-mix(in srgb, var(--t-success) 10%, transparent); color: var(--fg); }
.bt-notice.t-warn { border-color: color-mix(in srgb, var(--t-warn) 45%, transparent); background: color-mix(in srgb, var(--t-warn) 10%, transparent); color: var(--fg); }
.bt-notice.t-danger { border-color: color-mix(in srgb, var(--t-danger) 45%, transparent); background: color-mix(in srgb, var(--t-danger) 10%, transparent); color: var(--fg); }
.bt-chip { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 2px 10px; background: var(--panel-3); color: var(--fg-2); white-space: nowrap; }
.bt-chip.t-ok { background: color-mix(in srgb, var(--t-success) 16%, transparent); color: var(--t-success); }
.bt-chip.t-warn { background: color-mix(in srgb, var(--t-warn) 16%, transparent); color: var(--t-warn); }
.bt-chip.t-danger { background: color-mix(in srgb, var(--t-danger) 16%, transparent); color: var(--t-danger); }
.bt-chip.t-info, .bt-chip.t-accent { background: var(--accent-soft); color: var(--accent); }
.bt-table-wrap { overflow-x: auto; }
.bt-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.bt-table th { text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.bt-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.bt-table tr:last-child td { border-bottom: 0; }
.bt-table tbody tr:hover { background: var(--hover); }
.bt-table th.narrow, .bt-table td.c-toggle { width: 1%; white-space: nowrap; }
.bt-table td.c-text { color: var(--fg-2); max-width: 520px; }
.bt-row-actions { white-space: nowrap; text-align: right; width: 1%; }
.bt-icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--fg-2); font-size: 15px; }
.bt-icon-btn:hover { background: var(--panel-3); border-color: var(--line); }
.bt-icon-btn.danger:hover { color: var(--t-danger); border-color: color-mix(in srgb, var(--t-danger) 40%, transparent); }
.bt-entity { font-weight: 600; color: var(--fg); background: var(--panel-3); border-radius: 7px; padding: 1px 7px; }
.bt-entity[style*="--role"] { color: var(--role); }
.bt-entity.gone { color: var(--muted); text-decoration: line-through; }
.bt-code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.bt-date { color: var(--muted); white-space: nowrap; font-size: 13px; }
.bt-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; background: var(--panel-2); font-size: 28px; }
.bt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.bt-tile-item { border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 8px; background: var(--panel-2); }
.bt-tile-item .bt-thumb { width: 100%; height: 150px; }
.bt-tile-meta { display: grid; gap: 3px; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.bt-tile-item .bt-row-actions { text-align: left; }
.bt-empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.bt-empty-icon { font-size: 28px; opacity: .6; }
.bt-pager { display: flex; justify-content: center; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.bt-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.bt-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.bt-slider { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .2s; cursor: pointer; }
.bt-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.bt-switch input:checked + .bt-slider { background: var(--t-success); }
.bt-switch input:checked + .bt-slider::before { transform: translateX(20px); }
.bt-switch input:disabled + .bt-slider { opacity: .5; cursor: not-allowed; }
.bt-switch input:focus-visible + .bt-slider { box-shadow: 0 0 0 3px var(--accent-soft); }
.bt-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.bt-field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.bt-field.wide { grid-column: 1 / -1; }
.bt-flabel { font-weight: 700; font-size: 13px; }
.bt-req { color: var(--t-danger); }
.bt-help { color: var(--muted); font-size: 12px; }
.bt-field input:not([type="checkbox"]), .bt-field select, .bt-field textarea, .bt-inline input, .bt-filter select {
  width: 100%; min-height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 6px 12px; font: inherit; }
.bt-field textarea { resize: vertical; min-height: 76px; }
.bt-field input:focus, .bt-field select:focus, .bt-field textarea:focus, .bt-inline input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.bt-field :disabled { opacity: .7; }
.bt-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.bt-actions.left { justify-content: flex-start; }
.bt-inline { display: flex; gap: 10px; }
.bt-inline input { flex: 1; }
.bt-result:empty { display: none; }
.bt-lead { margin: 0; color: var(--fg-2); }
.bt-bar { height: 10px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bt-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s var(--ease); }
.bt-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.bt-filter { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 200px; }
.bt-chipgroups { display: grid; gap: 12px; }
.bt-chipgroup-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.bt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-picker { position: relative; }
.bt-suggest { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; border: 1px solid var(--line-2);
  border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-sm); max-height: 240px; overflow: auto; }
.bt-suggest li { padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.bt-suggest li:hover, .bt-suggest li:focus { background: var(--sel); outline: none; }
.bt-drop { display: grid; place-items: center; gap: 8px; min-height: 130px; padding: 16px; border: 2px dashed var(--line-2); border-radius: 14px; color: var(--muted);
  text-align: center; cursor: pointer; transition: .15s; }
.bt-drop:hover, .bt-drop.over, .bt-drop:focus { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); outline: none; }
.bt-drop-preview { max-height: 160px; max-width: 100%; border-radius: 10px; }
.bt-modal { width: min(640px, calc(100vw - 24px)); }
.bt-modal form { margin: 0; text-align: left; }
.bt-modal h2 { margin: 0 0 16px; }
.bt-confirm { width: min(440px, calc(100vw - 24px)); }
.bt-confirm p { margin: 0 0 16px; font-size: 15px; }
.bt-vbars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; height: 190px; align-items: end; padding-bottom: 20px; position: relative; }
.bt-vbar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bt-vbar-fill { width: 100%; max-width: 34px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.bt-vbar:hover .bt-vbar-fill { filter: brightness(1.2); }
.bt-vbar-val { font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.bt-vbar-label { position: absolute; bottom: -18px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.bt-hbars { display: grid; gap: 8px; }
.bt-hbar { display: grid; grid-template-columns: minmax(90px, 200px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bt-hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-hbar-track { height: 12px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bt-hbar-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.menu-btn.bots .fa-robot { color: var(--accent); }
@media (max-width: 720px) {
  .bt-hero { flex-wrap: wrap; }
  .bt-online { margin-left: 0; }
  .bt-table thead { display: none; }
  .bt-table, .bt-table tbody, .bt-table tr, .bt-table td { display: block; width: 100%; }
  .bt-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .bt-table td { border: 0; padding: 4px 6px; }
  .bt-table td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-size: 12px; }
  .bt-row-actions { text-align: left; width: auto; }
  .bt-search { min-width: 0; width: 100%; }
}

.bl-thumb { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 4px; }
.bt-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); justify-self: start; }
.bt-tab { border: 0; background: transparent; color: var(--fg-2); font-weight: 700; padding: 8px 16px; border-radius: 10px; }
.bt-tab:hover { color: var(--fg); background: var(--hover); }
.bt-tab.on { background: var(--accent-soft); color: var(--accent); }
.bt-table tr.openable { cursor: pointer; }
.bt-table td .bt-chip, .bt-table td .bt-code { margin: 0 4px 2px 0; }
.bt-entity.link { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.bt-entity.link:hover { background: var(--accent-soft); color: var(--accent); text-decoration: underline; }
.bt-chip-x { border: 0; background: transparent; color: inherit; font-weight: 800; cursor: pointer; padding: 0 0 0 4px; }
.tl-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tl-filters-label { font-weight: 700; font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.tl-filters .tl-fam { display: inline-flex; align-items: center; gap: 7px; }
.tl-count { font: 700 11px var(--mono); padding: 1px 7px; border-radius: 99px; background: var(--panel-3); color: var(--fg-2); }
.tl-cluster { position: absolute; top: 5px; min-width: 24px; height: 24px; margin-left: -12px; padding: 0 6px; border-radius: 99px; border: 2px solid var(--panel);
  background: var(--tone); color: #fff; font: 800 11.5px var(--mono); cursor: pointer; z-index: 1; box-shadow: var(--shadow-sm); }
.tl-cluster:hover, .tl-cluster:focus-visible { z-index: 3; outline: 2px solid var(--fg); }
.tl-cluster.strong { box-shadow: 0 0 0 2px var(--t-danger); }
.tl-listbox { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 8px 12px; margin-top: 6px; }
.tl-listbox summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.tl-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.tl-list li { display: flex; gap: 10px; align-items: baseline; padding: 5px 8px; border-radius: 8px; font-size: 13px; }
.tl-list li.openable { cursor: pointer; }
.tl-list li.openable:hover { background: var(--hover); }
.tl-list-hour { font-weight: 700; color: var(--muted); font-size: 12px !important; text-transform: capitalize; padding-top: 10px !important; }
.tl-list-time { font: 600 12px var(--mono); color: var(--muted); flex: 0 0 auto; }
.tl-list-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tone); flex: 0 0 10px; align-self: center; }
.jn-details { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 12px; color: var(--fg-2); }
.bt-toolbar input[type="date"] { height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 0 10px; }
.cs-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cs-head-main { flex: 1; min-width: 260px; display: grid; gap: 4px; }
.cs-title { font-size: 22px; font-weight: 800; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--fg); padding: 4px 8px; margin-left: -8px; }
.cs-title:hover, .cs-title:focus { border-color: var(--line); background: var(--panel); outline: none; }
.cs-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cs-col { display: grid; gap: 16px; min-width: 0; }
.cs-body, .cs-composer textarea { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); padding: 12px 14px; font: inherit; line-height: 1.55; resize: vertical; }
.cs-body:focus, .cs-composer textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.cs-notes { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.cs-note { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--panel-2); }
.cs-note-head { display: flex; gap: 10px; align-items: center; }
.cs-note-head .bt-icon-btn { margin-left: auto; width: 28px; height: 28px; }
.cs-note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.cs-composer { display: grid; gap: 6px; }
.cs-drop { min-height: 80px; }
.cs-files { display: grid; gap: 8px; }
.cs-file { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.cs-file .bt-thumb { width: 64px; height: 64px; font-size: 22px; }
@media (max-width: 960px) { .cs-grid { grid-template-columns: 1fr; } }
