/* ============================================================
   0X SEARCHER + CLARK PRO  -  style v6
   ============================================================ */

:root {
  --mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
  --ff:    "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: #07080c;
  --panel: #0d0f16;
  --panel2: #11141d;
  --ink: #06070a;
  --paper: #eef2ff;
  --dim: #8a93ad;
  --line: rgba(255, 255, 255, 0.08);
  --acid: #a8ff3e;
  --glow: rgba(168, 255, 62, 0.35);
  --acc2: #51e4ff;
  --acc3: #b78cff;
  --or: #ffb347;
  --pu: #b78cff;
  --red: #ff5964;
  --r-: 18px;
  --r-lg: 26px;
  --r-pill: 999px;
}

/* ---------- themes ---------- */
body[data-theme="cyan"]   { --acid: #51e4ff; --glow: rgba(81,228,255,.35); --acc2: #a8ff3e; }
body[data-theme="red"]    { --acid: #ff5964; --glow: rgba(255,89,100,.35); --acc2: #ffb347; }
body[data-theme="violet"] { --acid: #b78cff; --glow: rgba(183,140,255,.35); --acc2: #ff8fb8; }
body[data-theme="gold"]   { --acid: #ffd83d; --glow: rgba(255,216,61,.35);  --acc2: #ff8fb8; }
body[data-theme="aqua"]   { --acid: #5ef3c8; --glow: rgba(94,243,200,.35);  --acc2: #51e4ff; }
body[data-theme="rose"]   { --acid: #ff8fb8; --glow: rgba(255,143,184,.35); --acc2: #b78cff; }
body[data-theme="oled"]   { --acid: #e8ecff; --glow: rgba(232,236,255,.35); --acc2: #51e4ff; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--paper);
  font-family: var(--ff); overflow-x: hidden; min-height: 100vh;
}

/* fond : grille + halo doux */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--glow) 0%, transparent 60%),
    radial-gradient(900px 400px at 100% 100%, rgba(81,228,255,.06), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
}

.glow {
  position: fixed; width: 340px; height: 340px; border-radius: 50%; z-index: 5; pointer-events: none;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  opacity: 0; transform: translate(-50%, -50%); transition: opacity .4s;
}
.beta-on .glow.on { opacity: .55; }
#confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

::selection { background: var(--acid); color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232a3d; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

button { font-family: var(--ff); cursor: pointer; }
input, select, textarea { font-family: var(--ff); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: rgba(7, 8, 12, .78); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.burger {
  width: 42px; height: 42px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  transition: border-color .2s, transform .15s;
}
.burger:hover { border-color: var(--acid); }
.burger i {
  width: 20px; height: 2px; border-radius: 2px; background: var(--paper);
  transition: transform .3s, opacity .2s, background .2s;
}
.burger.open i:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--acid); }
.burger.open i:nth-child(2) { opacity: 0; }
.burger.open i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--acid); }

.logo {
  font-family: var(--mono); font-weight: 900; letter-spacing: 1px; font-size: 15px;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.logo .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--acid);
  box-shadow: 0 0 12px var(--acid); animation: ping 1.6s infinite;
}
.logo .edition { font-size: 10px; color: var(--dim); font-weight: 400; letter-spacing: 2px; }
@keyframes ping { 0%,100% { opacity: 1; } 50% { opacity: .2; } }

.beta {
  font-size: 10px; letter-spacing: 3px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; color: var(--ink);
  background: linear-gradient(90deg, var(--acid), var(--acc2));
  animation: glitch 2.4s infinite;
}
@keyframes glitch {
  0%, 86%, 100% { transform: none; }
  88% { transform: translate(-2px, 1px) skewX(8deg); }
  90% { transform: translate(2px, -1px) skewX(-8deg); }
  92% { transform: translate(-1px, 0) skewX(3deg); }
}

.spacer { flex: 1; }
.topbar kbd {
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px;
  background: var(--panel);
}
.status { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--dim); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); animation: pulse 2.2s ease-in-out infinite; }
.status-dot.off { background: var(--red); box-shadow: 0 0 12px var(--red); animation: none; }
.status-dot.scanning { background: var(--pu); box-shadow: 0 0 12px var(--pu); animation: blink .7s steps(2) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes blink { 50% { opacity: .15; } }

.demo-note {
  display: block; text-align: center; padding: 7px 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px; line-height: 1.5;
  color: var(--acc2); background: rgba(81, 228, 255, .06);
  border-bottom: 1px dashed var(--line);
}
.demo-note a { color: var(--dim); text-decoration: none; margin-left: 8px; }
.demo-note a:hover { color: var(--acid); }

/* ============================================================
   SCREEN DE SCAN
   ============================================================ */
.scanscreen {
  position: fixed; inset: 0; z-index: 80; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(5, 6, 10, .92); backdrop-filter: blur(18px); text-align: center; padding: 24px;
}
.scanscreen.on { display: flex; animation: fade .3s; }
.scanscreen h2 { font-size: 14px; letter-spacing: 6px; color: var(--dim); font-family: var(--mono); }
.scan-timer { font-family: var(--mono); font-size: 16px; color: var(--acc2); letter-spacing: 3px; }
.scan-big { font-family: var(--mono); font-size: clamp(40px, 12vw, 84px); font-weight: 900; letter-spacing: -3px; color: var(--acid); text-shadow: 0 0 30px var(--glow); }
.scan-phase { font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--dim); min-height: 16px; }
.scan-live { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.scan-live b { color: var(--paper); font-size: 18px; }
.scan-cancel {
  margin-top: 22px; padding: 12px 30px; border-radius: 999px;
  border: 1px solid var(--red); color: var(--red); background: transparent;
  font-weight: 800; letter-spacing: 2px; font-size: 12px; transition: background .2s, color .2s;
}
.scan-cancel:hover { background: rgba(255,89,100,.12); }

.scan-radar { position: relative; width: 130px; height: 130px; margin-bottom: 6px; }
.scan-radar::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--line); animation: spin 2.6s linear infinite;
  background: conic-gradient(from 0deg, transparent 0 300deg, var(--acid) 360deg), radial-gradient(circle, var(--glow), transparent 62%);
  -webkit-mask: radial-gradient(circle, transparent 30%, #000 32%);
          mask: radial-gradient(circle, transparent 30%, #000 32%);
}
.scan-ring { position: absolute; inset: 18px; border-radius: 50%; border: 1px dashed var(--line); animation: spin 4s linear infinite reverse; }
.scan-ring.r2 { inset: 38px; border: 1px dashed var(--acc2); animation: spin 6s linear infinite; }
.scan-cross { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 14px var(--acid); animation: blink 1.2s infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   RECHERCHE
   ============================================================ */
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 18px 70px; }

.hero-card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 30px 26px 24px; position: relative; overflow: hidden;
}
.hero-card::before {
  content: ""; position: absolute; top: -70px; left: 50%; transform: translateX(-50%);
  width: 420px; height: 150px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  opacity: .45; pointer-events: none;
}
.killer { text-align: center; min-height: 30px; font-family: var(--mono); font-size: clamp(16px, 4vw, 26px); letter-spacing: 2px; color: var(--dim); margin-bottom: 20px; }

