/* TRUprisma — charte TRUvector : cyberpunk sombre, Orbitron + Share Tech Mono, cyan / violet / or */
@font-face { font-family: 'Orbitron'; font-weight: 500; font-display: swap; src: url(../fonts/orbitron-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Orbitron'; font-weight: 700; font-display: swap; src: url(../fonts/orbitron-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Orbitron'; font-weight: 900; font-display: swap; src: url(../fonts/orbitron-latin-900-normal.woff2) format('woff2'); }
@font-face { font-family: 'Share Tech Mono'; font-weight: 400; font-display: swap; src: url(../fonts/share-tech-mono-latin-400-normal.woff2) format('woff2'); }

:root {
  --bg: #05060d; --bg2: #0a0d1b; --panel: #0e1226; --panel2: #121734; --line: #1e2547; --line2: #2a3366;
  --cyan: #00e5ff; --purple: #b347ff; --gold: #ffc940; --text: #d6e2ff; --muted: #7d89b3; --red: #ff5c7a; --green: #3dffa8; --blue: #5b7bff;
  --sel: rgba(0, 229, 255, .22); --hover: rgba(0, 229, 255, .07);
  --mono: 'Share Tech Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --orb: 'Orbitron', 'Share Tech Mono', sans-serif;
  --r: 8px; --shadow: 0 12px 40px rgba(0, 0, 0, .55);
  --syn-k: #ff79c6; --syn-s: #3dffa8; --syn-n: #ffc940; --syn-p: #00e5ff; --syn-c: #5f6b94; --syn-b: #b347ff; --syn-h: #b347ff; --syn-f: #82aaff; --syn-a: #ff9e64; --syn-t: #7fdbca; --syn-q: #9aa5ce; --syn-l: #00e5ff;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f6fc; --bg2: #eaeef8; --panel: #ffffff; --panel2: #f6f8fd; --line: #d8deef; --line2: #c3cbe5;
  --cyan: #0091b3; --purple: #8a2be2; --gold: #b07a00; --text: #18203a; --muted: #5b678f; --red: #d6304f; --green: #0f8f5b; --blue: #3552d6;
  --sel: rgba(0, 145, 179, .18); --hover: rgba(0, 145, 179, .06); --shadow: 0 12px 40px rgba(30, 40, 80, .18);
  --syn-k: #c3127a; --syn-s: #0f7a4a; --syn-n: #a35d00; --syn-p: #00708a; --syn-c: #8a93ad; --syn-b: #7a26c9; --syn-h: #7a26c9; --syn-f: #3552d6; --syn-a: #c4511a; --syn-t: #0b7d72; --syn-q: #5b678f; --syn-l: #00708a;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--mono); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 10% 0%, rgba(0,229,255,.07), transparent 50%), radial-gradient(ellipse at 95% 40%, rgba(179,71,255,.07), transparent 50%); }
[data-theme="light"] body::before { opacity: .5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 12px; transition: border-color .15s, background .15s, color .15s; }
button:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(135deg, rgba(0,229,255,.18), rgba(179,71,255,.18)); border-color: var(--cyan); color: var(--cyan); }
button.danger { border-color: var(--red); color: var(--red); }
button.big { padding: 10px 20px; font-size: 15px; }
button.icon { background: transparent; border-color: transparent; padding: 2px 7px; min-width: 28px; color: var(--muted); }
button.icon:hover:not(:disabled) { color: var(--cyan); border-color: var(--line); }
button.icon.tiny { font-size: 11px; padding: 0 4px; min-width: 0; }
input, select, textarea { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--sel); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--bg2); color: var(--muted); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--red); } .ok { color: var(--green); } .warn, .warn-text { color: var(--gold); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--cyan); color: var(--bg); padding: 6px 12px; }
.skip:focus { left: 8px; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--cyan); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }

