:root {
  --bg: #0e1015;
  --bg-2: #151821;
  --panel: #1a1e29;
  --panel-2: #212635;
  --border: #2a3042;
  --text: #e7e9f0;
  --muted: #8a91a7;
  --accent: #f0883e;
  --accent-2: #ffb86b;
  --accent-soft: rgba(240, 136, 62, .14);
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
  --blue: #58a6ff;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, system-ui, sans-serif;
}
h1, h2 { margin: 0; font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 16px; }
code, .mono { font-family: "JetBrains Mono", monospace; }
.muted { color: var(--muted); }
.mt { margin-top: 24px; }
.center { text-align: center; padding: 12px; }
[hidden] { display: none !important; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand-logo, .welcome-logo {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 11px;
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent), #c2410c);
  box-shadow: 0 6px 20px rgba(240, 136, 62, .35);
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 12px; }
.side-title { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-top: 8px; }
.pack-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }
.pack-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent; border-radius: 10px;
  background: none; color: var(--text); cursor: pointer; font: inherit;
}
.pack-item:hover { background: var(--panel); }
.pack-item.active { background: var(--accent-soft); border-color: rgba(240, 136, 62, .4); }
.pack-item small { display: block; color: var(--muted); font-size: 12px; }
.side-bottom { border-top: 1px solid var(--border); padding-top: 14px; }

/* ---------- Boutons / champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel-2); color: var(--text);
  font: 600 13px Inter, sans-serif; cursor: pointer;
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: #3b4460; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #e0671f); border-color: transparent; color: #1b0d02; }
.btn-primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-big { padding: 13px 20px; font-size: 15px; }

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text);
  font: inherit;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { width: 180px; padding: 6px 10px; }
textarea.input { resize: vertical; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; }
.form small { color: var(--muted); font-weight: 400; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Main ---------- */
main { flex: 1; overflow-y: auto; padding: 28px 32px; }
.welcome { display: grid; place-items: center; height: 100%; }
.welcome-card { text-align: center; }
.welcome-logo { width: 72px; height: 72px; font-size: 38px; margin: 0 auto 18px; border-radius: 18px; }
.welcome-card p { color: var(--muted); margin: 8px 0 22px; }

.pack-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.pack-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 500;
}
.chip.accent { color: var(--accent-2); border-color: rgba(240, 136, 62, .4); background: var(--accent-soft); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  padding: 10px 14px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font: 600 13px Inter, sans-serif; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent-2); border-bottom-color: var(--accent); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px;
}
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.count {
  display: inline-block; min-width: 24px; padding: 1px 8px; margin-left: 6px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-2);
  font-size: 12px; text-align: center;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mods-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* ---------- Mods ---------- */
.search-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.mod-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 290px); overflow-y: auto; padding-right: 4px; }
.mod {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--panel-2);
}
.mod:hover { border-color: var(--border); }
.mod img, .mod .noicon { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.mod .noicon { display: grid; place-items: center; color: var(--muted); }
.mod-name { font-weight: 600; }
.mod-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mod-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.tag { padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted); }
.tag.dep { color: var(--blue); }
.tag.beta { color: var(--yellow); }
.tag.alpha { color: var(--red); }
.tag.client { color: #c297ff; }
.mod-actions { display: flex; gap: 4px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.files-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; margin: 14px 0; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--panel-2); }
.file-row.current { outline: 1px solid var(--accent); }

/* ---------- Publier / historique ---------- */
.checks, .releases, .history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checks li { padding: 8px 12px; border-radius: 8px; background: var(--panel-2); }
.checks li.error { color: var(--red); }
.checks li.warning { color: var(--yellow); }
.checks li.ok { color: var(--green); }
.releases li, .history li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; background: var(--panel-2);
}
.history .date { color: var(--muted); font-size: 12px; }
.history li:first-child { outline: 1px solid var(--accent); }

.soon { text-align: center; padding: 60px 20px; }
.soon-icon { font-size: 48px; margin-bottom: 10px; }
.soon p { max-width: 520px; margin: 10px auto 0; }

/* ---------- Dialogues / toasts ---------- */
.dialog {
  width: min(520px, 92vw);
  padding: 24px;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--panel); color: var(--text);
}
.dialog-wide { width: min(760px, 94vw); }
.dialog::backdrop { background: rgba(5, 6, 10, .7); backdrop-filter: blur(3px); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  max-width: 420px; padding: 12px 16px;
  border-radius: 10px; border-left: 4px solid var(--green);
  background: var(--panel-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  white-space: pre-line; animation: slide .2s ease-out;
}
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--yellow); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

.spinner {
  width: 18px; height: 18px; margin: 20px auto;
  border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
  .mods-layout, .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 210px; }
}

/* ---------- Jeu ---------- */
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.warn { background: var(--yellow); }
.game-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.step { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; background: var(--panel-2); }
.step .ok { color: var(--green); }
.step .ko { color: var(--yellow); }