.hero-brand { text-align: center; padding-top: 6px; }
.hero-logo {
  font-family: var(--mono); font-size: clamp(34px, 9vw, 92px); font-weight: 900;
  letter-spacing: -2px; line-height: .95; color: var(--paper);
  text-shadow: 0 0 34px var(--glow);
}
.hero-logo .dot { display: inline-block; width: .5em; height: .5em; margin-left: 8px; border-radius: 50%;
  background: var(--acid); box-shadow: 0 0 18px var(--acid); animation: ping 1.8s infinite; }
.hero-edition { margin-top: 10px; font-family: var(--mono); letter-spacing: 7px; font-size: clamp(11px, 2.6vw, 15px); color: var(--acid); font-weight: 700; }
.hero-tagline { margin-top: 7px; font-family: var(--mono); letter-spacing: 3px; font-size: clamp(10px, 2.4vw, 13px); color: var(--dim); }
.hero-tagline .creds { color: var(--acc2); font-weight: 800; }
.hero-tagline .mid { color: var(--acid); margin: 0 4px; }

.hero-metrics { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 22px 0 12px; }
.hero-metrics span {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 104px;
  padding: 9px 16px; border: 1px solid var(--line); border-top: 2px solid var(--acid);
  border-radius: 14px; background: var(--panel);
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--dim);
}
.hero-metrics b { font-family: var(--mono); font-size: 19px; letter-spacing: -1px; color: var(--acid); font-weight: 900; }
.hero-metrics b.off { color: var(--dim); }