/* ---------------------------------------------------------------- barre haute & onglets */
.topbar { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: rgba(10, 13, 27, .9); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); min-width: 0; }
[data-theme="light"] .topbar { background: rgba(255,255,255,.9); }
.logo { display: flex; align-items: center; gap: 8px; background: none; border: none; padding: 2px 6px; color: var(--text); }
.logo svg { width: 36px; height: 27px; }
.logo .lt { font: 700 15px var(--orb); letter-spacing: .06em; }
.logo .lt b { font-weight: 900; background: linear-gradient(90deg, var(--cyan), var(--purple) 60%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { flex: 1; display: flex; gap: 4px; overflow-x: auto; min-width: 0; scrollbar-width: thin; }
.tab { display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 10px; border: 1px solid var(--line); border-radius: 7px 7px 0 0; border-bottom-color: transparent; background: var(--bg2); cursor: pointer; white-space: nowrap; max-width: 240px; color: var(--muted); font-size: 13px; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--panel); color: var(--text); border-color: var(--line2); box-shadow: inset 0 2px 0 var(--cyan); }
.tab .tf { width: 8px; height: 8px; transform: rotate(45deg); background: hsl(var(--hue) 90% 60%); flex: none; }
.tab .tn { overflow: hidden; text-overflow: ellipsis; }
.tab .td { display: none; color: var(--gold); font-size: 11px; }
.tab.dirty .td { display: inline; }
.tab .tx { background: none; border: none; padding: 0 5px; color: var(--muted); font-size: 11px; }
.tab .tx:hover { color: var(--red); }
.top-actions { display: flex; gap: 6px; align-items: center; }
.kbd-btn { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- accueil : le Prisme */
main { position: relative; z-index: 1; min-height: 0; overflow: hidden; }
.landing { height: 100%; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; padding: 30px 40px; align-items: start; }
.prism-stage { text-align: center; padding-top: 10px; }
.prism-drop { position: relative; margin: 0 auto; max-width: 680px; cursor: pointer; border-radius: 16px; padding: 10px; transition: background .2s; }
.prism-drop:hover, .prism-drop:focus-visible { background: var(--hover); }
.prism-svg { width: 100%; height: auto; overflow: visible; }
.beam-in { stroke: var(--text); stroke-width: 3; opacity: .85; stroke-dasharray: 160; animation: beam 2.4s ease-out infinite; }
.prism-body { animation: breathe 4s ease-in-out infinite; transform-origin: 210px 130px; }
.rays line { stroke: var(--c); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 180; stroke-dashoffset: 180; animation: ray 2.4s ease-out infinite; animation-delay: var(--d); opacity: .9; }
@keyframes beam { 0% { stroke-dashoffset: 160; } 40%, 100% { stroke-dashoffset: 0; } }
@keyframes ray { 0%, 35% { stroke-dashoffset: 180; opacity: 0; } 60% { opacity: 1; } 75%, 100% { stroke-dashoffset: 0; opacity: .9; } }
@keyframes breathe { 50% { transform: scale(1.025); } }
.facet-names text { font: 500 11px var(--orb); letter-spacing: .14em; fill: var(--muted); opacity: 0; animation: fadeIn .6s forwards; animation-delay: var(--d); }
@keyframes fadeIn { to { opacity: 1; } }
.landing h1 { font: 700 clamp(20px, 2.6vw, 30px) var(--orb); letter-spacing: .04em; margin: 18px 0 6px; }
.tagline { color: var(--gold); margin: 0 0 8px; }
.sub { color: var(--muted); max-width: 640px; margin: 0 auto 22px; }
.sub b { color: var(--green); font-weight: normal; }
.cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 12px; margin-top: 20px; }
.landing-side h3, #recents h3 { font: 500 12px var(--orb); letter-spacing: .14em; color: var(--purple); margin: 8px 0 10px; }
.samples { display: grid; gap: 6px; }
.sample { display: flex; justify-content: space-between; gap: 10px; text-align: left; background: var(--panel); }
.sample .sl { color: var(--gold); font-size: 12px; }
.sample .sf { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reclist { display: grid; gap: 4px; }
.recent { display: flex; flex-direction: column; text-align: left; background: var(--panel); }
#recents { margin-top: 20px; }

/* ---------------------------------------------------------------- espace de travail */
.workspace { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.spectrum { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--bg2); overflow-x: auto; scrollbar-width: thin; }
.spec-doc { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.spec-fmt { font: 500 11px var(--orb); letter-spacing: .1em; color: var(--gold); }
.spec-sep { color: var(--muted); }
.spec-chips { display: flex; gap: 5px; flex: 1; }
.fchip { display: flex; align-items: center; gap: 6px; height: 30px; line-height: 1; font: 500 10.5px var(--orb); letter-spacing: .1em; padding: 5px 10px; border-radius: 20px; background: transparent; color: var(--muted); white-space: nowrap; border-color: var(--line); }
.fchip .fi { font-family: var(--mono); font-size: 12px; }
.fchip[aria-pressed="true"] { color: hsl(var(--hue) 95% 68%); border-color: hsl(var(--hue) 90% 60% / .6); background: hsl(var(--hue) 90% 60% / .1); box-shadow: 0 0 14px hsl(var(--hue) 90% 60% / .18); }
[data-theme="light"] .fchip[aria-pressed="true"] { color: hsl(var(--hue) 80% 32%); }
.fchip:hover:not(:disabled) { color: hsl(var(--hue) 95% 68%); border-color: hsl(var(--hue) 90% 60% / .6); }
.fchip.future { opacity: .4; border-style: dashed; }
.fchip .ph { font-size: 9px; color: var(--purple); }
.panels { flex: 1; display: flex; min-height: 0; padding: 8px; gap: 0; }
.panel { flex: 1 1 0; min-width: 180px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: relative; }
.panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, hsl(var(--hue) 90% 60%), transparent); opacity: .8; }
.panel.refract { animation: refract .55s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes refract { from { opacity: 0; transform: translateX(-40px) scaleX(.6) skewX(-6deg); filter: hue-rotate(90deg) blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.panel.dragging { opacity: .5; }
.panel.dropping { outline: 2px dashed var(--cyan); outline-offset: -4px; }
.ph { display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 10px; border-bottom: 1px solid var(--line); background: var(--panel2); cursor: grab; user-select: none; min-height: 36px; }
.ph .pi { color: hsl(var(--hue) 90% 62%); }
.ph .pt { font: 500 11px var(--orb); letter-spacing: .12em; }
.pactions { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: flex-end; min-width: 0; overflow: hidden; }
.pb { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.resizer { flex: 0 0 8px; cursor: col-resize; position: relative; }
.resizer::after { content: ""; position: absolute; left: 3px; top: 30%; bottom: 30%; width: 2px; border-radius: 2px; background: var(--line); transition: background .15s; }
.resizer:hover::after, .resizer.active::after, .resizer:focus-visible::after { background: var(--cyan); top: 0; bottom: 0; }
.floating-layer { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.panel.floating { position: absolute; pointer-events: auto; resize: both; box-shadow: var(--shadow); border-color: var(--line2); min-height: 160px; }
.panel.floating .ph { cursor: move; }
select.mini, input.mini { padding: 2px 6px; font-size: 12px; }
.tree-bar { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filter { flex: 1; min-width: 120px; padding: 4px 8px; font-size: 13px; }
.empty { margin: auto; text-align: center; color: var(--muted); padding: 30px; }
.empty .big { font-size: 42px; color: var(--purple); }
.banner { padding: 6px 10px; font-size: 12px; border-bottom: 1px solid var(--line); }
.banner.warn { background: rgba(255, 201, 64, .08); color: var(--gold); }

/* ---------------------------------------------------------------- éditeur TRUedit */
.ed-host { flex: 1; min-height: 0; display: flex; }
.ed { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ed-main { flex: 1; display: flex; min-height: 0; }
.ed-gutter { flex: none; overflow: hidden; position: relative; background: var(--bg2); border-right: 1px solid var(--line); color: var(--muted); font: 13px/20px var(--mono); text-align: right; user-select: none; }
.ed-gutter-inner { position: absolute; right: 8px; left: 0; top: 0; will-change: transform; }
.ed-gutter-inner div { height: 20px; padding-right: 2px; opacity: .6; }
.ed-gutter-inner .cur { opacity: 1; color: var(--cyan); }
.ed-view { flex: 1; position: relative; overflow: hidden; min-width: 0; }
.ed-hl, .ed-marks, .ed-input { font: 13px/20px var(--mono); letter-spacing: 0; font-variant-ligatures: none; tab-size: 4; -moz-tab-size: 4; white-space: pre; word-wrap: normal; }
.ed-hl, .ed-marks { position: absolute; left: 0; top: 0; margin: 0; padding: 0 14px; pointer-events: none; will-change: transform; color: var(--text); }
.ed-marks { color: transparent; }
.ed-marks mark { color: transparent; border-radius: 2px; background: rgba(255, 201, 64, .28); }
.ed-marks mark.cur { background: rgba(255, 201, 64, .6); box-shadow: 0 0 0 1px var(--gold); }
.ed-marks mark.sync { background: rgba(179, 71, 255, .3); box-shadow: 0 0 0 1px var(--purple); animation: pulse 1.1s ease-out 2; }
@keyframes pulse { 50% { background: rgba(179, 71, 255, .55); } }
.ed-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: none; border-radius: 0; padding: 10px 14px; resize: none; background: transparent; color: transparent; caret-color: var(--cyan); overflow: auto; outline: none; box-shadow: none !important; }
.ed-input::selection { background: var(--sel); color: transparent; }
.ed-input[readonly] { caret-color: var(--muted); }
.ed-find { padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel2); display: grid; gap: 6px; }
.frow { display: flex; gap: 5px; align-items: center; }
.frow input { flex: 1; padding: 3px 8px; font-size: 13px; }
.tgl { font-size: 11px; padding: 2px 6px; color: var(--muted); }
.tgl[aria-pressed="true"] { color: var(--cyan); border-color: var(--cyan); background: var(--hover); }
.fcount { font-size: 12px; color: var(--muted); min-width: 64px; text-align: center; }
/* coloration */
.k { color: var(--syn-k); } .s { color: var(--syn-s); } .n { color: var(--syn-n); } .p { color: var(--syn-p); } .c { color: var(--syn-c); font-style: italic; }
.b { color: var(--syn-b); } .h { color: var(--syn-h); font-weight: bold; } .f { color: var(--syn-f); } .a { color: var(--syn-a); } .t { color: var(--syn-t); } .q { color: var(--syn-q); } .l { color: var(--syn-l); text-decoration: underline; }
.c0 { color: var(--text); } .c1 { color: var(--syn-p); } .c2 { color: var(--syn-s); } .c3 { color: var(--syn-n); } .c4 { color: var(--syn-k); } .c5 { color: var(--syn-f); }
.zw { position: relative; display: inline; }
.zw::after { content: "¦"; position: absolute; left: -3px; top: -2px; color: var(--red); font-weight: bold; background: rgba(255, 92, 122, .25); border-radius: 2px; }
.tb { opacity: .3; }
.lv-trace, .lv-debug { color: var(--muted); } .lv-info, .lv-notice { color: var(--text); } .lv-warn { color: var(--gold); } .lv-error { color: var(--red); } .lv-fatal { color: #fff; background: rgba(255, 92, 122, .35); }
[data-theme="light"] .lv-fatal { color: #fff; background: var(--red); }
/* diagnostics */
.diag { max-height: 30%; overflow: auto; border-top: 1px solid var(--line); background: var(--bg2); font-size: 12px; }
.diag-sum { padding: 4px 10px; color: var(--muted); position: sticky; top: 0; background: var(--bg2); }
.diag-item { display: block; width: 100%; text-align: left; border: none; border-radius: 0; background: transparent; padding: 3px 10px; font-size: 12px; }
.diag-item:hover { background: var(--hover); }
.diag-item.error { color: var(--red); } .diag-item.warning { color: var(--gold); } .diag-item.info { color: var(--muted); }
.diag-item .dl { display: inline-block; min-width: 64px; color: var(--muted); }
.diag-item .hint, .mdiag .hint { color: var(--muted); }

/* ---------------------------------------------------------------- STRUCTURE */
.crumbs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px 8px; border-bottom: 1px solid var(--line); min-height: 26px; font-size: 12px; }
.crumb { background: none; border: none; padding: 0 4px; color: var(--muted); }
.crumb + .crumb::before { content: "›"; margin-right: 4px; color: var(--line2); }
.tree-scroll, .grid-scroll, .hex-scroll, .log-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; outline: none; }
.tree-inner { position: relative; }
.trow { position: absolute; left: 0; right: 0; height: 24px; display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; font-size: 13px; padding-right: 8px; }
.trow:hover { background: var(--hover); }
.trow.sel { background: var(--sel); box-shadow: inset 2px 0 0 var(--cyan); }
.tw { width: 12px; color: var(--muted); flex: none; text-align: center; }
.ti { flex: none; min-width: 20px; text-align: center; font-size: 11px; border-radius: 4px; padding: 0 3px; color: var(--muted); background: var(--bg2); }
.ti.t-object, .ti.t-section { color: var(--syn-b); } .ti.t-array { color: var(--syn-f); } .ti.t-string { color: var(--syn-s); } .ti.t-number { color: var(--syn-n); } .ti.t-boolean, .ti.t-null { color: var(--syn-k); } .ti.t-heading { color: var(--gold); }
.trow .k { color: var(--syn-p); }
.trow .v { overflow: hidden; text-overflow: ellipsis; }
.v.t-string, .v.t-date { color: var(--syn-s); } .v.t-number { color: var(--syn-n); } .v.t-boolean, .v.t-null { color: var(--syn-k); }
.cnt { color: var(--muted); font-size: 12px; }
.colon { color: var(--muted); margin-left: -4px; }

/* ---------------------------------------------------------------- DONNÉES */
.grid-head { position: sticky; top: 0; z-index: 1; display: flex; background: var(--panel2); border-bottom: 1px solid var(--line2); }
.grid-body { position: relative; }
.gr { position: absolute; left: 0; display: flex; height: 26px; cursor: pointer; }
.gr:nth-child(even) { background: rgba(255, 255, 255, .015); }
.gr:hover { background: var(--hover); }
.gr.sel { background: var(--sel); }
.gc { flex: none; padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); font-size: 13px; }
.gc.gn { width: 60px; color: var(--muted); text-align: right; background: var(--bg2); }
.gc.num { text-align: right; color: var(--syn-n); }
.gc.nul { color: var(--muted); }
.gh { display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: none; border-right: 1px solid var(--line); border-radius: 0; background: transparent; padding: 3px 8px; position: relative; }
.gh span:first-child { font-weight: bold; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gh .ty { font-size: 10px; color: var(--muted); }
.gh .so { position: absolute; right: 6px; top: 4px; color: var(--cyan); font-size: 10px; }

/* ---------------------------------------------------------------- BRUT (hexa) */
.hex-inner { position: relative; font: 13px/20px var(--mono); }
.hr { position: absolute; left: 0; height: 20px; display: flex; gap: 18px; padding: 0 10px; white-space: pre; }
.ho { color: var(--purple); }
.hx i, .as i { font-style: normal; cursor: pointer; }
.hx i { padding: 0 3px; }
.hx i.z { color: var(--muted); opacity: .55; }
.hx i.c, .as i.c { color: var(--syn-a); }
.hx i.s, .as i.s { background: var(--sel); color: var(--cyan); }
.hx i.h, .as i.h { background: rgba(255, 201, 64, .45); color: var(--text); }
.as { color: var(--syn-s); border-left: 1px solid var(--line); padding-left: 14px; }

/* ---------------------------------------------------------------- JOURNAL */
.lvchips { display: flex; gap: 4px; flex-wrap: wrap; }
.lvchip { font-size: 11px; padding: 2px 8px; border-radius: 12px; }
.lvchip[aria-pressed="false"] { opacity: .4; text-decoration: line-through; }
.log-wrap { flex: 1; display: flex; min-height: 0; }
.log-inner { position: relative; }
.lr { position: absolute; left: 0; right: 0; height: 20px; font: 13px/20px var(--mono); white-space: pre; cursor: pointer; padding-right: 10px; }
.lr:hover { background: var(--hover); }
.lr.sel { background: var(--sel); }
.lr.cont { opacity: .8; }
.lr .ln { display: inline-block; color: var(--muted); padding: 0 10px; border-right: 1px solid var(--line); margin-right: 8px; opacity: .6; }
.lr.lv-error .ln, .lr.lv-fatal .ln { box-shadow: inset 3px 0 0 var(--red); opacity: 1; }
.lr.lv-warn .ln { box-shadow: inset 3px 0 0 var(--gold); opacity: 1; }
.heat { flex: 0 0 14px; width: 14px; height: 100%; border-left: 1px solid var(--line); cursor: pointer; background: var(--bg2); }
.progress { height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--purple), var(--gold)); transition: width .15s; }

/* ---------------------------------------------------------------- RENDU */
.render { flex: 1; overflow: auto; padding: 24px 32px; min-height: 0; }
.render.md { line-height: 1.65; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; }
.render.md h1, .render.md h2, .render.md h3 { font-family: var(--orb); letter-spacing: .03em; line-height: 1.3; cursor: pointer; }
.render.md h1 { color: var(--cyan); border-bottom: 1px solid var(--line); padding-bottom: .3em; }
.render.md h2 { color: var(--purple); } .render.md h3 { color: var(--gold); }
.render.md .flash { animation: pulse 1s 2; border-radius: 4px; }
.render.md code { font-family: var(--mono); background: var(--bg2); padding: .1em .35em; border-radius: 4px; }
.render.md pre { background: var(--bg2); border: 1px solid var(--line); padding: 12px; border-radius: 8px; overflow: auto; }
.render.md pre code { background: none; padding: 0; }
.render.md blockquote { border-left: 3px solid var(--purple); margin: 0; padding: 2px 14px; color: var(--muted); }
.render.md table { border-collapse: collapse; }
.render.md th, .render.md td { border: 1px solid var(--line2); padding: 5px 10px; }
.render.md img { max-width: 100%; }
.render.md a { color: var(--cyan); }
.render.media { display: flex; align-items: center; justify-content: center; padding: 16px; position: relative; overflow: auto; }
.render.media img { max-width: 100%; max-height: 100%; image-rendering: auto; transition: transform .15s; transform-origin: center; }
.render.media video, .render.media iframe { width: 100%; height: 100%; border: none; background: #000; }
.render.media audio { width: 90%; }
.render.checker { background: repeating-conic-gradient(var(--bg2) 0 25%, var(--panel) 0 50%) 0 0 / 20px 20px; }
.render.frame { padding: 0; }
.render.frame iframe { width: 100%; height: 100%; border: none; background: #fff; }
.hint-float { position: absolute; bottom: 8px; right: 12px; font-size: 11px; color: var(--muted); background: var(--panel); padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line); }

/* ---------------------------------------------------------------- MÉTADONNÉES */
.meta { flex: 1; overflow: auto; padding: 10px 14px; }
.msec h4 { font: 500 11px var(--orb); letter-spacing: .14em; color: var(--purple); margin: 14px 0 6px; }
.mrow { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); font-size: 13px; align-items: start; }
.mk { color: var(--muted); }
.mv { word-break: break-word; }
.mv.mono { font-size: 12px; word-break: break-all; color: var(--syn-n); }
.alerts { display: grid; gap: 6px; margin-bottom: 8px; }
.alert { border: 1px solid var(--gold); background: rgba(255, 201, 64, .08); color: var(--gold); padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.hist canvas { width: 100%; height: 70px; image-rendering: pixelated; background: var(--bg2); border-radius: 4px; }
.hist-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.hist-legend span::before { content: "■ "; }
.l1::before { color: var(--purple); } .l2::before { color: var(--cyan); } .l3::before { color: var(--gold); }
.mdiag { font-size: 12px; padding: 2px 0; } .mdiag.error { color: var(--red); } .mdiag.warning { color: var(--gold); } .mdiag.info { color: var(--muted); }

/* ---------------------------------------------------------------- ATELIER */
.tools { flex: 1; overflow: auto; padding: 8px 12px; }
.tsec { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: var(--panel2); }
.tsec > summary { cursor: pointer; padding: 7px 12px; font: 500 11px var(--orb); letter-spacing: .12em; color: var(--cyan); list-style: none; }
.tsec > summary::before { content: "▸ "; color: var(--muted); }
.tsec[open] > summary::before { content: "▾ "; }
.tbody { padding: 4px 12px 12px; display: grid; gap: 8px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btnrow label { display: flex; gap: 6px; align-items: center; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 12px; font-family: var(--mono); }
.preview { margin: 0; max-height: 300px; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12px; white-space: pre; }
.results { display: grid; max-height: 320px; overflow: auto; }
.res { display: flex; gap: 10px; text-align: left; border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 3px 6px; font-size: 12px; }
.res:hover { background: var(--hover); }
.res .rp { color: var(--syn-p); flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res .rv { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tools textarea { width: 100%; font-size: 12px; resize: vertical; }
.tools input.mono { width: 100%; }

/* ---------------------------------------------------------------- barre d'état */
.statusbar { position: relative; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 0 8px; border-top: 1px solid var(--line); background: var(--bg2); font-size: 12px; min-height: 26px; overflow: hidden; white-space: nowrap; }
.sb { padding: 2px 8px; color: var(--muted); background: none; border: none; border-radius: 0; font-size: 12px; }
button.sb:hover { color: var(--cyan); background: var(--hover); }
.sb.grow { flex: 1; }
.sb.mod { color: var(--gold); }
.sb.ok { color: var(--green); }
.sb .err { color: var(--red); } .sb .warn { color: var(--gold); }
.sb.right { color: var(--muted); }

/* ---------------------------------------------------------------- superpositions */
.veil { position: fixed; inset: 0; z-index: 50; background: rgba(2, 3, 8, .65); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; animation: fadeIn .15s; }
.veil.top { align-items: flex-start; padding-top: 12vh; }
.dialog { width: min(520px, 94vw); max-height: 86vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); }
.dialog.wide { width: min(860px, 94vw); }
.dh { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dt { font: 700 13px var(--orb); letter-spacing: .08em; color: var(--cyan); }
.db { padding: 14px 16px; overflow: auto; }
.df { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--line); }
.field { display: grid; gap: 4px; margin-bottom: 10px; }
.field span { color: var(--muted); font-size: 12px; }
.field input, .field select, .db textarea { width: 100%; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.help .keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 20px; }
.help h4, .journal h4 { font: 500 11px var(--orb); letter-spacing: .12em; color: var(--purple); margin: 12px 0 6px; }
.help table { border-collapse: collapse; width: 100%; font-size: 13px; }
.help td { padding: 2px 6px 2px 0; vertical-align: top; }
.engines td { border-bottom: 1px dashed var(--line); }
.hist { font-size: 13px; padding-left: 20px; margin: 0; max-height: 40vh; overflow: auto; }
.toasts { position: fixed; right: 16px; bottom: 36px; z-index: 60; display: grid; gap: 8px; max-width: min(440px, 90vw); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line2); border-left: 3px solid var(--cyan); border-radius: 8px; padding: 9px 14px; box-shadow: var(--shadow); cursor: pointer; animation: slideIn .2s ease-out; font-size: 13px; }
.toast.t-ok { border-left-color: var(--green); } .toast.t-warn { border-left-color: var(--gold); } .toast.t-error { border-left-color: var(--red); }
.toast .ti { color: var(--cyan); } .t-ok .ti { color: var(--green); } .t-warn .ti { color: var(--gold); } .t-error .ti { color: var(--red); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .25s; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } }
.menu { position: fixed; z-index: 70; min-width: 220px; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.menu button { display: flex; width: 100%; justify-content: space-between; gap: 16px; border: none; background: transparent; text-align: left; border-radius: 5px; padding: 5px 10px; font-size: 13px; }
.menu button:hover:not(:disabled), .menu button:focus { background: var(--hover); color: var(--cyan); outline: none; }
.menu .hint { color: var(--muted); font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.menu .chk { color: var(--cyan); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; }
.palette { width: min(640px, 94vw); background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow), 0 0 40px rgba(0, 229, 255, .08); overflow: hidden; }
.pq { width: 100%; border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 15px; background: transparent; box-shadow: none !important; }
.pl { max-height: 50vh; overflow: auto; padding: 4px; }
.pl .pi { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pl .pi.on { background: var(--sel); }
.pl .pg { font: 500 9.5px var(--orb); letter-spacing: .1em; color: var(--purple); min-width: 86px; }
.pl .pn { flex: 1; }
.pl .pe { padding: 12px; color: var(--muted); text-align: center; }
.pf { font-size: 11px; color: var(--muted); padding: 6px 14px; border-top: 1px solid var(--line); }
.dropveil { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(0, 229, 255, .06); border: 3px dashed var(--cyan); pointer-events: none; }
.dropveil.on { display: flex; }
.dropveil div { text-align: center; color: var(--cyan); font: 700 18px var(--orb); letter-spacing: .06em; background: var(--panel); padding: 30px 40px; border-radius: 16px; box-shadow: var(--shadow); }
.dropveil svg { width: 70px; animation: breathe 1s infinite; }

@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; padding: 20px; }
  .panels { flex-direction: column; }
  .resizer { display: none; }
  .panel { min-height: 260px; }
  .kbd-btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .rays line { stroke-dashoffset: 0; opacity: .9; }
}
.ext-img { display: inline-block; font-size: 12px; color: var(--muted); border: 1px dashed var(--line2); border-radius: 6px; padding: 2px 8px; }