/* ---------- Lanceur ---------- */
.btn-play {
  background: linear-gradient(135deg, #3fb950, #238636); border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(63, 185, 80, .3);
}
.btn-play:hover { filter: brightness(1.1); border-color: transparent; }
.btn-play.stop { background: linear-gradient(135deg, #f85149, #b62324); box-shadow: 0 4px 16px rgba(248, 81, 73, .3); }
.launch-panel, .crash-panel {
  margin-bottom: 16px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
}
.crash-panel { border-color: rgba(248, 81, 73, .5); background: rgba(248, 81, 73, .08); }
.launch-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.progress { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.progress-bar.indeterminate { width: 30%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { margin-left: -30%; } to { margin-left: 100%; } }
.crash-log {
  max-height: 360px; overflow: auto; margin: 12px 0 0; padding: 12px;
  border-radius: 8px; background: var(--bg); font: 12px/1.45 "JetBrains Mono", monospace; white-space: pre-wrap;
}

/* ---------- Crafts ---------- */
.mt-s { margin-top: 10px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.rc-layout { display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; gap: 20px; align-items: start; }
.rc-browser { position: sticky; top: 0; }
.rc-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.rc-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.rc-list { display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 400px); min-height: 200px; overflow-y: auto; padding-right: 4px; }
.rc-row {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center;
  padding: 7px 9px; border: 1px solid transparent; border-radius: 9px;
  background: var(--panel-2); cursor: pointer; text-align: left; color: var(--text); font: inherit;
}
.rc-row:hover { border-color: var(--border); }
.rc-row.active { border-color: var(--accent); background: var(--accent-soft); }
.rc-row .rc-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-row .rc-sub { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; }
.rc-mini { display: inline-flex; gap: 2px; align-items: center; }
.rc-mini img, .rc-mini .ph { width: 16px; height: 16px; }
.st { padding: 0 6px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.st-modified { background: rgba(88, 166, 255, .15); color: var(--blue); }
.st-added { background: rgba(63, 185, 80, .15); color: var(--green); }
.st-disabled { background: rgba(248, 81, 73, .15); color: var(--red); }

.mc-icon { image-rendering: pixelated; object-fit: cover; object-position: top; }
.ph { display: inline-grid; place-items: center; border-radius: 4px; background: var(--bg); color: var(--muted); font-size: 10px; }
.rc-row > .mc-icon, .rc-row > .ph { width: 36px; height: 36px; }

.slot {
  position: relative; display: inline-grid; place-items: center;
  width: 48px; height: 48px; padding: 0;
  border: 2px solid #0b0d12; border-radius: 4px;
  background: linear-gradient(145deg, #11141b, #1b2030);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.45), inset -2px -2px 0 rgba(255,255,255,.04);
  cursor: pointer;
}
.slot:hover { border-color: var(--accent); }
.slot img { width: 34px; height: 34px; }
.slot .ph { width: 34px; height: 34px; }
.slot .cnt { position: absolute; right: 3px; bottom: 1px; font: 700 12px Inter; color: #fff; text-shadow: 1px 1px 0 #000; }
.slot .chance { position: absolute; left: 2px; top: 1px; font: 700 9px Inter; color: var(--yellow); text-shadow: 1px 1px 0 #000; }
.slot .tagmark { position: absolute; left: 2px; top: 0; font: 700 11px Inter; color: var(--accent-2); text-shadow: 1px 1px 0 #000; }
.slot-lg { width: 64px; height: 64px; }
.slot-lg img, .slot-lg .ph { width: 44px; height: 44px; }
.slot.readonly { cursor: default; }
.slot.readonly:hover { border-color: #0b0d12; }

.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.rc-head h2 { font-size: 18px; }
.rc-id { font: 12px "JetBrains Mono", monospace; color: var(--muted); margin-top: 4px; }
.rc-id input { width: 320px; font: 12px "JetBrains Mono", monospace; }
.rc-preview {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px; margin-bottom: 16px; border-radius: 10px; background: var(--bg);
}
.rc-preview .group { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
.arrow { font-size: 28px; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(3, 48px); gap: 4px; }
.craft-form { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 16px; border-radius: 10px; background: var(--bg); }
.craft-side { display: flex; flex-direction: column; gap: 8px; }
.field-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.field-inline .input { width: 90px; }
.rc-tabs { display: flex; gap: 4px; margin: 14px 0 10px; }
.rc-tabs button { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border); background: none; color: var(--muted); font: 600 12px Inter; cursor: pointer; }
.rc-tabs button.active { color: var(--accent-2); border-color: var(--accent); background: var(--accent-soft); }
.json-editor { width: 100%; min-height: 320px; font: 12.5px/1.5 "JetBrains Mono", monospace; tab-size: 2; }
.json-error { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 4px; }
.rc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 55vh; overflow-y: auto; margin: 12px 0; }
.pick {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 8px; background: var(--panel-2);
  color: var(--text); font: 12px Inter; text-align: left; cursor: pointer;
}
.pick:hover { border-color: var(--accent); }
.pick img, .pick .ph { width: 28px; height: 28px; flex-shrink: 0; }
.pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick small { display: block; color: var(--muted); font-size: 10px; }

.serializer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 55vh; overflow-y: auto; margin: 12px 0; }
.serializer-list button { text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: var(--panel-2); color: var(--text); font: 13px Inter; cursor: pointer; }
.serializer-list button:hover { border-color: var(--accent); }
.serializer-list small { display: block; color: var(--muted); font-size: 11px; }
.serializer-list h3 { grid-column: 1 / -1; margin: 8px 0 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.replace-row, .bulk-row { display: flex; align-items: center; gap: 14px; }
.replace-row { justify-content: center; }
.replace-names { display: flex; justify-content: space-around; color: var(--muted); font-size: 12px; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--text); margin-bottom: 8px; }

@media (max-width: 1100px) { .rc-layout { grid-template-columns: 1fr; } .rc-browser { position: static; } }

/* ---------- Unification ---------- */
.small { font-size: 12px; }
.un-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.un-top p { margin: 6px 0 0; }
.un-actions { display: flex; gap: 8px; }
.un-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.prio-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.prio-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); }
.prio-list .rank { width: 22px; color: var(--accent-2); font-weight: 700; }
.prio-list .name { flex: 1; font-weight: 600; }
.prio-list button { padding: 2px 7px; border: 1px solid var(--border); border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.prio-list button:hover { color: var(--text); border-color: var(--accent); }
.fam-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 10px; font-size: 13px; }
.fam-list label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.un-groups { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 330px); overflow-y: auto; padding-right: 4px; }
.un-group { padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid transparent; }
.un-group.ignored { opacity: .5; }
.un-group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.un-group-head b { font-size: 14px; }
.un-group-head code { color: var(--muted); font-size: 11px; margin-left: 6px; }
.un-items { display: flex; flex-wrap: wrap; gap: 8px; }
.un-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px;
  border: 2px solid transparent; border-radius: 9px; background: var(--bg);
  color: var(--text); font: 12px Inter; cursor: pointer; text-align: left;
}
.un-item:hover { border-color: var(--border); }
.un-item.winner { border-color: var(--green); background: rgba(63, 185, 80, .08); }
.un-item.loser { opacity: .75; }
.un-item img, .un-item .ph { width: 32px; height: 32px; }
.un-item small { display: block; color: var(--muted); font-size: 10px; }
.un-item .crown { margin-left: 2px; }
.un-arrow { color: var(--muted); font-size: 11px; }
@media (max-width: 1100px) { .un-layout { grid-template-columns: 1fr; } }

/* ---------- Configs ---------- */
.cf-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.cf-browser { position: sticky; top: 0; }
.cf-files { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; max-height: calc(100vh - 300px); overflow-y: auto; }
.cf-mod { margin: 10px 0 2px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.cf-file {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 6px 9px; border: 1px solid transparent; border-radius: 7px; background: none;
  color: var(--text); font: 13px Inter; text-align: left; cursor: pointer;
}
.cf-file:hover { background: var(--panel-2); }
.cf-file.active { border-color: var(--accent); background: var(--accent-soft); }
.cf-file .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-result { padding: 8px 10px; border-radius: 8px; background: var(--panel-2); cursor: pointer; border: 1px solid transparent; text-align: left; color: var(--text); font: 12px Inter; }
.cf-result:hover { border-color: var(--accent); }
.cf-result b { font-size: 13px; }
.cf-result small { display: block; color: var(--muted); }
.scope { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; background: var(--bg); color: var(--muted); }
.scope-serveur { color: var(--blue); } .scope-client { color: #c297ff; }
.cf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cf-head h2 { font-size: 17px; word-break: break-all; }
.cf-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.cf-section { margin-bottom: 10px; border-radius: 10px; background: var(--bg); }
.cf-section > summary { padding: 10px 14px; cursor: pointer; font-weight: 700; list-style: none; }
.cf-section > summary::before { content: "▸ "; color: var(--muted); }
.cf-section[open] > summary::before { content: "▾ "; }
.cf-section > summary small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.cf-entry {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--border);
}
.cf-entry.changed { background: rgba(240, 136, 62, .07); box-shadow: inset 3px 0 0 var(--accent); }
.cf-entry.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: rgba(240, 136, 62, .35); } }
.cf-key { font: 600 13px "JetBrains Mono", monospace; word-break: break-all; }
.cf-desc { color: var(--muted); font-size: 12px; margin-top: 3px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cf-desc.open { -webkit-line-clamp: unset; }
.cf-meta { color: var(--muted); font-size: 11px; margin-top: 4px; display: flex; gap: 10px; align-items: center; }
.cf-meta button { padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.cf-control .input { width: 100%; }
.cf-control textarea { font: 12px "JetBrains Mono", monospace; min-height: 60px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
.cf-savebar {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--accent); box-shadow: 0 -8px 24px rgba(0,0,0,.35);
}
.cf-text { width: 100%; min-height: 60vh; font: 12.5px/1.5 "JetBrains Mono", monospace; tab-size: 4; }
@media (max-width: 1100px) { .cf-layout { grid-template-columns: 1fr; } .cf-browser { position: static; } .cf-entry { grid-template-columns: 1fr; } }

/* ---------- Quêtes ---------- */
.qb-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px;
  border-radius: 10px; background: rgba(210, 153, 34, .12); border: 1px solid rgba(210, 153, 34, .4); }
.qb-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 340px; gap: 14px; align-items: stretch; height: calc(100vh - 210px); min-height: 520px; }
.qb-chapters, .qb-side { overflow-y: auto; }
.qb-book { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.qb-chapter-list { display: flex; flex-direction: column; gap: 4px; }
.qb-ch { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent;
  background: var(--panel-2); color: var(--text); font: 13px Inter; cursor: pointer; text-align: left; }
.qb-ch.active { border-color: var(--accent); background: var(--accent-soft); }
.qb-ch img, .qb-ch .ph { width: 24px; height: 24px; flex-shrink: 0; }
.qb-ch .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-ch small { color: var(--muted); }
.qb-group { margin: 8px 0 2px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.qb-save { margin-top: 12px; }
.qb-center { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qb-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.qb-board {
  position: relative; flex: 1; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border);
  background-color: #0b0d12; cursor: grab; outline: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
}
.qb-board.panning { cursor: grabbing; }
.qb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.qb-lines { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.qb-lines line { stroke: rgba(160, 170, 200, .45); stroke-width: 2.5; }
.qb-lines line.hot { stroke: var(--accent-2); stroke-width: 3.5; }
.qb-lines line.done { stroke: rgba(160, 170, 200, .25); }
.qb-lines marker path { fill: rgba(160, 170, 200, .7); }
.qb-hint { position: absolute; left: 10px; bottom: 8px; right: 10px; color: rgba(255,255,255,.35); font-size: 11px; pointer-events: none; }

.qnode { position: absolute; transform: translate(-50%, -50%); cursor: pointer; }
.qnode .shape { position: absolute; inset: 0; background: #5a6178; }
.qnode .shape-in { position: absolute; inset: 3px; background: #1d2230; }
.qnode .ico { position: absolute; inset: 18%; display: grid; place-items: center; }
.qnode .ico img, .qnode .ico .ph { width: 100%; height: 100%; }
.qnode.optional .shape { background: #3d4252; }
.qnode.selected .shape { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.qnode.link-target .shape { background: var(--green); }
.qnode .qlabel {
  position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
  font: 600 11px Inter; color: #d9dcea; text-shadow: 0 1px 2px #000; pointer-events: none;
}
.s-circle > .shape, .s-circle > .shape > .shape-in, .s-gear > .shape, .s-gear > .shape > .shape-in { border-radius: 50%; }
.s-gear > .shape { background: repeating-conic-gradient(#5a6178 0 12deg, transparent 12deg 24deg); }
.s-gear.selected > .shape { background: repeating-conic-gradient(var(--accent) 0 12deg, transparent 12deg 24deg); box-shadow: none; }
.s-gear > .shape > .shape-in { inset: 5px; }
.s-rsquare > .shape, .s-rsquare > .shape > .shape-in { border-radius: 24%; }
.s-diamond > .shape, .s-diamond > .shape > .shape-in { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.s-pentagon > .shape, .s-pentagon > .shape > .shape-in { clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); }
.s-hexagon > .shape, .s-hexagon > .shape > .shape-in { clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%); }
.s-octagon > .shape, .s-octagon > .shape > .shape-in { clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.s-heart > .shape, .s-heart > .shape > .shape-in { clip-path: polygon(50% 100%, 6% 55%, 0 30%, 12% 8%, 32% 2%, 50% 18%, 68% 2%, 88% 8%, 100% 30%, 94% 55%); }
.s-none > .shape { background: transparent !important; box-shadow: none !important; }
.s-none > .shape > .shape-in { background: transparent; }
.s-none.selected { outline: 2px dashed var(--accent); outline-offset: 2px; }

.qb-side h2 { margin-bottom: 10px; }
.qb-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.qb-presets button { padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: 600 12px Inter; cursor: pointer; }
.qb-presets button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.qb-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.qb-row { display: flex; gap: 8px; align-items: center; }
.qb-colors { display: flex; flex-wrap: wrap; gap: 3px; }
.qb-colors button { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.5); cursor: pointer; padding: 0; }
.qb-fmt { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.qb-fmt .fb { padding: 1px 7px; border-radius: 5px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); cursor: pointer; font: 12px Inter; }
.qb-preview { padding: 10px; border-radius: 8px; background: #0b0d12; font: 13px/1.5 Inter; color: #fff; min-height: 34px; white-space: pre-wrap; word-break: break-word; }
.qb-list { display: flex; flex-direction: column; gap: 6px; }
.qb-item { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; background: var(--panel-2); font-size: 12px; color: var(--text); }
.qb-item .slot { width: 40px; height: 40px; flex-shrink: 0; }
.qb-item .slot img, .qb-item .slot .ph { width: 28px; height: 28px; }
.qb-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.qb-item input.input { padding: 5px 8px; font-size: 12px; }
.qb-item .x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.qb-item .x:hover { color: var(--red); }
.qb-deps { display: flex; flex-wrap: wrap; gap: 4px; }
.qb-deps span { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); font-size: 12px; }
.qb-deps button { background: none; border: none; color: var(--muted); cursor: pointer; }
.qb-add { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.qb-add button { padding: 3px 8px; border-radius: 6px; border: 1px dashed var(--border); background: none; color: var(--muted); font: 12px Inter; cursor: pointer; }
.qb-add button:hover { color: var(--text); border-color: var(--accent); }
.mc-b { font-weight: 700; } .mc-i { font-style: italic; } .mc-u { text-decoration: underline; } .mc-s { text-decoration: line-through; }
@media (max-width: 1300px) { .qb-layout { grid-template-columns: 180px minmax(0, 1fr) 300px; } }

.qb-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; color: var(--muted); }
.qb-empty > div { font-size: 48px; }

.qb-img { position: absolute; pointer-events: none; user-select: none; }
.qb-img img { width: 100%; height: 100%; object-fit: fill; display: block; }
.qb-img .noprev { width: 100%; height: 100%; display: grid; place-items: center; border: 1px dashed var(--border); color: var(--muted); font-size: 11px; }
.qb-board.image-mode .qb-img { pointer-events: auto; cursor: move; }
.qb-board.image-mode .qb-img:hover { outline: 1px dashed rgba(255,255,255,.4); }
.qb-board.image-mode .qb-img.sel { outline: 2px solid var(--accent); }
.qb-board.image-mode .qnode, .qb-board.image-mode .qb-lines { opacity: .35; pointer-events: none; }
#qb-autolink.on, #qb-image-mode.on { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.qb-imgrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; background: var(--panel-2); margin-bottom: 6px; border: 1px solid transparent; }
.qb-imgrow.sel { border-color: var(--accent); }
.qb-imgrow .thumb { width: 56px; height: 40px; border-radius: 5px; background: #0b0d12 center/contain no-repeat; }
.qb-imgrow input[type=range] { width: 100%; }
.qb-imgrow .ctl { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.qb-gallery { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.qb-gallery button { width: 56px; height: 40px; border-radius: 5px; border: 1px solid var(--border); background: #0b0d12 center/contain no-repeat; cursor: pointer; }
.qb-gallery button:hover { border-color: var(--accent); }

.qb-group { display: flex; align-items: center; gap: 4px; margin: 10px 0 3px; padding: 4px 6px; border-radius: 6px;
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border: 1px dashed transparent; }
.qb-group .gname { flex: 1; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-group button { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0 3px; font-size: 12px; }
.qb-group button:hover { color: var(--text); }
.qb-group.drop, .qb-ch.drop { border-color: var(--accent); background: var(--accent-soft); }
.qb-ch[draggable="true"] { cursor: grab; }
.qb-ch.dragging { opacity: .4; }
.qb-group-empty { font-size: 11px; color: var(--muted); padding: 2px 8px 6px; }

/* ---------- Objets personnalisés ---------- */
.ct-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.ct-list { display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 300px); overflow-y: auto; }
.ct-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; border: 1px solid transparent;
  background: var(--panel-2); color: var(--text); font: 13px Inter; cursor: pointer; text-align: left; }
.ct-row.active { border-color: var(--accent); background: var(--accent-soft); }
.ct-row img, .ct-row .ph { width: 32px; height: 32px; image-rendering: pixelated; }
.ct-row small { display: block; color: var(--muted); font-size: 11px; }
.ct-types { display: flex; gap: 6px; margin-bottom: 14px; }
.ct-types button { flex: 1; padding: 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: 600 13px Inter; cursor: pointer; }
.ct-types button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ct-tex { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: start; padding: 14px; border-radius: 10px; background: var(--bg); margin-bottom: 14px; }
.ct-preview { width: 160px; height: 160px; border-radius: 8px; image-rendering: pixelated; object-fit: contain;
  background: repeating-conic-gradient(#1b1f2a 0 25%, #151821 0 50%) 0 0 / 20px 20px; }
.ct-faces { display: flex; gap: 4px; margin-bottom: 8px; }
.ct-faces button { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: none; color: var(--muted); font: 12px Inter; cursor: pointer; }
.ct-faces button.active { color: var(--accent-2); border-color: var(--accent); }
.ct-actions { display: flex; flex-direction: column; gap: 8px; }
.ct-actions .opt { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.ct-actions .opt .input { width: 70px; padding: 4px 6px; }
.ct-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ct-tags span { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); font: 12px "JetBrains Mono", monospace; }
.ct-tags button { background: none; border: none; color: var(--muted); cursor: pointer; }
.px-layout { display: grid; grid-template-columns: 384px 1fr; gap: 16px; margin: 12px 0; }
#px-canvas { border-radius: 8px; cursor: crosshair; image-rendering: pixelated; background: repeating-conic-gradient(#1b1f2a 0 25%, #151821 0 50%) 0 0 / 24px 24px; }
.px-tools { display: flex; flex-direction: column; gap: 10px; }
.px-toolrow { display: flex; gap: 4px; }
.px-toolrow button { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; font-size: 16px; }
.px-toolrow button.active { border-color: var(--accent); background: var(--accent-soft); }
.px-palette { display: flex; flex-wrap: wrap; gap: 3px; }
.px-palette button { width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(0,0,0,.5); cursor: pointer; padding: 0; }
@media (max-width: 1100px) { .ct-layout { grid-template-columns: 1fr; } }

.ct-swatch { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
.ct-color-big { width: 160px; height: 160px; border-radius: 12px; position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }
.ct-color-big::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 8px, transparent 8px 16px); }

.ai-status { padding: 10px 12px; border-radius: 8px; background: var(--panel-2); margin: 10px 0; font-size: 13px; }
.ai-status.ready { color: var(--green); }
.ai-status.wait { color: var(--yellow); }
.ai-results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.ai-results button { padding: 8px; border-radius: 10px; border: 2px solid var(--border); background: repeating-conic-gradient(#1b1f2a 0 25%, #151821 0 50%) 0 0 / 16px 16px; cursor: pointer; }
.ai-results button:hover { border-color: var(--accent); }
.ai-results img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; }
.ai-results .spinner { grid-column: 1 / -1; }

.ai-ref { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; background: var(--bg); margin-bottom: 12px; }
.ai-ref .qb-row { margin-top: 6px; flex-wrap: wrap; }
.ai-variant { display: flex; flex-direction: column; gap: 4px; }
.ai-variant .faces { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.ai-variant .faces img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; border-radius: 4px; }
.ai-variant small { color: var(--muted); font-size: 10px; text-align: center; }

/* ---------- Formulaire des recettes de machines ---------- */
.mf-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 10px; background: var(--bg); }
.mf-list, .mf-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mf-list legend, .mf-group legend { padding: 0 6px; color: var(--accent-2); font-weight: 700; font-size: 12px; }
.mf-item { display: flex; align-items: flex-start; gap: 6px; }
.mf-item > :first-child { flex: 1; }
.mf-item .x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding-top: 12px; }
.mf-item .x:hover { color: var(--red); }
.mf-ref { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; background: var(--panel-2); }
.mf-ref.out { box-shadow: inset 3px 0 0 var(--green); }
.mf-ref-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mf-name { font: 12px "JetBrains Mono", monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-ref-fields { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.mf-ref-fields label { display: flex; align-items: center; gap: 4px; }
.mf-ref-fields .input { width: 80px; padding: 3px 6px; font-size: 12px; }
.mf-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.mf-field .input { width: 160px; padding: 5px 8px; }

/* ---------- Mises à jour des mods / renommage ---------- */
.upd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -4px 0 12px; font-size: 12px; }
.upd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-left: auto; }
.tag.upd { color: var(--green); }
.tag.uptodate { color: var(--muted); }
.mod.has-upd { box-shadow: inset 3px 0 0 var(--green); }
.mod .upd-check { margin-right: 2px; accent-color: var(--green); }
#pack-title-wrap { display: flex; align-items: center; gap: 8px; }
#pack-title-wrap .btn-icon { background: none; border: none; cursor: pointer; font-size: 16px; opacity: .45; padding: 2px; }
#pack-title-wrap:hover .btn-icon { opacity: 1; }
#pack-title-wrap input { font: inherit; font-size: 26px; padding: 2px 8px; max-width: 520px; }

/* ---------- Recherche par catégories ---------- */
.cat-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cat-bar.sub { padding: 8px; border-radius: 10px; background: var(--panel-2); }
.cat { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; }
.cat img { width: 16px; height: 16px; border-radius: 3px; }
.cat:hover { border-color: var(--accent); }
.cat.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); font-weight: 600; }
.cat.clear { color: var(--muted); }
.search-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.search-opts label { display: flex; align-items: center; gap: 6px; }
#results.hide-installed .mod.is-installed { display: none; }
#results .mod-name { cursor: pointer; }
#results .mod-name:hover { color: var(--accent-2); text-decoration: underline; }
.md-head { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; margin-bottom: 10px; }
.md-head img, .md-head .noicon { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.md-head h2 { margin: 0; }
.md-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.md-shots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 10px 0; }
.md-shots img { height: 130px; border-radius: 8px; cursor: zoom-in; flex: none; }
.md-desc { max-height: 45vh; overflow-y: auto; padding: 12px; border-radius: 10px; background: var(--panel-2); font-size: 13px; line-height: 1.5; }
.md-desc img { max-width: 100%; height: auto; }
.md-desc a { color: var(--accent-2); }

/* ---------- Onglet Menus (habillage) ---------- */
.br-layout { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.1fr); gap: 16px; align-items: start; }
.br-right { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 12px; }
.br-form { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 230px); overflow-y: auto; padding-right: 6px; }
.br-sec { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.br-sec h3, .br-cap { margin: 0 0 4px; font-size: 14px; color: var(--accent-2); }
.br-color { display: flex; align-items: center; gap: 10px; }
.br-color input[type=color] { width: 44px; height: 26px; border: none; background: none; cursor: pointer; }
.br-color input[type=color]:disabled { opacity: .3; cursor: default; }
.br-image { display: flex; gap: 12px; align-items: center; }
.br-thumb { width: 90px; height: 50px; flex: none; border-radius: 8px; background: var(--bg) center / contain no-repeat;
  display: grid; place-items: center; color: var(--muted); font-size: 11px; image-rendering: pixelated; border: 1px solid var(--border); }
.br-thumb.wide { background-size: cover; }
.br-image-actions { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.br-hide { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.br-buttons { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.br-btn-row { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr 1fr auto; gap: 6px; align-items: center; }
.br-btn-row .input { padding: 5px 8px; font-size: 12px; }
.br-btn-row .x { background: none; border: none; color: var(--muted); cursor: pointer; }
.br-window { background: #2b2b2b; color: #ddd; font-size: 12px; padding: 5px 10px; border-radius: 8px 8px 0 0; }
.br-dots { color: #777; letter-spacing: 2px; margin-right: 6px; }
.br-preview { position: relative; overflow: hidden; border-radius: 0 0 8px 8px; font-family: "JetBrains Mono", monospace; user-select: none;
  background: linear-gradient(160deg, #6fa8dc, #3d6e3d 60%, #2d4a2d); }
.br-bg { position: absolute; inset: 0; background: center / cover no-repeat; image-rendering: pixelated; }
.br-dim { position: absolute; inset: 0; }
.br-logo { position: absolute; left: 50%; transform: translateX(-50%); image-rendering: pixelated; object-fit: contain; }
.br-mc { color: #cfcfcf; font-weight: 900; letter-spacing: 2px; text-shadow: 3px 3px 0 #333; white-space: nowrap; }
.br-splash { position: absolute; color: #ffff00; transform: rotate(-20deg); text-shadow: 1px 1px 0 #3f3f00; white-space: nowrap; animation: br-pulse .5s infinite alternate; }
@keyframes br-pulse { from { scale: 1; } to { scale: 1.08; } }
.br-row { position: absolute; left: 50%; transform: translateX(-50%); display: flex; }
.br-b { display: grid; place-items: center; box-sizing: border-box; background: #6f6f6f; border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #aaa, inset -1px -2px 0 #555; text-shadow: 1px 1px 0 #3f3f3f; white-space: nowrap; overflow: hidden; image-rendering: pixelated; }
.br-abs { position: absolute; }
.br-bottom { position: absolute; left: 3px; bottom: 3px; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; line-height: 1.25; }
.br-copy { position: absolute; right: 3px; bottom: 3px; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; }
.br-loading { height: 190px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.br-loading img { max-width: 60%; max-height: 90px; image-rendering: pixelated; }
.br-mojang { color: #fff; font-weight: 900; font-size: 30px; text-align: center; line-height: .9; letter-spacing: 2px; }
.br-mojang small { font-size: 13px; letter-spacing: 6px; }
.br-bar { width: 60%; height: 10px; border: 1px solid; padding: 1px; }
.br-bar span { display: block; height: 100%; width: 62%; }
.br-ai-results { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.br-ai-pick { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.br-ai-pick:hover { border-color: var(--accent); }
.br-ai-pick img { width: 100%; display: block; }
#br-save.pulse { box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 1100px) { .br-layout { grid-template-columns: 1fr; } .br-right { position: static; } }

/* ---------- Hostile Neural Networks ---------- */
.dialog-huge { width: min(1180px, 96vw); max-height: 92vh; }
.hn-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; min-height: 60vh; }
.hn-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.hn-side .qb-row .input { flex: 1; }
.hn-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; max-height: 64vh; padding-right: 4px; }
.hn-mob { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; padding: 6px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid transparent; color: inherit; text-align: left; cursor: pointer; }
.hn-mob:hover { border-color: var(--border); }
.hn-mob.active { border-color: var(--accent); }
.hn-mob-txt { display: flex; flex-direction: column; min-width: 0; }
.hn-mob-txt small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.warn { color: var(--yellow); }
.chip.off { color: var(--red); }
.hn-editor { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 70vh; padding-right: 6px; }
.hn-head { display: flex; gap: 12px; align-items: center; }
.hn-head h3 { margin: 0 0 2px; }
.hn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.hn-drops { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.hn-drop { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; background: var(--panel-2); }
.hn-drop-name { display: flex; flex-direction: column; font-size: 13px; }
.hn-drop-name small { color: var(--muted); font-size: 11px; }
.hn-drop .input { width: 80px; padding: 4px 6px; }
.hn-drop .x, .hn-variants .x { background: none; border: none; color: var(--muted); cursor: pointer; }
.hn-loot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.hn-loot-item { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; border: 1px dashed var(--border);
  background: none; color: inherit; font-size: 12px; cursor: pointer; }
.hn-loot-item:hover { border-color: var(--accent); }
.hn-loot-item .mc-icon { width: 16px; height: 16px; }
.hn-variants { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.hn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hn-bulk-list { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow-y: auto; margin: 10px 0; }
.hn-bulk-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; font-size: 13px; }
.hn-bulk-row:hover { background: var(--panel-2); }
.hn-bulk-row .slot { width: 26px; height: 26px; }

/* ---------- Multiblocs (éditeur 3D) ---------- */
.mb-layout { display: grid; grid-template-columns: 250px 1fr 380px; gap: 14px; align-items: start; }
.mb-left, .mb-right { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 200px); overflow-y: auto; }
.mb-list { display: flex; flex-direction: column; gap: 4px; }
.mb-item { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--panel-2);
  border: 1px solid transparent; color: inherit; text-align: left; cursor: pointer; }
.mb-item.active { border-color: var(--accent); }
.mb-item span:last-child { display: flex; flex-direction: column; }
.mb-item small { color: var(--muted); font-size: 11px; }
.mb-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mb-h { margin: 8px 0 2px; font-size: 13px; color: var(--accent-2); }
.mb-selected { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; background: var(--bg); font-size: 13px; }
.mb-selected img { width: 28px; height: 28px; image-rendering: pixelated; }
.mb-pgroup small { color: var(--muted); font-size: 11px; }
.mb-pgrid { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 8px; }
.mb-pgrid .slot.on { outline: 2px solid var(--accent); }
.mb-pgrid .slot img, .mb-craft .slot img { image-rendering: pixelated; }
.mb-center { display: flex; flex-direction: column; gap: 8px; }
.mb-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mb-view { height: calc(100vh - 290px); min-height: 380px; border-radius: 10px; overflow: hidden; background: #14161c; cursor: crosshair; }
.mb-help { font-size: 11px; color: var(--muted); }
.mb-info { font-size: 12px; }
.mb-info .warn { color: var(--yellow); font-weight: 600; }
#mb-name { flex: 1; font-weight: 700; }
#mb-color { width: 40px; height: 32px; border: none; background: none; cursor: pointer; }
.mb-recipe { border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.mb-rhead { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.mb-rhead .input { width: 70px; padding: 3px 6px; }
.mb-rhead .x, .mb-entry .x { background: none; border: none; color: var(--muted); cursor: pointer; }
.mb-cols { display: grid; grid-template-columns: 1fr; gap: 6px; }
.mb-legend { font-size: 10px; opacity: .7; }
.mb-entry { display: grid; grid-template-columns: 1fr 38px 70px 52px auto; gap: 4px; align-items: center; margin: 3px 0; }
.mb-entry .input { padding: 3px 5px; font-size: 12px; }
.mb-entry .slot { width: 36px; height: 36px; position: relative; }
.mb-craft { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; }
@media (max-width: 1300px) { .mb-layout { grid-template-columns: 220px 1fr; } .mb-right { grid-column: 1 / -1; max-height: none; } }

/* ---------- Abeilles ---------- */
.be-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.be-tabs button { flex: 1; padding: 5px 6px; font-size: 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--muted); cursor: pointer; }
.be-tabs button.active { color: var(--accent-2); border-color: var(--accent); }
.be-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid transparent; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.be-row.active { border-color: var(--accent); }
.be-row.off { opacity: .45; }
.be-row span { display: flex; flex-direction: column; min-width: 0; }
.be-row small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.be-miss { grid-template-columns: 18px 26px 1fr; }
.be-miss .mc-icon { width: 24px; height: 24px; }
.be-miss-go { position: sticky; bottom: 0; padding: 8px 0; background: var(--panel); }
.be-all { margin: 2px 0 4px; }
.be-svg { image-rendering: pixelated; flex: none; }
.be-head { display: flex; gap: 14px; align-items: center; }
.be-headtxt { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.be-name { font-size: 18px; font-weight: 700; }
.be-prod { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; }
.be-prod .slot { position: relative; }
.be-prod .input { width: 70px; }
.be-colors { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.be-colors input[type=color] { width: 40px; height: 26px; border: none; background: none; cursor: pointer; }
.be-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.hn-eggbox { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--bg); }
.hn-eggbox.big { width: 56px; height: 56px; }
.hn-eggbox.big svg { width: 40px; height: 46px; }
.hn-bulk-row .hn-eggbox { width: 26px; height: 26px; }
.hn-bulk-row .hn-eggbox svg { width: 18px; height: 22px; }

/* ---------- Statues ---------- */
.st-preview { width: 120px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0; min-height: 150px; }
.st-figure { display: flex; align-items: flex-end; justify-content: center; }
.st-pedestal { width: 90px; height: 16px; border-radius: 3px; box-shadow: inset 0 -4px 0 #0004, 0 3px 6px #0006; }
.st-preview small { font-size: 10px; margin-top: 6px; text-align: center; }
.st-drop { grid-template-columns: 36px 1fr auto auto auto; }

/* ---------- Cristaux ---------- */
.cr-ico { width: 32px; height: 32px; image-rendering: pixelated; }
.cr-preview { display: flex; gap: 4px; align-items: flex-end; padding: 8px; border-radius: 10px; background: var(--bg); min-width: 120px; }
.cr-preview img { width: 40px; height: 40px; image-rendering: pixelated; }

/* ---------- Onglet Objets : en-tête de la liste ---------- */
.ct-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 6px; margin-bottom: 12px; }
.ct-tools .btn { justify-content: center; white-space: nowrap; }
.ct-size { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.ct-size span { white-space: nowrap; }
.ct-size .input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12px; }

/* Chapitre d'un mod (appris des autres modpacks) */
.dialog-actions .grow { flex: 1; }
.dialog-actions .field-inline { margin-right: auto; }
.mc-lib { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px;
  background: var(--panel-2); margin-bottom: 12px; font-size: 13px; }
.mc-lib .src { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--border); font-size: 12px; cursor: pointer; }
.mc-lib .src.off { opacity: .45; text-decoration: line-through; }
.mc-lib details { width: 100%; }
.mc-lib details > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mc-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; min-height: 420px; }
.mc-mods { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.mc-modlist { overflow-y: auto; max-height: 52vh; display: flex; flex-direction: column; gap: 2px; }
.mc-modlist button { display: flex; justify-content: space-between; gap: 8px; text-align: left; padding: 7px 10px;
  border-radius: 7px; background: none; border: 1px solid transparent; color: var(--text); cursor: pointer; font: inherit; }
.mc-modlist button:hover { background: var(--panel-2); }
.mc-modlist button.active { border-color: var(--accent); background: var(--panel-2); }
.mc-modlist small { color: var(--muted, #8b93a7); white-space: nowrap; }
.mc-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mc-items { overflow-y: auto; max-height: 46vh; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px; }
.mc-item { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: 7px; background: var(--panel-2); cursor: pointer; font-size: 13px; }
.mc-item:not(.on) { opacity: .5; }
.mc-item .slot { width: 30px; height: 30px; pointer-events: none; }
.mc-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-bar { height: 4px; border-radius: 2px; background: var(--border); margin-top: 3px; overflow: hidden; }
.mc-bar > i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 800px) { .mc-layout { grid-template-columns: 1fr; } }

/* Multiblocs : conditions d'une recette */
.mb-cond { margin: 4px 0 6px; }
.mb-cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-top: 6px; font-size: 12px; }
.mb-cond-grid label { display: flex; flex-direction: column; gap: 2px; }

/* Multiblocs : animations des groupes du modèle 3D */
.mb-anim-list { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.mb-anim { display: grid; grid-template-columns: 1fr 110px 50px 64px; gap: 4px; align-items: center; font-size: 12px; }
.mb-anim b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-toolbar .btn.on { border-color: var(--accent); color: var(--accent); }

/* Multiblocs : pièces décoratives du modèle 3D */
.mb-parts { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; max-height: 260px; overflow-y: auto; }
.mb-part { display: flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 7px; background: var(--panel-2); border: 1px solid transparent; cursor: pointer; font-size: 12px; }
.mb-part.sel { border-color: var(--accent); }
.mb-part .slot { width: 26px; height: 26px; flex: none; }
.mb-part .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-part select, .mb-part input { width: auto; max-width: 92px; padding: 2px 4px; font-size: 11px; }
.mb-part input { width: 52px; }
.mb-gizmo-modes { display: inline-flex; gap: 3px; margin-left: auto; }
.mb-gizmo-modes .on { border-color: var(--accent); color: var(--accent); }
.mb-basepick { align-items: center; }
.mb-part { flex-wrap: wrap; }
.mb-part .grow { flex: 1 1 140px; }
.mb-part select, .mb-part input { flex: 0 0 auto; }
.mb-anim { display: flex; flex-wrap: wrap; }
.mb-anim b { flex: 1 1 100%; }
.mb-anim select, .mb-anim input { width: auto; max-width: 110px; padding: 2px 4px; font-size: 11px; }
.mb-anim input { width: 56px; }

/* multiblocs : apparence une fois formée + effets */
.mb-look { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.mb-look .btn { flex: 1; }
.mb-look .btn.on { border-color: var(--accent); color: var(--accent); }
.mb-fx-list { display: flex; flex-direction: column; gap: 4px; }
.mb-fx { display: grid; grid-template-columns: 1fr 1fr 74px 22px; gap: 4px; align-items: center; }
.mb-fx .input { padding-left: 4px; padding-right: 2px; font-size: 12px; min-width: 0; }
.mb-look .btn.on { border-color: var(--accent); color: var(--accent); }
.mb-theme-roles { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.mb-theme-role { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mb-theme-role small { font-size: 10px; color: var(--muted, #8a93a6); }
.mb-part-3d { width: 32px; text-align: center; font-size: 18px; flex: none; }
.mbpart-list { display: flex; flex-direction: column; gap: 3px; max-height: 55vh; overflow-y: auto; margin-top: 8px; }
.mbpart { display: flex; gap: 8px; align-items: center; text-align: left; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  background: var(--panel, #1b1e26); border: 1px solid var(--border, #2c313c); color: inherit; font: inherit; }
.mbpart:hover { border-color: var(--accent); }
.mbpart .tag { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--border, #2c313c); }
.mb-tabs { display: flex; gap: 4px; margin: 10px 0 8px; flex-wrap: wrap; }
.mb-tabs .btn { flex: 1; white-space: nowrap; }
.mb-tabs .btn.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Skyblock */
.sb-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.sb-island { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px; border-radius: 8px;
  background: var(--bg-2, #151821); border: 1px solid var(--border, #2c313c); color: inherit; font: inherit; cursor: pointer; }
.sb-island.sel { border-color: var(--accent); }
.sb-island .tag { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--border, #2c313c); }
.sb-dirs { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.sb-dirs .btn.on { border-color: var(--accent); color: var(--accent); }
.sb-spawns, .sb-items, .sb-prot { display: flex; flex-direction: column; gap: 3px; }
.sb-count { width: 58px; }
.ql-targets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 10px; margin-top: 4px; }
.mc-batchbar { display: flex; gap: 4px; margin-bottom: 4px; }
.mc-modlist button.done > span { opacity: 0.7; }
.mc-modlist button input[type=checkbox] { margin: 0 6px 0 0; flex: none; }

/* Marteau */
.hm-head { display: flex; gap: 24px; flex-wrap: wrap; margin: 8px 0; }
.hm-rule { display: flex; align-items: center; gap: 14px; padding: 10px; margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; }
.hm-in { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.hm-arrow { font-size: 20px; opacity: .6; }
.hm-outs { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hm-out { display: flex; align-items: center; gap: 8px; }
.hm-out input[type=number] { width: 64px; }
.hm-tier { width: auto; }
.hm-outs > button, #gr-mutadd, [data-gr-srcadd] { align-self: flex-start; width: auto; }
.gr-prev { display: inline-flex; gap: 6px; vertical-align: middle; margin-left: 8px; }
.gr-prev img { width: 32px; height: 32px; image-rendering: pixelated; }
.qb-ch.drop-target { outline: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* ---------- Audit des fluides ---------- */
.fl-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-block; border: 1px solid #0006; }
.chip.ok { color: var(--green); }
.fl-block { margin: 12px 0; }
.fl-block h3 { margin: 0 0 6px; font-size: 14px; }
.fl-block ul { margin: 0; padding-left: 18px; }
.fl-block li { margin: 2px 0; }
.fl-block code { font-size: 11px; }
.fl-block a { color: var(--accent-2); }

/* ---------- Contrats du Gardien ---------- */
#gc-list .hn-eggbox img, #gc-editor h3 img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
#gc-editor h3 img { width: 24px; height: 24px; vertical-align: middle; }
.gc-reqs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.gc-req { display: grid; grid-template-columns: 40px 1fr 110px 28px; gap: 10px; align-items: center; padding: 4px 6px;
  border-radius: 8px; background: var(--panel-2); }
.gc-req .slot img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.gc-req-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

/* ---------- Vérificateur de progression ---------- */
.pg-top { display: grid; gap: 6px; margin-bottom: 10px; }
.pg-top textarea { width: 100%; font-family: monospace; font-size: 12px; }
.pg-list { display: flex; flex-direction: column; gap: 6px; max-height: 58vh; overflow-y: auto; }
.pg-item { padding: 6px 8px; border-radius: 8px; background: var(--panel-2); }
.pg-head { display: flex; align-items: center; gap: 8px; }
.pg-head img { width: 24px; height: 24px; image-rendering: pixelated; }
.pg-head .btn { margin-left: auto; }
.pg-item .chip { margin: 2px; }
.pg-ch { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 10px;
  border-radius: 8px; border: 1px solid transparent; background: var(--panel-2); color: inherit; text-align: left; cursor: pointer; }
.pg-ch:hover { border-color: var(--border); }
.pg-ch.active { border-color: var(--accent); }

/* PackForge Tools : tableau des matériaux */
.tl-wrap { max-height: 62vh; overflow: auto; margin-top: 8px; }
.tl-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.tl-grid th { position: sticky; top: 0; background: var(--panel, #1e1f26); text-align: left; padding: 6px; z-index: 1; }
.tl-grid td { padding: 4px 6px; border-top: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.tl-grid .input { padding: 4px 6px; min-width: 0; }
.tl-num { width: 82px; }
.tl-grid input[type=color] { width: 38px; height: 26px; border: 0; background: none; padding: 0; }
.tl-edited, .tl-edited-sample { color: #ffcc55; border-color: #ffcc55 !important; }
.tl-off td { opacity: .45; }

/* Serveur hébergé : cases à cocher sur une ligne dans le formulaire en colonnes */
#sv-form label.field-inline { flex-direction: row; align-items: center; font-weight: 400; }
#sv-form label.field-inline a { display: inline; }
#sv-form h3 { margin: 14px 0 6px; }

/* Onglet Serveurs */
.servers-view .qb-row { flex-wrap: wrap; }
.servers-view [data-srv-cmd] .input { flex: 1; }
.servers-view pre.log { max-height: 260px; overflow: auto; font-size: 12px; background: var(--panel-2); padding: 8px; border-radius: 6px; white-space: pre-wrap; }

/* Microverse */
.mv-tabs .btn.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mv-theme { padding: 10px 14px; margin-bottom: 8px; }
.mv-theme summary { cursor: pointer; }
.mv-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 10px; }
.mv-key { padding: 10px; }
.mv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0; }
.mv-grid .input { width: 100%; font-size: 11px; padding: 5px 6px; }
#mv-body .table { width: 100%; border-collapse: collapse; }
#mv-body .table th, #mv-body .table td { padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--border, #2c313c); font-size: 13px; }
#mv-body .danger { color: #e05555; }

/* ---------- Nos mods ---------- */
.own-mods { margin-bottom: 14px; }
.own-mods .panel-head { flex-wrap: wrap; gap: 8px; }
.own-list { display: flex; flex-direction: column; gap: 6px; }
.own-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.03); flex-wrap: wrap; }
.own-row.off { opacity: .6; }
.own-dot { width: 10px; height: 10px; border-radius: 50%; background: #666; flex: none; }
.own-row.on .own-dot { background: #4caf50; box-shadow: 0 0 6px #4caf5088; }
.own-info { display: flex; flex-direction: column; flex: 1; min-width: 180px; }
.own-info .muted { font-size: .85em; }
.own-mode { width: auto; }

/* menus de la barre des quêtes */
.qb-menu { position: relative; display: inline-block; }
.qb-menu > summary { list-style: none; cursor: pointer; }
.qb-menu > summary::-webkit-details-marker { display: none; }
.qb-menu-list { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 6px; min-width: 220px; background: var(--panel, #1e2127); border: 1px solid var(--border, #3a3f48); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.qb-menu-list .btn { text-align: left; justify-content: flex-start; width: 100%; }
.qview-preview { height: 110px; border: 2px solid #1b1d1e; border-radius: 4px; background: #2e3036 center / 100% 100% no-repeat;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 6px; color: #aaa; font-family: monospace; }

/* catégories (navigation principale) */
.cats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.cats button { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel);
  color: var(--muted); font: 600 14px Inter, sans-serif; cursor: pointer; }
.cats button:hover { color: var(--text); }
.cats button.active { color: var(--accent-2); border-color: rgba(240, 136, 62, .5); background: var(--accent-soft); }
.adv-toggle { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.tabs button[hidden] { display: none; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.ov-info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.ov-info dt { color: var(--muted); }
.ov-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ov-card { text-align: left; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2);
  color: var(--text); cursor: pointer; font: 500 13px Inter, sans-serif; }
.ov-card:hover { border-color: var(--accent); }
.ov-card b { display: block; margin-bottom: 4px; font-size: 14px; }
.ov-card span { color: var(--muted); }

/* en-tête des éditeurs : à quoi sert la page, mods nécessaires, limites, où la retrouver en jeu */
.ed-intro { margin-bottom: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.ed-intro > summary { padding: 8px 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.ed-intro.warn { border-color: #d29922; }
.ed-intro.warn > summary { color: #e3b341; }
.ed-intro-body { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.warn-chip { color: #e3b341; border-color: #d29922; }

.list-search { width: 100%; margin: 6px 0; }
.trash-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }

.save-badge { display: inline-block; margin-top: 6px; font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); }
.save-badge.ok { color: #3fb950; border-color: rgba(63, 185, 80, .4); }
.save-badge.dirty { color: #e3b341; border-color: #d29922; }
.save-badge.err { color: #f85149; border-color: #f85149; }

.hist-mark { border-left: 3px solid var(--accent); padding-left: 8px; font-weight: 600; }

.health-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 420px; overflow: auto; }
.health-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px;
  background: var(--panel-2); font-size: 13px; }
.health-row.error { border-left: 3px solid #f85149; }
.health-row.warning { border-left: 3px solid #d29922; }
.cats button[data-count]:not([data-count=""])::after { content: attr(data-count); margin-left: 6px; padding: 0 6px; border-radius: 999px;
  background: #f85149; color: #fff; font-size: 11px; }

.ai-compare { display: flex; gap: 12px; align-items: flex-start; }
.ai-current { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 72px; }
.ai-current img { width: 64px; height: 64px; image-rendering: pixelated; border: 1px dashed var(--border); border-radius: 6px; }
.ai-compare .ai-results { flex: 1; }

.op-panel { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.op-panel.ok { border-color: rgba(63, 185, 80, .5); }
.op-panel.err { border-color: #f85149; }
.op-panel #op-result { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.progress-bar.indeterminate { width: 30% !important; animation: op-slide 1.2s ease-in-out infinite; }
@keyframes op-slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

.own-summary { cursor: pointer; list-style: none; }
.own-summary::-webkit-details-marker { display: none; }
.own-summary h2::before { content: "▸ "; color: var(--muted); }
details[open] > .own-summary h2::before { content: "▾ "; }
details.own-mods:not([open]) > .own-summary { margin-bottom: 0; }

/* éditeur de butins */
.lt-layout { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 16px; align-items: start; }
.lt-list { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow: auto; }
.lt-row { display: flex; justify-content: space-between; gap: 8px; text-align: left; padding: 6px 8px; border: 1px solid transparent;
  border-radius: 8px; background: none; color: var(--text); cursor: pointer; font: 13px Inter, sans-serif; }
.lt-row:hover, .lt-row.active { background: var(--panel-2); border-color: var(--border); }
.lt-row small { display: block; color: var(--muted); font-size: 11px; }
.lt-modes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.lt-pool { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin: 8px 0; background: var(--panel-2); }
.lt-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.lt-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 4px; }
.lt-table td { padding: 2px 4px; }
.lt-item { display: flex; align-items: center; gap: 6px; }
.lt-structs { margin: 4px 0 8px; }

/* monde : aperçu des minerais */
.wg-chart { overflow-x: auto; padding: 6px 0; }
.wg-svg { display: block; }
.wg-grid { stroke: var(--border); stroke-width: 1; }
.wg-sea { stroke: #3a7be6; stroke-dasharray: 4 3; }
.wg-axis { fill: var(--muted); font: 11px Inter, sans-serif; text-anchor: end; }
.wg-bar { fill: var(--accent); stroke: var(--accent-2); stroke-width: 1; cursor: pointer; }
.wg-bar.wg-sel { fill: #3fb950; stroke: #3fb950; }
.wg-col:hover .wg-bar { stroke-width: 2; }
.wg-col foreignObject div { width: 100%; height: 100%; }
.wg-col foreignObject .mc-icon { width: 100%; height: 100%; image-rendering: pixelated; }
.wg-mod { fill: #e3b341; }
.wg-summary { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); font-weight: 600; }
.wg-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 8px 0; }
.wg-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.wg-dimlist { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 8px 0; }

.tag.avoid { color: #f85149; border-color: #f85149; }
.tag.prefer { color: #e3b341; border-color: #d29922; }

.crash-doctor { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.crash-cause { padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border-left: 3px solid var(--border); }
.crash-cause.sure { border-left-color: #3fb950; }
.crash-cause.likely { border-left-color: #e3b341; }
.crash-cause.maybe { border-left-color: var(--muted); }

.ov-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 14px; }

.dm-mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; }
.dm-mod { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); }
.dm-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; border: 1px solid var(--border); }
.dm-table td { vertical-align: middle; padding: 6px 4px; }

.account-box { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--muted); }

.task-row { padding: 8px 0; border-bottom: 1px solid var(--border); display: grid; gap: 4px; }
.task-row .btn { justify-self: start; }
.task-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.task-bar span { display: block; height: 100%; background: var(--accent); }

.inv-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inv-row .input { flex: 1; min-width: 160px; }

.acc-mods { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.acc-mods label { display: inline-flex; gap: 4px; align-items: center; }