.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; align-items: center; }
.hero-actions button {
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px; transition: all .15s;
}
.hero-actions button:hover { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.hero-actions kbd { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--acc2);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--panel); }

.credit { margin-top: 28px; padding: 18px 0 6px; border-top: 1px dashed var(--line);
  text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--dim); }
.credit .dot { display: inline-block; width: 7px; height: 7px; margin: 0 4px; border-radius: 50%;
  background: var(--acid); box-shadow: 0 0 8px var(--acid); vertical-align: 1px; }
.credit .creds { color: var(--acc2); font-weight: 800; }
.credit .mid { color: var(--acid); margin: 0 4px; }
.killer .type { color: var(--paper); font-weight: 700; }
.killer .cursor {
  display: inline-block; width: 9px; height: 1.1em; margin-left: 3px; vertical-align: -2px;
  background: var(--acid); animation: blink .8s steps(2) infinite;
}

.searchbox {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 6px 6px 20px; transition: border-color .2s, box-shadow .2s;
}
.searchbox:focus-within { border-color: var(--acid); box-shadow: 0 0 0 3px var(--glow); }
.s-icon { width: 14px; height: 14px; position: relative; flex: none; }
.s-icon::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--dim); border-radius: 50%; }
.s-icon::after { content: ""; position: absolute; right: -4px; bottom: -2px; width: 7px; height: 2px; background: var(--dim); transform: rotate(45deg); }
#searchInput {
  flex: 1; background: transparent; border: 0; outline: 0; color: var(--paper);
  font-size: 15px; padding: 10px 4px; min-width: 0;
  font-family: var(--mono);
}
#searchInput::placeholder { color: var(--dim); opacity: .6; }
.go {
  padding: 11px 24px; border: 0; border-radius: 999px; font-weight: 900; letter-spacing: 2px;
  color: var(--ink); background: linear-gradient(90deg, var(--acid), var(--acc2)); font-size: 13px;
  transition: filter .15s, transform .15s; flex: none;
}
.go:hover { filter: brightness(1.12); transform: translateY(-1px); }
.metarow { display: flex; justify-content: space-between; padding: 10px 8px 0; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--dim); }
.metarow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: center; }
.chip {
  padding: 7px 16px; border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  color: var(--dim); background: var(--panel); border: 1px solid var(--line);
  transition: all .15s;
}
.chip:hover { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.chip.tag { border-style: dashed; }
.chip.tag:hover { border-style: solid; }

.adv-toggle {
  margin: 18px auto 0; display: block; padding: 8px 18px;
  border: 1px dashed var(--line); border-radius: 999px; background: transparent;
  color: var(--dim); font-size: 11px; letter-spacing: 2px; transition: all .2s;
}
.adv-toggle:hover { color: var(--acid); border-color: var(--acid); border-style: solid; }

.advanced { margin-top: 18px; animation: fade .3s; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.grid2 input {
  background: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  color: var(--paper); padding: 12px 14px; font-size: 12px; outline: 0; font-family: var(--mono); letter-spacing: 1px;
  transition: border-color .2s;
}
.grid2 input:focus { border-color: var(--acid); }
.grid2 input::placeholder { color: var(--dim); opacity: .5; }

.photo-zone { margin-top: 16px; }
.photo-inner {
  border: 2px dashed var(--line); border-radius: var(--r-); padding: 22px;
  text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--dim);
  transition: all .2s;
}
.photo-zone.dragover .photo-inner, .photo-inner:hover { border-color: var(--acid); color: var(--acid); }
.photo-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo-thumb { position: relative; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb span {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 16px; text-align: center;
  border-radius: 50%; background: rgba(0,0,0,.7); color: var(--red); font-size: 12px; cursor: pointer;
}

/* ============================================================
   RESULTATS
   ============================================================ */
.results { margin-top: 26px; }
.result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.result-head h2 { font-family: var(--mono); font-size: 15px; letter-spacing: 3px; color: var(--paper); }
.result-head h2::before { content: "#"; color: var(--acid); }
.result-head #resultCount { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 1px; display: block; margin-top: 4px; }
.view-toggle { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.view-toggle button {
  border: 0; background: transparent; color: var(--dim); padding: 7px 16px; border-radius: 999px;
  font-size: 11px; letter-spacing: 1px; transition: all .15s;
}
.view-toggle button.active { background: var(--acid); color: var(--ink); font-weight: 800; }

.export-bar, .sel-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.export-bar button, .sel-bar button {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--dim); font-size: 10px; letter-spacing: 1px;
  transition: all .15s;
}
.export-bar button:hover, .sel-bar button:hover { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.export-bar button.sel { border-style: dashed; }
.export-bar button.sel.active { color: var(--ink); background: var(--acc3); border-color: var(--acc3); border-style: solid; }
.export-bar button.accent { background: transparent; color: var(--acc2); border-color: var(--acc2); }
.export-bar button:disabled { opacity: .4; pointer-events: none; }
.sel-bar { background: rgba(183,140,255,.08); border: 1px dashed var(--acc3); border-radius: 999px; padding: 6px 10px; }
.sel-bar span { font-family: var(--mono); font-size: 11px; color: var(--acc2); padding: 0 8px; font-weight: 700; }
.sel-bar button.del:hover { background: var(--red); border-color: var(--red); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; margin-top: 16px; }
body.compact .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }

/* carte */
.result-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-);
  padding: 18px; cursor: pointer; position: relative; overflow: hidden;
  animation: cardIn .45s both;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.result-card:hover { transform: translateY(-3px); border-color: var(--acid); box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.result-card.sel { border-color: var(--acc3); background: rgba(183,140,255,.08); box-shadow: 0 0 0 1px var(--acc3); }
body.sel-mode .result-card, body.sel-mode .tbl tbody tr { cursor: crosshair; }
body.sel-mode .result-card:hover { border-color: var(--acc3); }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.index { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 2px; }
.card-btns { display: flex; gap: 6px; }
.card-btn {
  width: 28px; height: 28px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--dim); font-size: 13px; line-height: 1;
  transition: all .15s;
}
.card-btn:hover { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.card-btn.open { transform: rotate(45deg); color: var(--ink); background: var(--acc2); border-color: var(--acc2); }
.card-btn.copied { color: var(--ink); background: var(--acid); border-color: var(--acid); }

.idline { font-family: var(--mono); font-size: 10px; color: var(--acc2); margin: 8px 0 2px; }
.card-name { font-size: 17px; font-weight: 800; letter-spacing: .5px; display: flex; flex-direction: column; gap: 2px; }
.card-name small { color: var(--dim); font-size: 10px; letter-spacing: 2px; font-weight: 400; }
.subgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 12px; }
.kv { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kv span { font-family: var(--mono); font-size: 9px; color: var(--dim); letter-spacing: 1px; }
.kv b { font-size: 12px; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.kv.full { grid-column: 1 / -1; }
.kv.full b { white-space: normal; }

pre.raw {
  display: none; margin-top: 12px; padding: 12px; border-radius: 12px;
  background: var(--ink); border: 1px solid var(--line); overflow: auto; max-height: 220px;
  font-family: var(--mono); font-size: 10px; line-height: 1.5; color: var(--acc2);
}
pre.raw.show { display: block; animation: fade .25s; }
.empty { color: var(--dim); text-align: center; padding: 40px 20px; font-family: var(--mono); font-size: 13px; letter-spacing: 1px; border: 1px dashed var(--line); border-radius: var(--r-); }
.empty.loading { color: var(--acc2); }

/* tableau */
.table-wrap { margin-top: 16px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 760px; }
.tbl th {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--dim);
  text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel2);
}
.tbl td { padding: 9px 10px; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,.04); white-space: nowrap; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: rgba(168,255,62,.05); }
.tbl tbody tr.sel { background: rgba(183,140,255,.10); }
.tbl .src { font-family: var(--mono); font-size: 9px; color: var(--acc2); }
.tbl .salt { display: flex; gap: 6px; align-items: center; }
.tbl .t-copy {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--dim); font-size: 12px;
}
.tbl .t-copy:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop, .palette-backdrop, .drawer-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6);
  transition: opacity .25s; opacity: 0; pointer-events: none;
}
.modal-backdrop.on, .palette-backdrop.on, .drawer-backdrop.on { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.98);
  z-index: 110; width: min(620px, 94vw); max-height: 84vh;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  opacity: 0; pointer-events: none; transition: all .25s; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.modal.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-index { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--acc2); }
.modal-actions { display: flex; gap: 8px; }
.modal-actions button {
  min-width: 30px; height: 30px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  font-size: 12px; transition: all .15s;
}
.modal-actions button:hover { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.modal-body { padding: 18px; overflow-y: auto; }
.detail-name { font-size: 20px; font-weight: 900; letter-spacing: .5px; }
.detail-id { font-family: var(--mono); font-size: 10px; color: var(--acc2); margin: 6px 0 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.detail-raw {
  margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--ink);
  border: 1px solid var(--line); overflow: auto; max-height: 240px;
  font-family: var(--mono); font-size: 10px; line-height: 1.6; color: var(--acc2);
}

/* ============================================================
   PALETTE DE COMMANDES
   ============================================================ */
.palette {
  position: fixed; top: 12vh; left: 50%; transform: translateX(-50%) translateY(-8px);
  z-index: 120; width: min(560px, 94vw);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  opacity: 0; pointer-events: none; transition: all .2s; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.palette.on { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.p-chev { font-family: var(--mono); color: var(--acid); font-weight: 900; }
.palette-input input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--paper); font-size: 15px; font-family: var(--mono); }
.palette-input kbd { font-family: var(--mono); font-size: 9px; color: var(--dim); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.palette-list { max-height: 330px; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  font-size: 13px; cursor: pointer;
}
.cmd-item .cg { font-family: var(--mono); font-size: 9px; letter-spacing: 2px; color: var(--dim); width: 74px; flex: none; }
.cmd-item .cl { flex: 1; color: var(--paper); }
.cmd-item .ck { font-family: var(--mono); font-size: 9px; color: var(--dim); }
.cmd-item.active { background: var(--acid); }
.cmd-item.active .cl, .cmd-item.active .cg, .cmd-item.active .ck { color: var(--ink); font-weight: 700; }
.cmd-item.senseless { opacity: .0; pointer-events: none; }

/* ============================================================
   DRAWER (HAMBURGER)
   ============================================================ */
.drawer-backdrop { z-index: 96; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  width: min(390px, 92vw); display: flex; flex-direction: column;
  background: var(--bg); border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .32s cubic-bezier(.22,1,.36,1);
  box-shadow: 30px 0 80px rgba(0,0,0,.4);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.d-logo { font-family: var(--mono); font-weight: 900; letter-spacing: 1px; display: flex; gap: 6px; align-items: center; }
.d-logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.drawer-head button { width: 34px; height: 34px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--dim); font-size: 14px; }
.drawer-head button:hover { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.drawer-scroll { flex: 1; overflow-y: auto; padding: 8px 16px 30px; }

.dsect { padding: 16px 0; border-bottom: 1px solid var(--line); }
.dsect:last-child { border-bottom: 0; }
.dtitle {
  font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--paper);
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.dtitle::before { content: "+"; color: var(--acid); font-weight: 900; }
.dtitle .hint { color: var(--acc3); font-size: 9px; letter-spacing: 1px; }
.dsub { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--dim); margin: 14px 0 8px; }
.mini, .mini-link {
  font-size: 9px; letter-spacing: 1px; margin-left: auto; padding: 4px 10px;
  border: 1px dashed var(--line); border-radius: 999px; background: transparent; color: var(--dim);
  text-decoration: none; transition: all .15s;
}
.mini:hover, .mini-link:hover { color: var(--ink); background: var(--acc2); border-color: var(--acc2); }

.stat-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-strip > div {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.stat-strip b { display: block; font-family: var(--mono); font-size: 18px; color: var(--acid); letter-spacing: -1px; }
.stat-strip span { font-size: 9px; color: var(--dim); letter-spacing: 1px; }

.src-list { display: flex; flex-direction: column; gap: 8px; }
.src-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: border-color .15s;
}
.src-item:hover { border-color: var(--acid); }
.src-item.off { opacity: .45; }
.src-item input { accent-color: var(--acid); width: 16px; height: 16px; flex: none; }
.src-item .sname { font-family: var(--mono); font-size: 12px; color: var(--paper); font-weight: 700; }
.src-item .stag { font-size: 9px; color: var(--dim); letter-spacing: 1px; display: block; }
.src-item .ssize { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--dim); }
.src-item .tagdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.src-item .tagdot.primary { background: var(--acid); box-shadow: 0 0 8px var(--acid); }
.src-item .tagdot.storage { background: var(--acc2); }
.src-item .tagdot.missing { background: var(--red); }

.slider-block {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  font-size: 10px; letter-spacing: 1px; color: var(--dim);
}
.slider-block span { flex: 1; font-family: var(--mono); }
.slider-block b { color: var(--acid); font-family: var(--mono); min-width: 22px; text-align: right; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 96px; height: 4px; border-radius: 4px; background: #232a3d; outline: 0; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--acid); border: 2px solid var(--bg); box-shadow: 0 0 8px var(--glow); cursor: pointer;
}
select {
  background: var(--ink); color: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 12px; outline: 0;
}
select:focus { border-color: var(--acid); }

.note-add { display: flex; gap: 8px; }
.note-add input, .api-add input {
  flex: 1; background: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  color: var(--paper); padding: 10px 12px; font-size: 12px; outline: 0; min-width: 0;
}
.note-add input:focus, .api-add input:focus { border-color: var(--acid); }
.note-add button, .api-add button {
  width: 40px; height: 40px; border-radius: 12px; border: 0; flex: none;
  background: linear-gradient(90deg, var(--acid), var(--acc2)); color: var(--ink);
  font-size: 18px; font-weight: 900; transition: filter .15s, transform .15s;
}
.note-add button:hover, .api-add button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.notes, .journal, .history { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.note, .jline, .history-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 12px;
}
.note { align-items: flex-start; }
.note .n-t { flex: 1; color: var(--paper); line-height: 1.4; word-break: break-word; }
.note .n-date { font-family: var(--mono); font-size: 9px; color: var(--dim); flex: none; margin-top: 2px; }
.note button, .history-item button {
  flex: none; width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--dim); font-size: 12px; line-height: 1;
}
.note button:hover, .history-item button:hover { border-color: var(--red); color: var(--red); }
.jline { flex-wrap: wrap; }
.jline .j-q { flex: 1; font-family: var(--mono); color: var(--acc2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jline .j-hits { background: rgba(168,255,62,.12); color: var(--acid); font-family: var(--mono); font-size: 10px; padding: 2px 8px; border-radius: 999px; }
.jline .j-t { font-family: var(--mono); font-size: 9px; color: var(--dim); }
.history-item { cursor: pointer; }
.history-item:hover { border-color: var(--acid); }
.history-item span { flex: 1; font-family: var(--mono); color: var(--paper); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item small { font-family: var(--mono); font-size: 9px; color: var(--dim); }
.history-item button { cursor: pointer; }

.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch {
  border: 1px solid var(--line); background: var(--panel); border-radius: 14px;
  padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: all .15s; color: var(--dim); font-size: 9px; letter-spacing: 1px;
}
.swatch i { width: 22px; height: 22px; border-radius: 50%; }
.swatch.active { border-color: var(--acid); color: var(--paper); box-shadow: 0 0 0 1px var(--acid), 0 0 16px var(--glow); }

.switch { position: relative; width: 46px; height: 24px; cursor: pointer; margin-left: auto; }
.switch input { position: absolute; opacity: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: #1a1e2b;
  border: 1px solid var(--line); transition: background .2s, border-color .2s;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #555d75; transition: transform .2s, background .2s;
}
.switch input:checked + i { background: rgba(168,255,62,.15); border-color: var(--acid); }
.switch input:checked + i::after { transform: translateX(22px); background: var(--acid); box-shadow: 0 0 10px var(--glow); }

.sub-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 12px; color: var(--dim); }
.check input { accent-color: var(--acid); width: 15px; height: 15px; }
.check span { letter-spacing: 1px; }

.api-add { display: flex; gap: 8px; }
.api-add input:first-child { flex: 0 0 34%; }
.api-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.api-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.api-name { font-family: var(--mono); font-size: 11px; color: var(--acc2); min-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-value { flex: 1; font-family: var(--mono); font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-value.show { color: var(--paper); }
.api-row button {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--dim);
  font-size: 9px; letter-spacing: 1px; padding: 4px 8px; border-radius: 8px;
}
.api-row button:hover { color: var(--ink); background: var(--acc2); border-color: var(--acc2); }
.api-row button.del:hover { background: var(--red); border-color: var(--red); }
.api-note { font-size: 10px; color: var(--dim); line-height: 1.6; margin-top: 10px; letter-spacing: .5px; }

.plans-block { display: flex; flex-direction: column; gap: 12px; }
.plan-card { position: relative; padding: 16px; border-radius: var(--r-); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.plan-card.plus { border-color: rgba(168,255,62,.5); background: linear-gradient(180deg, rgba(168,255,62,.07), var(--panel)); }
.corner {
  position: absolute; top: 0; right: 0; background: linear-gradient(90deg, var(--acid), var(--acc2));
  color: var(--ink); font-weight: 900; font-size: 11px; padding: 6px 12px; border-radius: 0 0 0 12px;
}
.plan-name { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--dim); }
.plan-price { font-size: 26px; font-weight: 900; letter-spacing: -1px; margin: 6px 0 12px; }
.plan-price small { font-size: 11px; color: var(--dim); font-weight: 400; }
.plan-btn {
  display: block; text-align: center; text-decoration: none;
  padding: 11px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  background: var(--acid); color: var(--ink); transition: filter .15s, transform .15s;
}
.plan-card.free .plan-btn { background: rgba(255,255,255,.08); color: var(--dim); cursor: default; }
.plan-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }

.about-line { font-size: 12px; color: var(--dim); margin-bottom: 8px; line-height: 1.6; }
.about-line b { color: var(--acid); font-family: var(--mono); }
.about .mini-link { margin-left: 0; display: inline-block; margin-top: 6px; }
.drawer-foot { font-family: var(--mono); font-size: 9px; color: #454d66; text-align: center; margin-top: 18px; letter-spacing: 1px; }

/* ============================================================
   TOASTS
   ============================================================ */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 130; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--panel); border: 1px solid var(--acid); color: var(--paper);
  border-radius: 12px; padding: 11px 16px; font-size: 12px; letter-spacing: .5px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastIn .3s both; max-width: 300px;
}
.toast.err { border-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   BETA : glitch global (desactive par prefers-reduced-motion)
   ============================================================ */
body.beta-on.glitch-ui .result-card, body.beta-on.glitch-ui .hero-card,
body.beta-on.glitch-ui h1, body.beta-on.glitch-ui h2 {
  animation: cardIn .45s both, uiGlitch 7s infinite;
}
@keyframes uiGlitch {
  0%, 94%, 100% { transform: none; }
  95% { transform: translate(-2px, 1px); }
  96% { transform: translate(2px, -1px); }
  97% { transform: translate(-1px, 0); }
}

/* ============================================================
   RESPONSIVE + ACCESSIBILITE
   ============================================================ */
@media (max-width: 720px) {
  .topbar kbd { display: none; }
  .logo .edition { display: none; }
  .hero-card { padding: 22px 16px 18px; }
  .grid { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .beta, .killer .cursor, .dot { animation: none !important; }
}