:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --line: #dcdcd8;
  --accent: #3559c7;
  --accent-text: #ffffff;
  --ok-bg: #d8f0dc;
  --ok-text: #11592a;
  --miss-bg: #fbe3d0;
  --miss-text: #8a3c06;
  --chip: #eef1fb;
  --warn: #a33a00;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
header { text-align: center; padding: 16px 16px 4px; }
header h1 { margin: 0 0 4px; font-size: 26px; }
header p { margin: 2px 0; color: var(--muted); }
.version { font-size: 12px; }
main { max-width: 1720px; margin: 0 auto; padding: 8px 16px 40px; }
section, aside { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
/* page: content | history sidebar; top row: equipment view | results | item restrictions. align-items: start = no
   panel is stretched to its neighbour's height (no big empty white area) */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; align-items: start; }
.content { min-width: 0; }
.top { display: grid; grid-template-columns: 252px minmax(0, 1fr) 240px; gap: 12px; align-items: start; }
.hist-side { position: sticky; top: 8px; max-height: calc(100vh - 16px); display: flex; flex-direction: column; min-height: 0; }
.hist-side h2 { font-size: 15px; margin: 0 0 6px; }
@media (max-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .hist-side { position: static; max-height: 520px; }
}
@media (max-width: 1000px) { .top { grid-template-columns: 252px minmax(0, 1fr); } .top .side { grid-column: 1 / -1; } }
@media (max-width: 720px) { .top { grid-template-columns: minmax(0, 1fr); } .equip-grid { max-width: 300px; margin: 0 auto; } }
/* owner: less empty space between the main window and the block below. With three columns the tall item-restriction
   column (.side) left 300-500 px of blank page under the equipment view and the slots; it now spans two rows and the
   options block moves up under the equipment view and the slots. The extra height of .side goes to row 2 (1fr). */
@media (min-width: 1001px) {
  .content { display: grid; grid-template-columns: 252px minmax(0, 1fr) 240px; grid-template-rows: auto 1fr; column-gap: 12px; align-items: start; }
  :root[data-view="duffus"] .content { grid-template-columns: 348px minmax(0, 1fr) 240px; column-gap: 14px; }
  .top { display: contents; }
  .top > .side { grid-column: 3; grid-row: 1 / span 2; }
  .content > .options { grid-column: 1 / 3; grid-row: 2; }
  .content > .stats { grid-column: 1 / -1; }
  .checks .fd-row { grid-column: 1 / -1; } /* narrower options: the Dofus icon row takes a whole line, no overlap */
}

#slot-table { width: 100%; border-collapse: collapse; }
#slot-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
#slot-table td.n { width: 52px; }
#slot-table td.n input { width: 44px; }
#slot-table td.lbl { width: 130px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); border: 1px solid #c9d1ee; border-radius: 6px; padding: 2px 4px 2px 8px; margin: 2px 4px 2px 0; }
.chip button { border: 0; background: transparent; padding: 0 4px; cursor: pointer; font-size: 13px; color: var(--muted); }
.chip button:hover { color: var(--text); }
.chip.set { background: #f4f4f1; border-color: var(--line); padding-right: 8px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.status { flex: 1 1 320px; min-height: 32px; padding: 6px 10px; border-radius: 6px; background: #f0f0ec; }
.status.done { background: var(--ok-bg); color: var(--ok-text); }
.status.busy { background: #e5ebfb; color: #1f3a8a; }
.status.bad { background: var(--miss-bg); color: var(--miss-text); }
button, .button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: #f3f3f0; color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button:disabled { opacity: .5; cursor: default; }
.share { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.share { width: 100%; }
.share-row { display: flex; gap: 6px; width: 100%; min-width: 0; white-space: nowrap; }
.share a#share-link { color: var(--accent); overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }

.side label { display: block; font-weight: 600; margin: 8px 0 4px; }
.side textarea { width: 100%; font: 12px/1.35 ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-radius: 6px; padding: 6px; resize: vertical; }
.add-row { display: flex; gap: 4px; margin-top: 4px; }
.add-row input { flex: 1; min-width: 0; }
.add-row button { padding: 4px 8px; }
.warn { color: var(--warn); font-size: 12px; min-height: 0; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin-top: 12px; }
fieldset label { display: block; font-weight: normal; margin: 3px 0; }

input[type=number], input:not([type]), select { font: inherit; padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--text); }
.options { margin-top: 12px; }
.opt-grid { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.opt-grid input[type=number] { width: 72px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 4px 16px; margin-top: 10px; }
@media (max-width: 500px) { .checks { grid-template-columns: 1fr; } }

.stats { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .stats { grid-template-columns: 1fr; } }
.col { min-width: 0; overflow-x: auto; }
.stat-table { border-collapse: collapse; margin-bottom: 16px; width: 100%; }
.stat-table th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; padding: 2px 3px; }
.stat-table th.match { color: var(--ok-text); }
.stat-table td { padding: 2px 3px; text-align: center; }
.stat-table td.name { text-align: left; font-weight: 600; white-space: nowrap; }
.stat-table input[type=number] { width: 62px; text-align: center; }
.stat-table td.tot { min-width: 56px; font-weight: 700; border-radius: 4px; }
.stat-table td.tot.ok { background: var(--ok-bg); color: var(--ok-text); }
.stat-table td.tot.miss { background: var(--miss-bg); color: var(--miss-text); }
.stat-table .exo-cell { white-space: nowrap; }
[hidden] { display: none !important; }
.res-sums { margin: -6px 0 16px; font-size: 13px; }
.res-sums .rs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6px 0; }
.res-sums .rs-row > label:first-child { font-weight: 600; }
.res-sums .rs-row input[type=number] { width: 62px; text-align: center; }
.res-sums label.el { white-space: nowrap; }
.res-sums .rs-tot { font-weight: 700; color: var(--muted); }
.res-sums .help { color: var(--muted); font-size: 12px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.results { margin-bottom: 10px; }
.results-title { font-weight: 600; margin-bottom: 6px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 6px 10px; background: #f3f3f0; max-width: 100%; }
.tab .tab-info { font-size: 12px; color: var(--muted); }
.tab.on { background: var(--chip); border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.chip.banned { background: var(--miss-bg); border-color: #e3a27a; color: var(--miss-text); text-decoration: line-through; }
.chip.banned button.ban { color: var(--miss-text); text-decoration: none; font-weight: 700; }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hist-head button { padding: 2px 8px; font-size: 12px; }
.hist-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.hist-list li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2px; border-top: 1px solid var(--line); }
.hist-list li.on { background: var(--chip); }
.hist-list .hist-load { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: left; border: 0; background: transparent; padding: 4px 2px; border-radius: 0; }
.hist-list .hist-load strong { font-size: 12px; }
.hist-list .hist-req, .hist-list .hist-info { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.hist-list .hist-del { border: 0; background: transparent; padding: 4px 6px; color: var(--muted); }
.hist-list .hist-del:hover { color: var(--text); }

/* item icons (data/icons/<iconId>.webp) */
.ico { display: inline-block; flex: none; object-fit: contain; }
.ico.sm { width: 22px; height: 22px; margin-right: 2px; }
.ico.lg { width: 46px; height: 46px; }
.ico-none { display: inline-flex; align-items: center; justify-content: center; background: #e9e7df; color: var(--muted); border-radius: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; }

/* equipment view: the game's inventory window (app.js EQUIP_*): left column | character | right column (rings side by
   side), the 6 Dofus / trophies below in 2 columns x 3 rows */
.equip { padding: 10px; }
.equip-grid { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 6px; }
.eq-col { display: flex; flex-direction: column; gap: 6px; }
.eq-right { align-items: center; justify-content: space-between; }
.eq-pair { display: flex; gap: 6px; }
.eq-slot { width: 48px; height: 48px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: #f3f1ea; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.eq-slot .ico.lg { width: 42px; height: 42px; }
.eq-slot.full { background: #fbfaf6; border-color: #cfcabb; }
.eq-slot.diff { border: 2px solid #d9822b; background: #fff4e5; }
.eq-slot.off { opacity: .4; }
.eq-lbl { font-size: 9px; line-height: 1.1; color: var(--muted); text-align: center; padding: 2px; }
.eq-dofus { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 36px); gap: 4px; justify-content: center; margin-top: 4px; }
.eq-dofus .eq-slot { width: 36px; height: 36px; }
.eq-dofus .eq-slot .ico.lg { width: 32px; height: 32px; }
.eq-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; border-radius: 8px; background: linear-gradient(#f7f5ef, #efece3); padding: 8px 4px; }
.eq-who { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
/* the character wearing the stuff (app.js charFigure): Ankama look render, sex switch in the top corner */
.eq-fig { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.eq-char { height: 104px; width: auto; max-width: 100%; aspect-ratio: 1; object-fit: contain; }
.eq-char.emblem { height: 48px; opacity: .85; }
.eq-sex { display: flex; gap: 3px; }
#equip .eq-sex button { font: inherit; font-size: 9px; line-height: 1; padding: 2px 5px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
#equip .eq-sex button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--panel, #fff); }
.site-foot { max-width: 1400px; margin: 8px auto 16px; padding: 0 16px; font-size: 11px; color: var(--muted); }
.site-foot a { color: inherit; }
.eq-stat { font-size: 12px; color: var(--muted); }
.eq-stat strong { font-size: 15px; color: var(--text); }
.eq-stat.pa strong { color: #1f5fd1; }
.eq-stat.pm strong { color: #1d8a3a; }

/* exos: above the items */
.res-exos { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fbfbf9; }
.exo-line { font-size: 15px; font-weight: 700; color: var(--text); }
.exo-line.exo-pa { color: #1f5fd1; }
.exo-line.exo-pm { color: #1d8a3a; }

/* differences with stuff 1 */
.res-delta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 8px; font-size: 12px; }
.res-delta .rd-head { font-weight: 600; margin-right: 2px; }
.res-delta .rd { padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); background: #f3f3f0; white-space: nowrap; }
.res-delta .rd.up { background: var(--ok-bg); color: var(--ok-text); border-color: #b5dcbd; }
.res-delta .rd.down { background: var(--miss-bg); color: var(--miss-text); border-color: #ecc3a5; }
.res-delta .rd.same { color: var(--muted); }
#slot-table .item { padding: 1px 0; }
#slot-table .item + .item { border-top: 1px dashed #ecebe6; }
.item-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.item.diff .chip { border-color: #d9822b; background: #fff4e5; }
.badge-diff { font-size: 11px; font-weight: 700; color: #fff; background: #d9822b; border-radius: 9px; padding: 0 7px; }
.replaces { font-size: 12px; color: var(--muted); }

/* alternatives under an item (opened by a click on the item; no label) */
details.alts { margin: 0 0 2px 4px; font-size: 12px; }
details.alts summary { display: none; }
.chip.alt-open { cursor: pointer; }
.chip.no-alt { cursor: default; }
details.alts summary { cursor: pointer; color: var(--muted); width: max-content; list-style-position: inside; }
details.alts summary:hover { color: var(--text); }
.alt-list { display: flex; flex-direction: column; gap: 2px; margin: 3px 0 4px 12px; }
.alt { display: flex; align-items: center; gap: 6px; text-align: left; padding: 2px 8px 2px 4px; font-size: 12px; background: #fafaf8; max-width: 100%; }
.alt:hover { background: var(--chip); border-color: #c9d1ee; }
.alt-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.alt-lvl { color: var(--muted); white-space: nowrap; }
.alt-delta { white-space: nowrap; margin-left: auto; padding-left: 8px; }
.alt-delta.up { color: var(--ok-text); }
.alt-delta.down { color: var(--miss-text); }
.alt-msg { color: var(--muted); font-style: italic; }
.chip .ico.sm { margin-left: -5px; }
.item .chip.banned { background: var(--miss-bg); border-color: #e3a27a; }
.res-spell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 8px; font-size: 13px; }
.res-spell .rs-line { font-weight: 600; }
.res-spell .rd { padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); background: #f3f3f0; white-space: nowrap; font-size: 12px; }
.res-spell .rd.up { background: var(--ok-bg); color: var(--ok-text); border-color: #b5dcbd; }
.res-spell .rd.down { background: var(--miss-bg); color: var(--miss-text); border-color: #ecc3a5; }
.res-spell .rd.same { color: var(--muted); }

/* text list: rings side by side, dofus in 2 columns x 3 rows (owner 2026-10-16) */
#res_ring, #res_dofus { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 4px 14px; align-content: start; }
#slot-table #res_ring .item + .item, #slot-table #res_dofus .item + .item { border-top: 0; }

/* history: the stuff's icons (equipment | Dofus / trophies), at most 2 lines */
.hist-list .hist-icons { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; margin: 2px 0 1px; max-height: 42px; overflow: hidden; }
.ico.xs { width: 19px; height: 19px; font-size: 7px; }
.hist-sep { width: 1px; height: 16px; background: var(--muted); opacity: .5; margin: 0 3px; flex: none; }
/* "Sort à maximiser" picker */
.spell-field { display: inline-flex; align-items: center; gap: 6px; }
.spell-pick { position: relative; display: inline-block; }
.sp-opt { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sp-opt input[type=number] { width: 3.5em; }
.spell-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 190px; max-width: 280px; padding: 2px 6px; text-align: left; font: inherit; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--text); }
.spell-btn .sp-cur { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spell-btn .sp-caret { color: var(--muted); font-size: 11px; }
.sp-ico { width: 22px; height: 22px; flex: none; border-radius: 4px; display: inline-block; }
.sp-ico-none { background: #e9e7df; }
.sp-pop { position: absolute; z-index: 30; top: calc(100% + 3px); left: 0; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.15); padding: 6px; }
.sp-pop input { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.sp-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.sp-list li { display: flex; align-items: center; gap: 7px; padding: 3px 5px; border-radius: 4px; cursor: pointer; }
.sp-list li[aria-selected=true] { font-weight: 600; }
.sp-list li.act { background: var(--chip); }
.sp-list li.sp-empty { color: var(--muted); cursor: default; }
/* "Éléments à favoriser": toggle chips, element colour when on */
.res-sums .fav-lbl { font-weight: 600; cursor: help; }
.fav-chip { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 13px; padding: 2px 10px 2px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--el); font-weight: 600; cursor: pointer; }
.fav-chip:hover { border-color: var(--el); }
.fav-chip[aria-pressed=true] { background: var(--el); border-color: var(--el); color: #fff; }
.fav-chip .fav-ico { width: 18px; height: 18px; }
/* "Avancé" (Graine, Résultats, Temps max) under "Limites d'objets", closed by default */
details.advanced { border: 1px solid var(--line); border-radius: 6px; margin-top: 12px; padding: 4px 10px; }
details.advanced summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
.side .adv-grid label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: normal; margin: 6px 0; }
.adv-grid input[type=number] { width: 72px; }

/* history: Dofus group never split; request/totals folded */
.hist-dofus { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: inherit; white-space: nowrap; }
details.hist-more { flex: 1 0 100%; margin: 0 0 4px 8px; font-size: 11px; }
details.hist-more summary { cursor: pointer; color: var(--muted); width: max-content; }
details.hist-more .hist-req, details.hist-more .hist-info { display: block; }

/* ---------- dark mode (system default, or the header switch: html[data-theme]) ---------- */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark;
  --bg: #17181b; --panel: #222327; --text: #e8e8ea; --muted: #a0a0a8; --line: #3a3b41; --accent: #6f8ff0; --accent-text: #0e1220;
  --ok-bg: #1d3a26; --ok-text: #9fe0b0; --miss-bg: #47271a; --miss-text: #f2b48e; --chip: #2a3150; --warn: #ff9a6a;
  --surf: #2b2c31; --surf2: #303137; } }
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #17181b; --panel: #222327; --text: #e8e8ea; --muted: #a0a0a8; --line: #3a3b41; --accent: #6f8ff0; --accent-text: #0e1220;
  --ok-bg: #1d3a26; --ok-text: #9fe0b0; --miss-bg: #47271a; --miss-text: #f2b48e; --chip: #2a3150; --warn: #ff9a6a;
  --surf: #2b2c31; --surf2: #303137; }
:root { --surf: #f3f3f0; --surf2: #fbfaf6; }
:root[data-theme="dark"] .chip, :root[data-theme="dark"] .alt:hover { border-color: #46507a; }
:root[data-theme="dark"] .chip.set, :root[data-theme="dark"] .status, :root[data-theme="dark"] button, :root[data-theme="dark"] .button,
:root[data-theme="dark"] .tab, :root[data-theme="dark"] .ico-none, :root[data-theme="dark"] .eq-slot, :root[data-theme="dark"] .res-delta .rd,
:root[data-theme="dark"] .res-spell .rd, :root[data-theme="dark"] .alt, :root[data-theme="dark"] .sp-ico-none,
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: var(--surf); color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] .eq-slot.full, :root[data-theme="dark"] .sp-pop { background: var(--surf2); border-color: #4a4b52; }
:root[data-theme="dark"] .eq-mid { background: linear-gradient(#2a2b30, #232428); }
:root[data-theme="dark"] .status.busy { background: #1f2a4a; color: #b9c8ff; }
:root[data-theme="dark"] .eq-slot.diff, :root[data-theme="dark"] .item.diff .chip { background: #3d2a14; }
:root[data-theme="dark"] #slot-table .item + .item { border-top-color: var(--line); }
:root[data-theme="dark"] .eq-stat.pa strong, :root[data-theme="dark"] .exo-line.exo-pa { color: #7aa5ff; }
:root[data-theme="dark"] .eq-stat.pm strong, :root[data-theme="dark"] .exo-line.exo-pm { color: #6ad38a; }
:root[data-theme="dark"] button.primary, :root[data-theme="dark"] #launch { background: var(--accent); color: var(--accent-text); }
.theme-toggle { position: absolute; top: 12px; right: 16px; padding: 4px 10px; font-size: 13px; }
header { position: relative; }
/* text list Dofus: 3 columns x 2 rows (owner 2026-10-16) */
#res_dofus { grid-template-columns: repeat(3, minmax(0, max-content)); }

/* element chips must show their state in both themes (the dark button rule was winning) */
:root .fav-chip { background: var(--panel); color: var(--el); border-color: var(--line); }
:root .fav-chip[aria-pressed=true] { background: var(--el); border-color: var(--el); color: #fff; }

.hover-card { position: absolute; z-index: 50; max-width: 300px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.18); font-size: 12px; line-height: 1.45; pointer-events: none; }
.hover-card strong { display: block; font-size: 13px; margin-bottom: 3px; }
.hover-card div { white-space: pre-line; }
.share-buttons { display: flex; justify-content: center; align-self: stretch; } /* the .share column aligns its rows left; this row spans it so the button sits in the middle */
.res-spell .sp-ico { width: 28px; height: 28px; flex: none; }
:root[data-theme="dark"] .res-exos { background: var(--surf2); border-color: var(--line); }

/* variations line (replaces the big result tabs) */
.variants { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; margin-bottom: 6px; }
.variants .var-lab { color: var(--muted); }
.variants .var { padding: 2px 8px; font-size: 12px; border-radius: 12px; }
.variants .var.on { background: var(--chip); border-color: var(--accent); }
/* rings / dofus columns share the cell width (no overflow out of the results panel) */
#res_ring { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#res_dofus { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#res_ring .chip, #res_dofus .chip { max-width: 100%; min-width: 0; }
#res_ring .item, #res_dofus .item { min-width: 0; }

.hover-card .hc-sub { color: var(--muted); font-size: 11px; margin: 0 0 4px; }
.hover-card .hc-row { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.hover-card .hc-ic { width: 16px; height: 16px; flex: none; }
.hover-card .hc-v { font-weight: 700; min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.hover-card .hc-v.neg { color: var(--miss-text); }
.crit-mode { margin-left: 10px; font-size: 13px; }

/* ring 2 lines up with the 2nd Dofus column (same 3-column grid) */
#res_ring { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* spell picker: 2 columns = spell | its variant, in acquisition order */
#spell-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 6px; }
#spell-list .sp-none, #spell-list .sp-empty { grid-column: 1 / -1; }
#spell-list .sp-group { grid-column: 1 / -1; font-size: 12px; font-weight: 600; opacity: .75; padding: 6px 6px 2px; cursor: default; }
#spell-list .sp-off { opacity: .4; cursor: default; display: flex; align-items: center; gap: 6px; padding: 3px 6px; font-size: 13px; }
.sp-pop { width: 460px !important; }

select.has-icon { background-repeat: no-repeat; background-position: 5px center; background-size: 20px; padding-left: 30px; }

.cls-pick { position: relative; display: inline-block; }
.cls-btn { min-width: 150px; }
.cls-pop { width: 420px; }
.cls-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px 4px; max-height: none; }
.heal-chip { margin-left: 10px; }
:root[data-theme="dark"] .spell-btn, :root[data-theme="dark"] .sp-pop { background: var(--surf2); color: var(--text); }
/* columns size to their content and wrap a name only when the panel is really too narrow (owner 2026-10-16) */
#res_ring, #res_dofus { grid-template-columns: repeat(3, auto); justify-content: start; }
/* crit mode label: small icon on the text line (the owner: icon was too big / too high) */
.crit-mode { display: inline-flex; align-items: center; gap: 4px; }
.crit-mode .fav-ico { width: 16px; height: 16px; }

#go.stop { background: #c92a2a; border-color: #c92a2a; color: #fff; }
/* item icons from the sprite sheets (data/icon_sheets, ui/app.js iconEl): span + background; neutral box until the sheet loads */
.ico.ico-sp { background-repeat: no-repeat; }
.ico.ico-wait { background-color: #e9e7df; border-radius: 4px; }
:root[data-theme="dark"] .ico.ico-wait { background-color: var(--surf); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico.ico-wait { background-color: var(--surf); } }

.fd-row .fd-lab { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; }
#prove:disabled { opacity: .5; cursor: not-allowed; }

.res-spell .rs-heal { flex-basis: 100%; display: flex; align-items: center; gap: 6px; color: #2b8a3e; padding-left: 34px; }
:root[data-theme="dark"] .res-spell .rs-heal { color: #6ad38a; }
#res-spell .rs-wheal strong { color: #2b8a3e; } :root[data-theme="dark"] #res-spell .rs-wheal strong { color: #6ad38a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #res-spell .rs-wheal strong { color: #6ad38a; } }
.wp-heal { width: 14px; height: 14px; flex: none; margin-left: 4px; vertical-align: middle; }
.fd-row { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 4px; white-space: nowrap; }

.stat-table td.name { white-space: nowrap; }
.stat-table .st-ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }

/* tighter Dofus bonus toggles (no overflow) */
.fd-row { gap: 2px; font-size: 13px; }
.fd-row .fd-lab { margin-right: 1px; gap: 0; }
.fd-row .fd-lab input { margin: 0 1px 0 0; }

/* ---------- header switches: "Affichage Duffus" | theme ---------- */
.head-toggles { position: absolute; top: 12px; right: 16px; display: flex; gap: 6px; }
.head-toggles .theme-toggle { position: static; }
.duffus-toggle { padding: 4px 10px; font-size: 13px; }
.duffus-toggle[aria-pressed="true"] { background: var(--chip); border-color: var(--accent); color: var(--text); }
@media (max-width: 720px) { .head-toggles { position: static; justify-content: flex-end; margin: -6px 0 8px; } }

/* ---------- results bar: "Principal" | "Variations" (one joined pair), then one line per other stuff ---------- */
.var-modes { display: inline-flex; margin-right: 4px; }
.variants .var-mode { border-radius: 0; padding: 3px 12px; font-weight: 600; }
.variants .var-mode:first-child { border-radius: 12px 0 0 12px; }
.variants .var-mode:last-child { border-radius: 0 12px 12px 0; margin-left: -1px; }

/* ---------- "Variations" view: thumbnail of another stuff's item in the slot's bottom-right corner (app.js renderVarThumbs) */
#equip .eq-slot { position: relative; overflow: visible; }
#equip .eq-vars { position: absolute; right: -7px; bottom: -7px; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 2px; z-index: 2; }
#equip .eq-var { width: 24px; height: 24px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 7px;
  background: #e9e7df; border: 1px solid #b9b4a6; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); cursor: pointer; }
#equip .eq-var:hover, #equip .eq-var:focus-visible { border-color: var(--accent); outline: none; transform: scale(1.08); }
#equip .eq-var .ico { width: 20px; height: 20px; }
#equip .eq-var .ico-none { font-size: 9px; }
#equip .eq-swap { position: absolute; right: 3px; bottom: calc(100% - 3px); background: #fff; color: #222; font-size: 9px; line-height: 11px;
  padding: 0 4px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); pointer-events: none; }
#equip .eq-dofus .eq-var { width: 20px; height: 20px; border-radius: 6px; }
#equip .eq-dofus .eq-var .ico { width: 16px; height: 16px; }
:root[data-theme="dark"] #equip .eq-var { background: #595a56; border-color: #6d6e69; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #equip .eq-var { background: #595a56; border-color: #6d6e69; } }

/* ---------- "Affichage Duffus" (test display mode, html[data-view=duffus], owner 2026-10-16): the equipment card in
   the look of the Duffus builder: dark card on a dotted background, big icons in rounded squares, stat bubbles.
   Own CSS; dark in both themes (the page tokens are redefined inside the card). */
:root[data-view="duffus"] .top { grid-template-columns: 348px minmax(0, 1fr) 240px; }
@media (max-width: 1000px) { :root[data-view="duffus"] .top { grid-template-columns: 348px minmax(0, 1fr); } }
@media (max-width: 720px) { :root[data-view="duffus"] .top { grid-template-columns: minmax(0, 1fr); } }
:root[data-view="duffus"] section.equip {
  --panel: #262724; --text: #fff; --muted: #a6a89f; --line: rgba(255, 255, 255, .08); --chip: rgba(181, 224, 106, .14); --accent: #b5e06a;
  --surf: #2c2d2a; --surf2: #31322f;
  color-scheme: dark; color: #fff; padding: 16px; border: 1px solid #30312d; border-radius: 20px;
  background-color: #1c1d1a; background-image: radial-gradient(rgba(255, 255, 255, .075) 1px, transparent 1.4px); background-size: 16px 16px;
  font-family: Barlow, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root[data-view="duffus"] #equip { grid-template-columns: 58px minmax(0, 1fr) 58px; gap: 10px; max-width: 348px; margin: 0 auto; }
:root[data-view="duffus"] #equip .eq-col { gap: 10px; }
:root[data-view="duffus"] #equip .eq-slot { width: 58px; height: 58px; border-radius: 14px; background: #2b2c29; border: 1px solid rgba(255, 255, 255, .05); }
:root[data-view="duffus"] #equip .eq-slot.full { background: #30312e; border-color: rgba(255, 255, 255, .07); }
:root[data-view="duffus"] #equip .eq-slot.diff { border: 2px solid #e0913a; background: #3a2d1b; }
:root[data-view="duffus"] #equip .eq-slot .ico.lg { width: 50px; height: 50px; }
:root[data-view="duffus"] #equip .eq-lbl { color: #7f8179; font-size: 10px; }
:root[data-view="duffus"] #equip .eq-dofus { grid-template-columns: repeat(6, minmax(0, 46px)); gap: 7px; margin-top: 6px; }
:root[data-view="duffus"] #equip .eq-dofus .eq-slot { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; }
:root[data-view="duffus"] #equip .eq-dofus .eq-slot .ico.lg { width: 84%; height: 84%; }
:root[data-view="duffus"] #equip .eq-mid { background: radial-gradient(ellipse at 50% 60%, rgba(255, 255, 255, .07), transparent 70%); border-radius: 16px; gap: 6px; }
:root[data-view="duffus"] #equip .eq-who { color: #fff; font-weight: 600; font-size: 15px; }
:root[data-view="duffus"] #equip .eq-fig { height: 150px; margin-bottom: -4px; justify-content: flex-end; }
:root[data-view="duffus"] #equip .eq-char { height: 100%; }
:root[data-view="duffus"] #equip .eq-char.emblem { height: 56px; margin: auto 0; }
:root[data-view="duffus"] #equip .eq-sex { position: absolute; top: 0; right: 0; flex-direction: column; gap: 2px; }
:root[data-view="duffus"] #equip .eq-sex button { font-size: 10px; padding: 3px 7px; background: rgba(255, 255, 255, .06); border-color: transparent; color: #a6a89f; }
:root[data-view="duffus"] #equip .eq-sex button[aria-pressed="true"] { background: rgba(181, 224, 106, .18); color: #fff; }
:root[data-view="duffus"] #equip .eq-stat { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: #c9cbc3; font-size: 12px; }
:root[data-view="duffus"] #equip .eq-who + .eq-stat { background: rgba(255, 92, 92, .14); }
:root[data-view="duffus"] #equip .eq-stat.pa { background: rgba(90, 160, 255, .13); }
:root[data-view="duffus"] #equip .eq-stat.pm { background: rgba(90, 200, 120, .13); }
:root[data-view="duffus"] #equip .eq-stat strong { color: #fff; font-size: 17px; font-weight: 700; }
:root[data-view="duffus"] #equip .eq-stat.pa strong { color: #8db4ff; }
:root[data-view="duffus"] #equip .eq-stat.pm strong { color: #79dc95; }
:root[data-view="duffus"] #equip .eq-var { width: 30px; height: 30px; border-radius: 10px; background: #595a56; border: 1px solid rgba(255, 255, 255, .14); }
:root[data-view="duffus"] #equip .eq-var .ico { width: 25px; height: 25px; }
:root[data-view="duffus"] #equip .eq-dofus .eq-var { width: 24px; height: 24px; border-radius: 8px; }
:root[data-view="duffus"] #equip .eq-dofus .eq-var .ico { width: 19px; height: 19px; }
:root[data-view="duffus"] section.equip .stuff-summary .ss-card { background: #262724; border-color: transparent; border-radius: 16px; }
@media (max-width: 720px) {
  :root[data-view="duffus"] #equip { grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 8px; }
  :root[data-view="duffus"] #equip .eq-slot { width: 56px; height: 56px; }
  :root[data-view="duffus"] #equip .eq-slot .ico.lg { width: 48px; height: 48px; }
}
/* Dofus in 3 columns: a long name is cut (…), never wrapped (owner 2026-10-16); the hover card shows the full name */
#res_dofus { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#res_dofus .item, #res_dofus .chip { min-width: 0; max-width: 100%; }
#res_dofus .chip { display: inline-flex; align-items: center; overflow: hidden; }
#res_dofus .chip > :not(.chip-nm) { flex: none; }
#res_dofus .chip-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* narrow Dofus columns: the Forcer / Interdire buttons show on hover or focus, so the name keeps the room */
#res_dofus .chip > button { display: none; }
#res_dofus .chip:hover > button, #res_dofus .chip:focus-within > button, #res_dofus .chip.banned > button.ban { display: inline-flex; }
/* hover cards: icon header (items and spells), spell card sections like the game's spell card (owner 2026-10-16) */
.hover-card .hc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hover-card .hc-head > span { display: flex; flex-direction: column; min-width: 0; }
.hover-card .hc-head strong { margin-bottom: 1px; }
.hover-card .hc-head .hc-sub { margin: 0; }
.hover-card .hc-head .ico.lg, .hover-card .hc-spic { width: 44px; height: 44px; flex: none; border-radius: 8px; }
.hover-card .hc-top { display: flex; gap: 10px; font-weight: 600; font-size: 12px; }
.hover-card .hc-chip { display: inline-flex; align-items: center; gap: 3px; }
.hover-card .hc-sec { margin: 6px 0 2px; padding-top: 5px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: normal; }
.hover-card .hc-eff { white-space: normal; flex-wrap: wrap; }
.hover-card .hc-eff .hc-v { min-width: 0; }
.hover-card .hc-tag { color: var(--muted); font-size: 11px; margin-left: 4px; }
.hover-card .hc-lim { margin-top: 6px; }
.hover-card .hc-note { color: var(--miss-text); font-size: 11px; }
.hover-card .hc-desc { margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-style: italic; }
.hover-card { z-index: 60; }
/* item search list of Objets interdits / forcés (site list with icons and hover cards) */
.it-pick { position: relative; flex: 1; min-width: 0; display: flex; }
.it-pick input { flex: 1; min-width: 0; }
.it-pop { width: 100% !important; min-width: 260px; max-height: 320px; overflow-y: auto; list-style: none; margin: 0; }
.it-pop li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.it-pop li .ico.sm { width: 24px; height: 24px; flex: none; }
.it-pop li .it-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.it-pop li .it-lv { color: var(--muted); font-size: 11px; flex: none; }
.it-pop li:hover, .it-pop li.active { background: var(--surf2, rgba(127,127,127,.15)); }
/* Enchaînement: one row per spell (owner 2026-10-16) */
.chain-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chain-wrap .ch-row { display: inline-flex; align-items: center; gap: 4px; }
.chain-wrap .ch-row select { max-width: 200px; }
.chain-wrap .ch-row input { width: 48px; }
.chain-wrap button { padding: 2px 8px; }
/* Enchaînement on its own line, spell icons in each row (owner 2026-10-16) */
.chain-wrap:not([hidden]) { display: flex; flex-basis: 100%; width: 100%; white-space: normal; margin-top: 4px; }
.chain-wrap .ch-pick { position: relative; display: inline-block; }
.chain-wrap .ch-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 170px; }
.chain-wrap .ch-btn .sp-ico, .chain-wrap .ch-pop .sp-ico { width: 24px; height: 24px; }
.chain-wrap .ch-pop { width: 260px !important; max-height: 340px; overflow-y: auto; list-style: none; margin: 0; }
.chain-wrap .ch-pop li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.chain-wrap .ch-pop li:hover, .chain-wrap .ch-pop li.active { background: var(--surf2, rgba(127,127,127,.15)); }
/* "Build exo": rune badge on an item square (top left) and on a Variations thumbnail; rune tag on a text-list chip */
#equip .eq-exo { position: absolute; left: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: #6b3fa0; color: #fff;
  border: 1px solid #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; line-height: 1; z-index: 2; pointer-events: none; }
#equip .eq-exo img { width: 13px; height: 13px; }
#equip .eq-var { position: relative; }
#equip .eq-var .eq-exo { left: -5px; top: -5px; width: 12px; height: 12px; font-size: 9px; }
#equip .eq-var .eq-exo img { width: 9px; height: 9px; }
.chip-exo { font-size: 11px; font-weight: 600; color: #6b3fa0; background: #f1eaf9; border: 1px solid #d6c5ec; border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.hover-card .hc-exo { color: #6b3fa0; font-weight: 600; }
.bexo-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.bexo-row input[type="number"] { width: 4.5em; }
.bexo-adv { flex-basis: 100%; }
.bexo-adv > summary { cursor: pointer; }
.bexo-grp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 4px 0 0 12px; }
.bexo-ov > summary { cursor: pointer; font-size: 0.9em; }
.bexo-ov label { margin-right: 8px; white-space: nowrap; }
:root[data-theme="dark"] .chip-exo { color: #c9a8f2; background: #2e2340; border-color: #4f3d6e; }
:root[data-theme="dark"] .hover-card .hc-exo { color: #c9a8f2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-exo { color: #c9a8f2; background: #2e2340; border-color: #4f3d6e; }
  :root:not([data-theme="light"]) .hover-card .hc-exo { color: #c9a8f2; } }
.rs-vico { vertical-align: -3px; margin-right: 4px; }
/* "Corps à corps" (owner 2026-10-16): the weapon chooser under the spell picker (item search + chosen weapon chip) */
.weapon-wrap:not([hidden]) { display: flex; flex-basis: 100%; width: 100%; white-space: normal; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.weapon-wrap .it-pick { flex: 0 1 260px; }
.weapon-wrap .wp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; border: 1px solid var(--line, #d8d4c8); border-radius: 6px; }
.weapon-wrap .wp-chip .ico { width: 24px; height: 24px; }
.weapon-wrap .wp-chip .it-lv { color: var(--muted); font-size: 11px; }
.weapon-wrap .wp-chip button { padding: 0 6px; line-height: 1.4; }
/* weapon groups (owner 2026-10-16): the game's stat icon for Meilleure arme / distance / mêlée; forgemagie checkbox */
img.wp-sico { width: 20px; height: 20px; object-fit: contain; }
.weapon-wrap .wp-chip img.wp-sico { width: 24px; height: 24px; }
.weapon-wrap .wfm { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* variations always shown (owner 2026-10-16): the swap pill sits on each thumbnail; Stuff lines with item icons + stat gains / losses */
#equip .eq-var { position: relative; overflow: visible; }
#equip .eq-var .eq-swap { position: absolute; left: 50%; right: auto; transform: translateX(-50%); bottom: calc(100% - 4px); pointer-events: none; }
#results .variants { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
#results .var-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; text-align: left; }
#results .var-ics { display: inline-flex; gap: 2px; }
#results .var-ics .ico.sm { width: 22px; height: 22px; }
#results .var-ics.rem { opacity: .7; }
#results .var-up { color: var(--ok-text, #2e8b57); font-size: 12px; }
#results .var-down { color: var(--miss-text, #c0392b); font-size: 12px; }
#results .variants .var-line { flex-direction: row; justify-content: flex-start; width: auto; max-width: 100%; white-space: normal; line-height: 1.3; }
#results .variants .var-line > * { flex: none; }
#results .variants .var-line .var-up, #results .variants .var-line .var-down { flex: 0 1 auto; }
/* enchaînement list: spell | variant on one row, like the main picker */
.chain-wrap .ch-pop { width: 440px !important; }
.chain-wrap .ch-pop li.ch-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 1px 2px; cursor: default; }
.chain-wrap .ch-pop li.ch-pair:hover { background: none; }
.chain-wrap .ch-cell { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chain-wrap .ch-cell:hover, .chain-wrap .ch-cell.active { background: var(--surf2, rgba(127,127,127,.15)); }
.chain-wrap .ch-cell.sp-off { opacity: .45; cursor: default; }
/* history folders by class (owner 2026-10-16) */
.hist-list .hist-group { list-style: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 0 2px; padding: 0; border: 0; background: none; }
.hist-list .hist-folder { list-style: none; padding: 0; border: 0; background: none; }
.hist-folder > details > summary { cursor: pointer; font-weight: 700; padding: 6px 4px; display: flex; align-items: center; gap: 6px; }
.hist-folder .hist-cls { width: 20px; height: 20px; }
.hist-inner { padding-left: 6px; margin: 0; }
.new-version { position: fixed; z-index: 100; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #fff; border: 0; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.3); cursor: pointer; }
/* results bar: crown on Stuff 1, stat icons, damage gap (owner 2026-10-16) */
#results .crown { color: #d4a017; margin-right: 2px; }
#results .var-line .fav-ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
#results .var-ics .ico-empty { display: inline-block; width: 22px; height: 22px; border: 1px dashed var(--line); border-radius: 4px; }
#results .var-dmg { font-weight: 700; }
/* key settings line under the spell picker: Équilibré and Marge de l'Idéal, put forward (owner 2026-10-16) */
.key-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--chip, rgba(80,120,255,.08)); font-weight: 600; }
.key-row label, .key-row .sp-opt { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.key-row input[type=number] { width: 4em; }
#results .var-main { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#res_dofus .chip > button.perm, .chip > button.perm { font-size: 10px; }
.opt-grid > .key-row { flex-basis: 100%; }

/* ---------- "Affichage Duffus" for the WHOLE page (owner 2026-10-16): dark rounded cards on a dotted background,
   Barlow, lime accent, pill buttons. Everything under :root[data-view="duffus"], so the light and dark themes are
   unchanged when the switch is off. Own CSS, colours read from the look of the Duffus builder preview. */
:root[data-view="duffus"] {
  color-scheme: dark;
  --bg: #1b1c1b; --panel: #2a2b28; --text: #f2f3ee; --muted: #a3a59c; --line: rgba(255, 255, 255, .08);
  --accent: #b7dc69; --accent-text: #1b1c1b; --chip: rgba(183, 220, 105, .14); --warn: #ffb36b;
  --ok-bg: rgba(183, 220, 105, .15); --ok-text: #c9ea8e; --miss-bg: rgba(255, 110, 90, .16); --miss-text: #ff9c88;
  --surf: #20211f; --surf2: #33342f;
  --dx-card2: #232422; --dx-btn: #383934; --dx-btn-h: #44453f; --dx-lime2: #9cba5d; --dx-edge: rgba(255, 255, 255, .05);
}
:root[data-view="duffus"] body {
  background-color: var(--bg); color: var(--text);
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.4px); background-size: 18px 18px;
  font-family: Barlow, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14.5px;
}
:root[data-view="duffus"] header { padding-top: 22px; }
:root[data-view="duffus"] header h1 { color: #fff; font-size: 30px; font-weight: 700; letter-spacing: .01em; }
:root[data-view="duffus"] header p { color: var(--muted); }
/* cards */
:root[data-view="duffus"] section, :root[data-view="duffus"] aside {
  background: var(--panel); border: 1px solid var(--dx-edge); border-radius: 20px; padding: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
:root[data-view="duffus"] .hist-side { background: var(--dx-card2); }
:root[data-view="duffus"] .layout, :root[data-view="duffus"] .top { gap: 14px; }
:root[data-view="duffus"] .options, :root[data-view="duffus"] .stats { margin-top: 14px; }
/* small lime caps titles (like the builder's card titles) */
:root[data-view="duffus"] .hist-side h2, :root[data-view="duffus"] fieldset legend, :root[data-view="duffus"] .side > label,
:root[data-view="duffus"] details.advanced summary, :root[data-view="duffus"] .results-title {
  color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
:root[data-view="duffus"] .side > label { color: var(--dx-lime2); line-height: 1.35; margin: 12px 0 6px; }
:root[data-view="duffus"] .side > label:first-child { margin-top: 2px; }
:root[data-view="duffus"] fieldset legend { padding: 0 6px; }
:root[data-view="duffus"] fieldset, :root[data-view="duffus"] details.advanced { border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, .12); }
:root[data-view="duffus"] details.advanced { padding: 6px 12px; }
/* fields */
:root[data-view="duffus"] input, :root[data-view="duffus"] select, :root[data-view="duffus"] textarea, :root[data-view="duffus"] .spell-btn {
  background-color: var(--surf); color: var(--text); border: 1px solid rgba(255, 255, 255, .07); border-radius: 9px; font-family: inherit; }
:root[data-view="duffus"] input[type=number], :root[data-view="duffus"] input:not([type]), :root[data-view="duffus"] input[type=search], :root[data-view="duffus"] select { padding: 4px 7px; }
:root[data-view="duffus"] select.has-icon { padding-left: 30px; }
:root[data-view="duffus"] .spell-btn { padding: 3px 8px; }
:root[data-view="duffus"] input::placeholder, :root[data-view="duffus"] textarea::placeholder { color: #75776f; }
:root[data-view="duffus"] input:focus, :root[data-view="duffus"] select:focus, :root[data-view="duffus"] textarea:focus, :root[data-view="duffus"] .spell-btn:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(183, 220, 105, .22); }
:root[data-view="duffus"] input[type=checkbox], :root[data-view="duffus"] input[type=radio] { accent-color: var(--accent); }
:root[data-view="duffus"] .side textarea { background: var(--surf); border-radius: 12px; padding: 8px; }
/* buttons: pills */
:root[data-view="duffus"] button, :root[data-view="duffus"] .button {
  background: var(--dx-btn); color: var(--text); border: 1px solid transparent; border-radius: 999px; font-family: inherit; font-weight: 600; padding: 6px 16px; }
:root[data-view="duffus"] button:hover:not(:disabled), :root[data-view="duffus"] .button:hover { background: var(--dx-btn-h); }
:root[data-view="duffus"] button.primary, :root[data-view="duffus"] .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
:root[data-view="duffus"] button.primary:hover:not(:disabled), :root[data-view="duffus"] .button.primary:hover { background: #c6e683; }
:root[data-view="duffus"] .duffus-toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
:root[data-view="duffus"] .head-toggles button { padding: 5px 14px; }
:root[data-view="duffus"] .add-row button { padding: 4px 12px; }
:root[data-view="duffus"] .new-version { color: var(--accent-text); }
/* buttons that are not pills (they keep their own shape) */
:root[data-view="duffus"] .chip button { background: transparent; border: 0; border-radius: 6px; padding: 0 4px; color: var(--muted); font-weight: 400; }
:root[data-view="duffus"] .chip button:hover:not(:disabled) { background: transparent; color: #fff; }
:root[data-view="duffus"] .hist-list .hist-load { background: transparent; border: 0; border-radius: 10px; padding: 6px 6px; font-weight: 400; }
:root[data-view="duffus"] .hist-list .hist-load:hover { background: rgba(255, 255, 255, .04); }
:root[data-view="duffus"] .hist-list .hist-del { background: transparent; border: 0; padding: 4px 8px; color: var(--muted); font-weight: 400; }
:root[data-view="duffus"] .hist-list .hist-del:hover:not(:disabled) { background: transparent; color: #fff; }
:root[data-view="duffus"] .fav-chip { background: var(--surf); color: var(--el); border: 1px solid rgba(255, 255, 255, .08); padding: 3px 12px 3px 7px; }
:root[data-view="duffus"] .fav-chip:hover:not(:disabled) { background: var(--surf); border-color: var(--el); }
:root[data-view="duffus"] .fav-chip[aria-pressed=true], :root[data-view="duffus"] .fav-chip[aria-pressed=true]:hover:not(:disabled) { background: var(--el); border-color: var(--el); color: #fff; }
:root[data-view="duffus"] .alt { background: #2f302c; border-radius: 10px; font-weight: 400; padding: 3px 10px 3px 4px; }
:root[data-view="duffus"] .alt:hover:not(:disabled) { background: var(--dx-btn-h); }
/* results bar: Principal / Stuff lines */
:root[data-view="duffus"] .variants .var, :root[data-view="duffus"] .tab { background: var(--surf); border: 1px solid transparent; color: var(--text); border-radius: 14px; font-weight: 500; box-shadow: none; }
:root[data-view="duffus"] .variants .var-main { border-radius: 999px; padding: 3px 14px; font-weight: 700; }
:root[data-view="duffus"] .variants .var.on, :root[data-view="duffus"] .tab.on { background: #fff; color: #1b1c1b; border-color: #fff; box-shadow: none; }
:root[data-view="duffus"] .variants .var.on .var-up { color: #2f7a1f; }
:root[data-view="duffus"] .variants .var.on .var-down { color: #b8361f; }
:root[data-view="duffus"] .variants .var-lab, :root[data-view="duffus"] .tab .tab-info { color: var(--muted); }
:root[data-view="duffus"] #results .var-up { color: #a9dd6e; }
:root[data-view="duffus"] #results .var-down { color: #ff8f7a; }
:root[data-view="duffus"] .res-delta .rd, :root[data-view="duffus"] .res-spell .rd { background: var(--surf); border-color: transparent; border-radius: 999px; padding: 2px 9px; }
:root[data-view="duffus"] .res-delta .rd.up, :root[data-view="duffus"] .res-spell .rd.up { background: var(--ok-bg); color: var(--ok-text); }
:root[data-view="duffus"] .res-delta .rd.down, :root[data-view="duffus"] .res-spell .rd.down { background: var(--miss-bg); color: var(--miss-text); }
:root[data-view="duffus"] .res-spell { background: var(--surf); border-radius: 14px; padding: 8px 12px; }
:root[data-view="duffus"] .res-spell .rs-line { color: #fff; }
:root[data-view="duffus"] .res-spell .rs-heal { color: #79dc95; } :root[data-view="duffus"] #res-spell .rs-wheal strong { color: #79dc95; }
:root[data-view="duffus"] .res-exos { background: var(--surf); border: 0; border-radius: 14px; }
:root[data-view="duffus"] .exo-line.exo-pa { color: #8db4ff; }
:root[data-view="duffus"] .exo-line.exo-pm { color: #79dc95; }
/* status line */
:root[data-view="duffus"] .status { background: var(--surf); color: var(--text); border-radius: 14px; padding: 8px 12px; }
:root[data-view="duffus"] .status.done { background: var(--ok-bg); color: var(--ok-text); }
:root[data-view="duffus"] .status.busy { background: rgba(120, 160, 255, .14); color: #b9cbff; }
:root[data-view="duffus"] .status.bad { background: var(--miss-bg); color: var(--miss-text); }
:root[data-view="duffus"] .share a#share-link { color: var(--accent); }
/* item list table */
:root[data-view="duffus"] #slot-table td { border-bottom-color: var(--line); padding: 6px 6px; }
:root[data-view="duffus"] #slot-table td.lbl { color: #fff; font-weight: 600; }
:root[data-view="duffus"] #slot-table .item + .item { border-top-color: var(--line); }
:root[data-view="duffus"] .chip { background: var(--surf2); border: 1px solid transparent; border-radius: 10px; color: var(--text); }
:root[data-view="duffus"] .chip.set { background: var(--surf); border-color: transparent; }
:root[data-view="duffus"] .item.diff .chip { background: #3a2d1b; border-color: #e0913a; }
:root[data-view="duffus"] .chip.banned, :root[data-view="duffus"] .item .chip.banned { background: var(--miss-bg); border-color: rgba(255, 120, 100, .45); color: var(--miss-text); }
:root[data-view="duffus"] .chip.banned button.ban { color: var(--miss-text); }
:root[data-view="duffus"] .badge-diff { background: #e0913a; color: #1b1c1b; }
:root[data-view="duffus"] .chip-exo { color: #d2b5f5; background: #33264a; border-color: #54407a; }
:root[data-view="duffus"] .hover-card .hc-exo { color: #d2b5f5; }
:root[data-view="duffus"] .ico-none, :root[data-view="duffus"] .sp-ico-none, :root[data-view="duffus"] .ico.ico-wait { background-color: var(--surf2); color: var(--muted); }
:root[data-view="duffus"] .weapon-wrap .wp-chip { background: var(--surf2); border-color: transparent; border-radius: 10px; }
/* request panel: stat tables */
:root[data-view="duffus"] .stat-table th { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 3px 3px 5px; }
:root[data-view="duffus"] .stat-table th.match { color: var(--ok-text); }
:root[data-view="duffus"] .stat-table td { padding: 3px 3px; }
:root[data-view="duffus"] .stat-table td.name { color: #fff; font-weight: 500; }
:root[data-view="duffus"] .stat-table td.tot { border-radius: 8px; }
:root[data-view="duffus"] .stat-table input[type=number] { border-radius: 8px; }
:root[data-view="duffus"] .res-sums .rs-tot, :root[data-view="duffus"] .res-sums .help { color: var(--muted); }
:root[data-view="duffus"] .warn { color: var(--warn); }
/* popups: spell picker, class picker, enchaînement list, item search */
:root[data-view="duffus"] .sp-pop { background: var(--dx-card2); color: var(--text); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; box-shadow: 0 14px 36px rgba(0, 0, 0, .5); padding: 8px; }
:root[data-view="duffus"] .sp-list li, :root[data-view="duffus"] .it-pop li, :root[data-view="duffus"] .chain-wrap .ch-cell { border-radius: 9px; }
:root[data-view="duffus"] .sp-list li.act, :root[data-view="duffus"] .it-pop li:hover, :root[data-view="duffus"] .it-pop li.active,
:root[data-view="duffus"] .chain-wrap .ch-cell:hover, :root[data-view="duffus"] .chain-wrap .ch-cell.active, :root[data-view="duffus"] .chain-wrap .ch-pop li:not(.ch-pair):hover { background: rgba(183, 220, 105, .13); }
:root[data-view="duffus"] .sp-list li[aria-selected=true] { color: var(--accent); }
:root[data-view="duffus"] #spell-list .sp-group { color: var(--dx-lime2); opacity: 1; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 700; }
:root[data-view="duffus"] .sp-pop, :root[data-view="duffus"] .hist-list, :root[data-view="duffus"] .sp-list { scrollbar-color: #4a4b45 transparent; }
/* hover cards */
:root[data-view="duffus"] .hover-card { background: var(--dx-card2); color: var(--text); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; box-shadow: 0 14px 36px rgba(0, 0, 0, .55); padding: 10px 12px; font-family: inherit; }
:root[data-view="duffus"] .hover-card strong { color: #fff; }
:root[data-view="duffus"] .hover-card .hc-sec { color: var(--dx-lime2); }
/* history: list, class folders */
:root[data-view="duffus"] .hist-head { color: var(--muted); }
:root[data-view="duffus"] .hist-head button { padding: 3px 12px; font-size: 12px; }
:root[data-view="duffus"] .hist-list li { border-top: 0; border-radius: 12px; margin-bottom: 4px; background: rgba(255, 255, 255, .025); }
:root[data-view="duffus"] .hist-list li.on { background: rgba(183, 220, 105, .12); box-shadow: inset 0 0 0 1px rgba(183, 220, 105, .35); }
:root[data-view="duffus"] .hist-list .hist-load strong { color: #fff; }
:root[data-view="duffus"] .hist-list .hist-group { background: none; color: var(--dx-lime2); margin: 10px 0 4px; }
:root[data-view="duffus"] .hist-list .hist-folder { background: none; box-shadow: none; }
:root[data-view="duffus"] .hist-folder > details > summary { background: var(--surf); border-radius: 12px; padding: 7px 10px; margin-bottom: 4px; color: #fff; }
:root[data-view="duffus"] .hist-folder > details[open] > summary { color: var(--accent); }
:root[data-view="duffus"] details.hist-more summary, :root[data-view="duffus"] details.alts summary { color: var(--muted); }
:root[data-view="duffus"] .hist-sep { background: var(--muted); }
/* PV / PA / PM / PO bubbles: the stat icon after the value, same size for all four (owner 2026-10-16) */
:root[data-view="duffus"] #equip .eq-stat { align-items: center; }
:root[data-view="duffus"] #equip .eq-stat::after { content: ""; width: 16px; height: 16px; flex: none; background: center / contain no-repeat; }
:root[data-view="duffus"] #equip .eq-who + .eq-stat::after { background-image: var(--ico-hitPoints, url("../data/stat_icons/hitPoints.webp")); }
:root[data-view="duffus"] #equip .eq-stat.pa::after { background-image: var(--ico-actionPoints, url("../data/stat_icons/actionPoints.webp")); }
:root[data-view="duffus"] #equip .eq-stat.pm::after { background-image: var(--ico-movementPoints, url("../data/stat_icons/movementPoints.webp")); }
:root[data-view="duffus"] #equip .eq-stat:last-child::after { background-image: var(--ico-range, url("../data/stat_icons/range.webp")); }
:root[data-view="duffus"] #equip .eq-stat:last-child:not(.pa):not(.pm) { background: rgba(70, 200, 170, .12); }
:root[data-view="duffus"] #equip .eq-stat:last-child:not(.pa):not(.pm) strong { color: #7fe0c8; }
@media (max-width: 720px) {
  :root[data-view="duffus"] main { padding-left: 16px; padding-right: 16px; }
  :root[data-view="duffus"] section, :root[data-view="duffus"] aside { padding: 12px; border-radius: 16px; }
  /* phone: the spell row, the Dofus bonus row and the Build exo row wrap instead of pushing the page sideways */
  :root[data-view="duffus"] .spell-field, :root[data-view="duffus"] .fd-row, :root[data-view="duffus"] .bexo-row { display: flex; flex-wrap: wrap; max-width: 100%; white-space: normal; }
  :root[data-view="duffus"] .sp-opt { white-space: normal; flex-wrap: wrap; }
  :root[data-view="duffus"] .spell-btn { min-width: 0; max-width: 100%; }
  :root[data-view="duffus"] #slot-table td.lbl { width: 86px; }
  :root[data-view="duffus"] #res_ring { grid-template-columns: minmax(0, 1fr); }
}
/* banned items in red, also in the equipment view (audit 2026-10-16) */
.chip.banned, .item .chip.banned { color: #c0392b; text-decoration: line-through; text-decoration-color: #c0392b; text-decoration-thickness: 2px; border-color: #e07a6d; }
#equip .eq-slot.banned { box-shadow: inset 0 0 0 2px #c0392b; }
#equip .eq-slot.banned::after { content: '⛔'; position: absolute; left: 2px; top: 1px; font-size: 11px; line-height: 1; }
.chip > button.perm.on { background: #c0392b; color: #fff; border-radius: 4px; }
/* rings: names cut with an ellipsis only when one ring alone is wider than the cell, buttons on hover (audit 2026-10-16);
   the 2 rings sit side by side when both full names fit, else ring 2 goes to the next line (owner B24: no cut when there is space, no wrap) */
#res_ring { display: flex; flex-wrap: wrap; gap: 4px 14px; }
#res_ring .item { flex: 0 1 auto; }
#res_ring .item, #res_ring .chip { min-width: 0; max-width: 100%; }
#res_ring .chip { display: inline-flex; align-items: center; overflow: hidden; }
#res_ring .chip > :not(.chip-nm) { flex: none; }
#res_ring .chip-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#res_ring .chip > button { display: none; }
#res_ring .chip:hover > button, #res_ring .chip:focus-within > button, #res_ring .chip.banned > button.ban { display: inline-flex; }
#equip .eq-slot.banned { position: relative; }
/* spell result laid out (owner 2026-10-16): name, damage with icon, heal, tags */
#res-spell .rs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
#res-spell .rs-head .sp-ico { width: 32px; height: 32px; }
#res-spell .rs-line { display: block; }
#res-spell .rs-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
#res-spell .rs-tag { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--chip, rgba(127,127,127,.15)); border: 1px solid var(--line); }
/* item lists as icon chips (owner 2026-10-16) */
.name-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.name-chips:empty { display: none; }
.nm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 2px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; background: var(--chip, rgba(127,127,127,.1)); max-width: 100%; }
.nm-chip .ico.sm { width: 22px; height: 22px; flex: none; }
.nm-chip.unknown { border-style: dashed; opacity: .7; }
.nm-chip button { padding: 0 4px; border: 0; background: none; cursor: pointer; font-weight: 700; }
#permaban-chips .nm-chip { border-color: #c0392b; }
/* results bar v3 (owner 2026-10-16): shown stuff on top, other stuffs as lines with rows; readable "on" state */
#results .var-now { font-size: 13px; padding: 2px 4px; }
#results .var-now-lab { color: var(--muted); }
#results .variants .var-line { flex-direction: column; align-items: flex-start; gap: 3px; padding: 6px 10px; }
#results .var-line .var-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#results .var-line .var-lab { color: var(--muted); font-size: 11px; min-width: 44px; }
#results .variants .var.on, #results .variants .var-line.on { background: transparent !important; color: inherit !important; border-color: var(--accent) !important; }
.list-vars { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.list-vars .eq-var { position: relative; width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: #e9e7df; border: 1px solid #b9b4a6; cursor: pointer; overflow: visible; }
.list-vars .eq-var .ico { width: 22px; height: 22px; }
.list-vars .eq-var .eq-swap { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% - 4px); background: #fff; color: #222; font-size: 9px; line-height: 11px; padding: 0 4px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.35); pointer-events: none; }
:root[data-theme="dark"] .list-vars .eq-var, :root[data-view="duffus"] .list-vars .eq-var { background: #595a56; border-color: #6d6e69; }
.chip > button.perm { font-size: 10px; }
#res-spell .rs-det { font-size: 12px; color: var(--muted); margin: 1px 0 2px 22px; } #res-spell .rs-line strong { font-size: 15px; }

/* ---------- history: "Derniers stuffs" grid button, class folders as buttons, large history window (owner 2026-10-16) ---------- */
.hist-list .hist-group { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hist-list .hist-all { padding: 3px 6px; line-height: 0; color: var(--muted); background: transparent; }
.hist-list .hist-all svg { fill: currentColor; }
.hist-list .hist-all:hover { color: var(--accent); }
.hist-folder-btn { width: 100%; display: flex; align-items: center; gap: 6px; text-align: left; font-weight: 700; padding: 6px 4px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.hist-folder-btn:hover { color: var(--accent); }
html.hx-lock, html.hx-lock body { overflow: hidden; }
.hx-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(10, 10, 14, .55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.hx-overlay[hidden] { display: none; }
.hx-box { width: min(1500px, 100%); max-height: 100%; display: flex; flex-direction: column; min-height: 0; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); padding: 14px 16px 16px; }
.hx-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.hx-head h2 { margin: 0; font-size: 18px; }
.hx-n { color: var(--muted); font-size: 13px; }
.hx-sort { margin-left: auto; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.hx-close { font-size: 20px; line-height: 1; padding: 4px 10px; }
.hx-filter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.hx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; }
:root .hx-filter .hx-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.hx-chip .hx-cls { width: 22px; height: 22px; }
.hx-cn { font-variant-numeric: tabular-nums; font-weight: 700; }
.hx-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hx-tools .hx-sort { margin-left: 0; }
.hx-view { display: inline-flex; }
.hx-view button { padding: 3px 10px; font-size: 12px; border-radius: 0; }
.hx-view button:first-child { border-radius: 999px 0 0 999px; }
.hx-view button:last-child { border-radius: 0 999px 999px 0; margin-left: -1px; }
:root .hx-view button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
/* groups by goal (owner 2026-10-16): sticky header per group, cards (or lines) below */
.hx-grid { overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1 1 auto; padding: 0 2px 2px; }
.hx-empty { color: var(--muted); }
.hx-group + .hx-group { margin-top: 12px; }
.hx-gh { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 6px 2px 5px;
  font-size: 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.hx-gh .hx-cls { width: 22px; height: 22px; flex: none; }
.hx-gt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-gn { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 7px; line-height: 18px; border-radius: 9px; background: var(--chip, var(--panel)); color: var(--muted); }
.hx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; align-items: start; }
.hx-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 7px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hx-card.on { box-shadow: inset 0 0 0 2px var(--accent); }
.hx-card.best { border-color: #d4a017; }
.hx-ch { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hx-val { display: flex; align-items: baseline; gap: 4px; flex: none; white-space: nowrap; }
.hx-val .rs-vico { width: 16px; height: 16px; align-self: center; }
.hx-val strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.hx-unit { font-size: 11px; color: var(--muted); }
.hx-date { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hx-ch .hx-load { padding: 2px 9px; font-size: 12px; flex: none; }
.hx-ch .hx-del { padding: 2px 7px; font-size: 14px; line-height: 1; color: var(--muted); flex: none; }
.hx-ch .hx-del:hover { color: var(--warn); }
.hx-icons { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px 0; min-width: 0; }
.hx-eq, .hx-dofus { display: inline-flex; flex-wrap: nowrap; gap: 2px; min-width: 0; }
.hx-eq { flex: 0 1 auto; } .hx-dofus { flex: 0 1 auto; }
.hx-icons .ico.sm { margin-right: 0; width: 24px; height: auto; aspect-ratio: 1; flex: 0 1 24px; min-width: 0; } /* all icons on one line (owner): they shrink when the card is narrow */
.hx-dofus { padding-left: 4px; margin-left: 4px; border-left: 1px solid var(--line); }
.hx-sum { font-size: 12px; color: var(--muted); }
/* list view: one line per stuff (value | items | key stats | date | Charger ×) */
.hx-as-list .hx-cards { grid-template-columns: 1fr; gap: 3px; }
.hx-as-list .hx-card { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr) auto auto auto auto; align-items: center; column-gap: 10px; padding: 3px 8px; border-radius: 8px; }
.hx-as-list .hx-ch { display: contents; }
.hx-as-list .hx-val { grid-column: 1; }
.hx-as-list .hx-icons { grid-column: 2; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.hx-as-list .hx-eq, .hx-as-list .hx-dofus { flex-wrap: nowrap; }
.hx-as-list .hx-icons .ico.sm { width: 20px; flex: 0 1 20px; }
.hx-as-list .hx-sum { grid-column: 3; grid-row: 1; white-space: nowrap; }
.hx-as-list .hx-sum .sm-more { display: none; }
.hx-as-list .hx-date { grid-column: 4; grid-row: 1; margin-left: 0; }
.hx-as-list .hx-load { grid-column: 5; grid-row: 1; }
.hx-as-list .hx-del { grid-column: 6; grid-row: 1; }
@media (max-width: 1100px) {
  .hx-as-list .hx-card { grid-template-columns: minmax(0, 1fr) auto auto auto; row-gap: 2px; }
  .hx-as-list .hx-date { grid-column: 2; }
  .hx-as-list .hx-load { grid-column: 3; }
  .hx-as-list .hx-del { grid-column: 4; }
  .hx-as-list .hx-icons { grid-column: 1 / -1; grid-row: 2; }
  .hx-as-list .hx-sum { grid-column: 1 / -1; grid-row: 3; white-space: normal; }
}
@media (max-width: 640px) {
  .hx-overlay { padding: 8px; align-items: stretch; }
  .hx-box { padding: 10px; border-radius: 10px; }
  .hx-tools { margin-left: 0; }
  .hx-close { order: -1; }
  .hx-head h2 { order: -2; flex: 1 0 calc(100% - 64px); }
  .hx-as-list .hx-date { display: none; }
  .hx-as-list .hx-card { grid-template-columns: 18px minmax(0, 1fr) auto auto; }
  .hx-as-list .hx-load { grid-column: 3; }
  .hx-as-list .hx-del { grid-column: 4; }
}
:root[data-view="duffus"] .hx-box { background: var(--dx-card2); border: 1px solid var(--dx-edge); border-radius: 20px; }
:root[data-view="duffus"] .hx-gh { background: var(--dx-card2); border-bottom-color: var(--dx-edge); color: #fff; }
:root[data-view="duffus"] .hx-gn { background: var(--surf); color: var(--dx-lime2, var(--accent)); }
:root[data-view="duffus"] .hx-card { background: var(--panel); border: 1px solid var(--dx-edge); border-radius: 16px; }
:root[data-view="duffus"] .hx-card.best { border-color: #d4a017; }
:root[data-view="duffus"] .hx-as-list .hx-card { border-radius: 12px; }
:root[data-view="duffus"] .hx-head h2 { color: #fff; }
:root[data-view="duffus"] .hx-val strong { color: #fff; }
:root[data-view="duffus"] .hx-ch .hx-load { padding: 3px 10px; font-size: 12px; }
:root[data-view="duffus"] .hx-ch .hx-del { padding: 3px 8px; }
:root[data-view="duffus"] .hist-folder-btn { background: var(--surf); border: 0; border-radius: 12px; padding: 7px 10px; margin-bottom: 4px; color: #fff; }
:root[data-view="duffus"] .hist-folder-btn:hover:not(:disabled) { background: var(--dx-btn); color: var(--accent); }
:root[data-view="duffus"] .hist-list .hist-all { background: transparent; border: 0; padding: 3px 6px; color: var(--dx-lime2); }
/* spell result: every part on its own row (owner 2026-10-16: the rolls go under the average) */
#res-spell:not([hidden]) { display: flex; flex-direction: column; align-items: flex-start; flex-wrap: nowrap; gap: 2px; }
#res-spell > .rs-head, #res-spell > .rs-line, #res-spell > .rs-det, #res-spell > .rs-heal, #res-spell > .rs-tags, #res-spell > .rd { flex: none; width: 100%; margin-left: 0; }
#res-spell div.rs-line { display: flex; align-items: center; gap: 6px; } #res-spell span.rs-line { display: block; }
#res-spell .rs-vico, :root[data-view="duffus"] #res-spell .rs-vico { width: 18px; height: 18px; }
#res-spell .rs-det { margin-left: 24px; }
#res-spell .rs-el { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; } #res-spell .rs-el .fav-ico { width: 16px; height: 16px; }
/* item lists (owner 2026-10-16): one interface only = the search field + a compact list; the text box stays hidden */
#permaban, #blacklist, #forced { display: none; }
.name-chips { flex-direction: column; flex-wrap: nowrap; gap: 0; max-height: 210px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.nm-chip, :root[data-view="duffus"] .nm-chip { display: flex; width: 100%; box-sizing: border-box; border: 0 !important; border-radius: 4px; background: none !important; padding: 1px 2px; font-size: 12px; line-height: 1.2; min-height: 0; }
.nm-chip:hover { background: rgba(127,127,127,.12) !important; }
.nm-chip .ico.sm { width: 18px; height: 18px; }
.nm-chip > :not(button):not(.ico) { flex: 1; }
.nm-chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-chip button, :root[data-view="duffus"] .nm-chip button { margin-left: auto; width: 20px; height: 20px; min-width: 0; padding: 0; border-radius: 4px; background: none !important; font-size: 12px; line-height: 1; flex: none; }
#permaban-chips { border-color: #c0392b; }
.nm-chip .nm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; } .name-chips:empty { display: none; }
/* list thumbnails on the chip's corner like the equipment view (owner 2026-10-16) */
#slot-table .chip.has-var { position: relative; overflow: visible !important; margin-right: 14px; margin-bottom: 8px; }
#slot-table .chip.has-var .list-vars { position: absolute; right: -14px; bottom: -10px; margin: 0; z-index: 2; }
#res_dofus .chip, #res_ring .chip { overflow: visible; }
/* exo shortcut on the PA / PM / PO bubbles */
.bub-exo { margin-left: 6px; font-size: 10px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; line-height: 16px; }
.bub-exo.on { background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-view="duffus"] .bub-exo.on { color: #1b1c19; }
#results .var-line .var-lab { min-width: 14px; }
/* owner 2026-10-16 review fixes */
/* an Idéal at its proved maximum (not "missed"): neutral, the tip says "maximum possible" */
.stat-table td.tot.best { background: var(--chip); color: var(--accent); }
.stat-table th.match { white-space: pre-line; font-size: 11px; line-height: 1.2; }
.res-sums .rs-tot.miss { color: var(--warn); }
/* pop-ups never wider than the screen (phone 390 px: the spell list was 460 px, items off-screen); fitPop shifts them */
.sp-pop { max-width: calc(100vw - 16px); }
@media (max-width: 520px) {
  .sp-pop:not(.it-pop), .chain-wrap .ch-pop { width: calc(100vw - 32px) !important; }
  #spell-list { grid-template-columns: minmax(0, 1fr); }
  .cls-pop { width: calc(100vw - 32px); }
  .cls-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* phone: the option rows wrap instead of widening the page (it scrolled sideways to 427 px at 390 px) */
@media (max-width: 500px) { .checks { grid-template-columns: minmax(0, 1fr); } .fd-row { flex-wrap: wrap; white-space: normal; } }
/* equipment squares open their item chooser */
#equip .eq-slot[tabindex] { cursor: pointer; }
#equip .eq-slot[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot-pick { position: absolute; z-index: 40; width: min(340px, calc(100vw - 16px)); background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.slot-pick[hidden] { display: none; }
.slot-pick .slp-head { display: flex; align-items: center; gap: 6px; }
.slot-pick .slp-head strong { flex: 1; min-width: 0; font-size: 13px; }
.slot-pick .slp-close { padding: 0 8px; }
.slot-pick .slp-vars { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.slot-pick .slp-vars[hidden] { display: none; }
.slot-pick .slp-thumbs { display: inline-flex; gap: 8px; }
.slot-pick .eq-var { position: relative; width: 34px; height: 34px; padding: 1px; display: flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid var(--line); background: var(--surf); cursor: pointer; }
.slot-pick .eq-var:hover, .slot-pick .eq-var:focus-visible { border-color: var(--accent); }
.slot-pick .eq-var .ico { width: 30px; height: 30px; }
.slot-pick .eq-swap { position: absolute; right: -5px; top: -6px; font-size: 9px; line-height: 11px; padding: 0 2px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); }
.slot-pick .eq-exo { position: absolute; left: -3px; bottom: -3px; }
.slot-pick .slp-empty { align-self: flex-start; }
.slot-pick .slp-empty[hidden] { display: none; }
.slot-pick .slp-q { width: 100%; box-sizing: border-box; }
.slot-pick .slp-list { width: 100% !important; min-width: 0; max-height: 280px; padding: 0; }
.slot-pick .slp-list li.banned .it-nm { text-decoration: line-through; color: var(--miss-text); }
.slot-pick .slp-list li.sp-off { color: var(--muted); cursor: default; }
:root[data-theme="dark"] .slot-pick { background: var(--surf2); border-color: #4a4b52; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slot-pick { background: var(--surf2); border-color: #4a4b52; } }
:root[data-view="duffus"] .slot-pick { background: var(--dx-card2); color: var(--text); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; box-shadow: 0 14px 36px rgba(0, 0, 0, .5); }
/* results bar v4 (owner 2026-10-16): tabs + one comparison card; removed / added items stacked with the arrow centred */
#results .stuff-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
#results .stuff-tab { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 4px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; line-height: 1.25; }
#results .stuff-tab strong { font-size: 13px; }
#results .stuff-tab .st-v, #results .stuff-tab .st-c { font-size: 11px; color: var(--muted); }
#results .stuff-tab.on { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
#results .stuff-tab:not(.on):hover { border-color: var(--accent); }
#results .var-swap { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; margin: 2px 0; }
#results .var-swap .var-arrow { font-size: 14px; line-height: 1; color: var(--muted); }
#results .var-swap .var-ics { justify-content: center; }
/* full crit setting (owner 2026-10-16): long label, may wrap on phones */
.key-row label.fullcrit { white-space: normal; flex-wrap: wrap; }
/* "Tour optimal" settings under the picker (owner 2026-10-16) */
.tour-wrap:not([hidden]) { display: flex; flex-basis: 100%; width: 100%; white-space: normal; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 4px; }
.tour-wrap label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tour-wrap select { max-width: 220px; }
#results .stuff-tab .st-tag { font-size: 11px; color: var(--accent); font-weight: 600; }
/* swap thumbnails (owner 2026-10-16): the first on the slot's bottom-right corner, the second OUTSIDE to its right */
#equip .eq-vars { flex-direction: row; right: auto; left: calc(100% - 17px); bottom: -7px; }
/* list: thumbnails after the chip, never over a name */
#slot-table .list-vars { position: static; display: inline-flex; gap: 4px; margin: 6px 0 0 6px; vertical-align: middle; }
#slot-table .chip.has-var { margin: 0; }
#res-spell .rs-turn { font-size: 12px; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#res-spell .rs-turn .sp-ico { width: 18px; height: 18px; }
#res-delta .rd .fav-ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
/* option icons of "Catégories autorisées" / "Limites d'objets" (owner 2026-10-16): a typical item or the stat icon */
fieldset label.flt-lab { display: flex; align-items: center; gap: 5px; }
fieldset label.flt-lab input { margin: 0; flex: none; }
.flt-ico { width: 20px; height: 20px; flex: none; display: inline-block; object-fit: contain; }
.flt-ico.ico-none { font-size: 8px; }
/* spell icons in the history (owner 2026-10-16): goal icons in the sidebar entry and the group header, the optimal turn */
.hist-ghead { display: flex; align-items: center; gap: 3px; min-width: 0; }
.hist-ghead .hist-gico { width: 18px; height: 18px; flex: none; margin: 0; }
.hx-gh .hx-gico { width: 22px; height: 22px; flex: none; margin: 0; }
.turn-line { display: inline; line-height: 1.6; }
.turn-line .sp-ico { width: 18px; height: 18px; vertical-align: -4px; margin: 0 1px 0 0; }
.turn-line .tl-vico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.hx-turn { font-size: 12px; color: var(--muted); min-width: 0; }
.hx-turn:empty { display: none; }
.hx-tv { font-size: 11px; color: var(--muted); margin-left: 4px; }
.hx-tv b { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.hist-turn { display: block; margin: 2px 0; }
.hist-turn:empty { display: none; }
.hx-as-list .hx-turn { display: none; }
:root[data-view="duffus"] .hx-tv b, :root[data-view="duffus"] .turn-line strong { color: #fff; }
.hx-card .hx-tv { display: none; }
.hx-as-list .hx-card .hx-tv { display: inline; }
/* alternatives beside the slot, Duffus style (owner 2026-10-16) */
#equip .eq-slot.has-var { overflow: visible; }
#equip .eq-vars { position: absolute; display: flex; flex-direction: column; gap: 3px; z-index: 3; left: auto; right: auto; top: auto; bottom: auto; }
#equip .eq-vars.side-right { left: calc(100% + 4px); top: 50%; transform: translateY(-50%); }
#equip .eq-vars.side-left { right: calc(100% + 4px); top: 50%; transform: translateY(-50%); }
#equip .eq-vars.side-below { top: calc(100% + 4px); left: 50%; transform: translateX(-50%); flex-direction: row; }
#equip .eq-vars .eq-var { width: 26px; height: 26px; }
#equip .eq-dofus:has(.has-var) { margin-bottom: 34px; }
/* Forgemagie globale card (Duffus style) under the equipment view */
#res-exos:not([hidden]) { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
#res-exos .exo-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }
#res-exos .exo-row { display: flex; flex-wrap: wrap; gap: 6px; }
#res-exos .exo-line { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; background: none; }
#res-exos .exo-line .fav-ico { width: 14px; height: 14px; }
/* comparison cards side by side, smaller text, horizontal slider */
#results .cmp-row { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
#results .cmp-row .var-line { flex: 0 0 auto; max-width: 420px; font-size: 11px; scroll-snap-align: start; }
#results .cmp-row .var-line .var-ics .ico.sm { width: 18px; height: 18px; }
#results .cmp-row .var-line .fav-ico { width: 12px; height: 12px; }
/* an option that is off: red cross on its icon, label struck */
.flt-lab.off-unchecked:has(input:not(:checked)), .flt-lab.off-checked:has(input:checked) { text-decoration: line-through; color: var(--muted); }
.flt-wrap { position: relative; display: inline-flex; flex: none; }
.flt-lab.off-unchecked:has(input:not(:checked)) .flt-wrap::after, .flt-lab.off-checked:has(input:checked) .flt-wrap::after { content: ''; position: absolute; inset: -1px; background: linear-gradient(45deg, transparent 44%, #d63a2f 44%, #d63a2f 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #d63a2f 44%, #d63a2f 56%, transparent 56%); }
#res-spell .rs-note { font-size: 11px; color: var(--accent); margin-top: 3px; }
.flt-lab { display: flex; align-items: center; gap: 6px; } #results .cmp-row .var-line { max-width: 380px; }
.cast-el { width: 14px; height: 14px; vertical-align: -2px; }
.turn-nocac { display: block; margin-top: 3px; font-size: 12px; } .turn-nocac .sp-ico { width: 16px; height: 16px; } .turn-nocac .fav-ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
#res-exos button.exo-line { cursor: pointer; font-family: inherit; } #res-exos button.exo-line.off { opacity: .55; border-style: dashed; } #res-exos button.exo-line:hover { border-color: var(--accent); opacity: 1; }
/* Forgemagie globale: title vertically aligned with the switches; ON = coloured (owner 2026-10-17) */
#res-exos:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
#res-exos .exo-head { margin: 0; }
#res-exos button.exo-line:not(.off) { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }
:root[data-view="duffus"] #res-exos button.exo-line:not(.off) { color: #1b1c19; }
/* +1 PA stays blue, +1 PM green (owner): ON = filled with its own colour, OFF = its colour on the text */
#res-exos button.exo-line.exo-pa:not(.off) { background: #1f5fd1; border-color: #1f5fd1; color: #fff; }
#res-exos button.exo-line.exo-pm:not(.off) { background: #1d8a3a; border-color: #1d8a3a; color: #fff; }
:root[data-view="duffus"] #res-exos button.exo-line.exo-pa:not(.off) { background: #8db4ff; border-color: #8db4ff; color: #1b1c19; }
:root[data-view="duffus"] #res-exos button.exo-line.exo-pm:not(.off) { background: #79dc95; border-color: #79dc95; color: #1b1c19; }
#res-exos button.exo-line:not(.off) .fav-ico { filter: drop-shadow(0 0 1px rgba(0,0,0,.4)); }
#res-spell .rs-exo { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--accent); }
/* all proposed stuffs on one line (slider if needed) */
#results .stuff-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
#results .stuff-tab { flex: 0 0 auto; }
/* alternatives as a stack of cards (owner 2026-10-17, Duffus style): first in front with the ⇄ pill, others behind,
   shifted to the bottom-right */
.alt-stack { position: relative; display: inline-block; width: 30px; height: 30px; flex: none; vertical-align: middle; }
.alt-stack.n2 { width: 36px; height: 36px; }
.alt-stack.n3 { width: 42px; height: 42px; }
.alt-stack .alt-card, #equip .alt-stack .alt-card { position: absolute; width: 30px; height: 30px; padding: 0; margin: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid #b9b4a6; background: #e9e7df; box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: pointer; overflow: visible; transform: none; }
.alt-stack .alt-card .ico { width: 24px; height: 24px; }
.alt-stack .alt-0 { left: 0; top: 0; z-index: 3; }
.alt-stack .alt-1 { left: 6px; top: 6px; z-index: 2; }
.alt-stack .alt-2 { left: 12px; top: 12px; z-index: 1; }
.alt-stack .alt-card:hover { z-index: 5; border-color: var(--accent); }
.alt-stack .alt-0 .eq-swap { position: absolute; left: 50%; right: auto; transform: translateX(-50%); bottom: calc(100% - 5px); background: #fff; color: #222; font-size: 9px; line-height: 11px; padding: 0 5px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.35); pointer-events: none; }
:root[data-theme="dark"] .alt-stack .alt-card, :root[data-view="duffus"] .alt-stack .alt-card { background: #4b4c48; border-color: #6d6e69; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alt-stack .alt-card { background: #4b4c48; border-color: #6d6e69; } }
#slot-table .list-vars { display: inline-flex; margin: 4px 0 0 10px; vertical-align: middle; }
#equip .eq-vars { flex-direction: row; }
/* collapsible Catégories autorisées / Limites d'objets */
fieldset.collapsible > legend { cursor: pointer; user-select: none; }
fieldset.collapsible > legend::before { content: '▾ '; }
fieldset.collapsible.collapsed > legend::before { content: '▸ '; }
fieldset.collapsible.collapsed > label { display: none; }
/* item list rows: chip then its alternatives on the SAME line, never wrapped below (owner 2026-10-17: clean view) */
#slot-table .item-line { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; }
#slot-table .item-line > .chip { flex: 0 1 auto; min-width: 0; }
#slot-table .item-line .chip-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#slot-table .list-vars { margin: 0; flex: none; }
/* phone (390 px): fixed columns, so a long item name ends in an ellipsis instead of widening the table (side scroll) */
@media (max-width: 720px) { #slot-table { table-layout: fixed; } #slot-table td.lbl { width: 86px; } }
/* narrow ring / Dofus cells: the exo text goes to the hover card, the name keeps the room */
#res_ring .chip-exo, #res_dofus .chip-exo { display: none; }

/* header link to the class DPS ranking (ui/classement.html) */
.head-links { font-size: 13px; }
.head-links a { color: var(--accent); }
/* turn hover card (owner 2026-10-17) */
.hover-card .hc-turn { display: grid; gap: 3px; margin: 4px 0; }
.hover-card .hc-tr { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center; white-space: nowrap; }
.hover-card .hc-tr .sp-ico { width: 18px; height: 18px; grid-row: span 2; }
.hover-card .hc-tr .hc-tn { overflow: hidden; text-overflow: ellipsis; }
.hover-card .hc-tr .hc-els { display: inline-flex; gap: 1px; }
.hover-card .hc-tr .hc-els .hc-ic { width: 14px; height: 14px; }
.hover-card .hc-tr .hc-v { font-weight: 700; text-align: right; min-width: 44px; }
.hover-card .hc-tr .hc-tag { grid-column: 2 / -1; margin: 0; font-size: 11px; color: var(--muted); white-space: normal; }
.hover-card .hc-tr .hc-calc { grid-column: 2 / -1; font-size: 11px; line-height: 1.35; color: var(--text); opacity: .85; white-space: normal; font-variant-numeric: tabular-nums; }
.hover-card:has(.hc-calc) { max-width: 520px; }
.hover-card .hc-tot { display: flex; align-items: center; gap: 4px; padding-top: 5px; border-top: 1px solid var(--line); }
.hover-card .hc-tot .hc-ic { width: 14px; height: 14px; }
.hover-card { max-width: 380px; }
/* the cards behind further down-right (owner 2026-10-17) */
.alt-stack.n2 { width: 42px; height: 42px; }
.alt-stack.n3 { width: 54px; height: 54px; }
.alt-stack .alt-1 { left: 11px; top: 11px; }
.alt-stack .alt-2 { left: 22px; top: 22px; }
/* alternatives overlap the slot's edge like Duffus (owner 2026-10-17): partly over the item square, lower half */
#equip .eq-vars.side-right { left: calc(100% - 12px); right: auto; top: 42%; bottom: auto; transform: none; }
#equip .eq-vars.side-left { right: calc(100% - 12px); left: auto; top: 42%; bottom: auto; transform: none; }
#equip .eq-vars.side-below { top: calc(100% - 14px); left: 52%; transform: none; }
#equip .alt-stack .alt-card { width: 32px; height: 32px; }
#equip .alt-stack .alt-card .ico { width: 26px; height: 26px; }
/* Duffus swap pill */
.alt-stack .alt-0 .eq-swap, #equip .alt-stack .alt-0 .eq-swap { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 18px; padding: 0; border-radius: 9px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%); line-height: 0; }
.alt-stack .alt-0 .eq-swap, #equip .alt-stack .alt-0 .eq-swap { font-size: 14px; font-weight: 700; color: #1d1d1b; line-height: 18px; }
/* second / third alternative further to the right (owner 2026-10-17) */
.alt-stack.n2 { width: 56px; } .alt-stack.n3 { width: 80px; }
.alt-stack .alt-1, #equip .alt-stack .alt-1 { left: 22px; top: 8px; }
.alt-stack .alt-2, #equip .alt-stack .alt-2 { left: 44px; top: 16px; }

/* ---------- Mode Ombre (owner 2026-10-17): switch, boss list, configurations, whitelist, skull mentions ----------
   The skull is the game's "teteDeMort" sprite (data/ombre_skull.png, white) used as a mask: it takes the text colour. */
.om-skull { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; background: currentColor;
  -webkit-mask: url(../data/ombre_skull.png) center / contain no-repeat; mask: url(../data/ombre_skull.png) center / contain no-repeat; }
.om-skull-lg { width: 28px; height: 28px; color: var(--accent); }
.om-presets, .om-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.om-presets select { flex: 1 1 100%; min-width: 0; }
.om-presets button, .om-tools button { padding: 3px 9px; font-size: 12px; }
.om-tools input { flex: 1 1 100%; min-width: 0; }
.om-count { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.om-list { list-style: none; margin: 0 0 8px; padding: 2px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surf); }
.om-list li label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 2px 4px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.om-list li label:hover { background: var(--chip); }
.om-list li input { flex: none; margin: 0; }
.om-list .om-bn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-list .it-lv { color: var(--muted); font-size: 11px; white-space: nowrap; }
.om-bico { width: 26px; height: 26px; flex: none; background-repeat: no-repeat; border-radius: 6px; }
.om-wl-lab { display: block; font-weight: 600; margin: 6px 0 4px; }
.om-note { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.nm-chip.om-forced { border-color: var(--accent); }
.nm-chip.om-forced > .om-skull { color: var(--accent); margin-left: 2px; }
.om-mark { flex: none; border: 0; background: transparent; padding: 4px 5px; line-height: 1; color: var(--muted); cursor: help; }
.om-mark:hover, .om-mark:focus-visible { color: var(--text); }
.hx-ch .om-mark { padding: 2px 4px; }
.res-ombre .om-skull { color: var(--miss-text); }
.hover-card .om-blist { max-height: 220px; overflow-y: auto; }
:root[data-view="duffus"] .om-list { background: var(--surf); border-color: var(--line); border-radius: 12px; padding: 4px; scrollbar-color: #4a4b45 transparent; }
:root[data-view="duffus"] .om-list li label { border-radius: 9px; }
:root[data-view="duffus"] .om-list li label:hover { background: rgba(183, 220, 105, .13); }
:root[data-view="duffus"] .om-list .om-bn { color: #fff; }
:root[data-view="duffus"] .om-wl-lab { color: var(--dx-lime2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
:root[data-view="duffus"] .om-presets button, :root[data-view="duffus"] .om-tools button { padding: 4px 12px; }
:root[data-view="duffus"] .om-mark, :root[data-view="duffus"] .hist-list .om-mark { background: transparent; border: 0; padding: 4px 6px; color: var(--muted); font-weight: 400; }
:root[data-view="duffus"] .om-mark:hover:not(:disabled) { background: transparent; color: var(--accent); }
:root[data-view="duffus"] .nm-chip.om-forced { border-color: rgba(183, 220, 105, .55); }
:root[data-view="duffus"] .res-ombre .rs-line { display: inline-flex; align-items: center; gap: 4px; }
/* header: "Mode Ombre" pill (lit when on) + gear; the settings panel under it (a sheet on a phone); reminder above the results */
.om-head { display: inline-flex; gap: 4px; align-items: center; }
.om-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: 13px; }
.om-toggle[aria-pressed="true"] { background: var(--chip); border-color: var(--accent); color: var(--text); }
.om-gear { padding: 4px 8px; font-size: 13px; line-height: 1; }
.om-panel { position: absolute; top: 46px; right: 16px; z-index: 60; width: 360px; max-height: calc(100vh - 70px); overflow-y: auto; text-align: left;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.om-ph { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.om-ph strong { flex: 1; font-size: 15px; }
.om-close { border: 0; background: transparent; font-size: 18px; line-height: 1; padding: 2px 8px; color: var(--muted); }
.om-help { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.om-panel textarea { width: 100%; font: 12px/1.35 ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-radius: 6px; padding: 6px; resize: vertical; }
.om-remind { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 3px 10px; font-size: 12.5px; border-radius: 999px; }
@media (max-width: 720px) {
  .om-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 82vh; border-radius: 16px 16px 0 0; }
}
:root[data-view="duffus"] .om-toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
:root[data-view="duffus"] .head-toggles .om-gear { padding: 5px 10px; }
:root[data-view="duffus"] .om-panel { background: var(--dx-card2); border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px; box-shadow: 0 14px 36px rgba(0, 0, 0, .55); padding: 14px 16px; }
:root[data-view="duffus"] .om-ph strong { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
:root[data-view="duffus"] .om-panel .om-close { background: transparent; border: 0; padding: 2px 8px; color: var(--muted); font-weight: 400; }
:root[data-view="duffus"] .om-panel .om-close:hover:not(:disabled) { background: transparent; color: #fff; }
:root[data-view="duffus"] .om-panel textarea { background: var(--surf); border-radius: 12px; padding: 8px; }
:root[data-view="duffus"] .om-remind { background: var(--surf); color: var(--text); border: 1px solid rgba(183, 220, 105, .35); padding: 4px 12px; font-weight: 600; }
:root[data-view="duffus"] .om-remind .om-skull { color: var(--accent); }
:root[data-view="duffus"] .om-remind:hover:not(:disabled) { background: var(--dx-btn-h); }
@media (max-width: 720px) { :root[data-view="duffus"] .om-panel { border-radius: 20px 20px 0 0; } }
/* "dont poussée" / "dont corps à corps" on their own line (owner 2026-10-17) */
#res-spell .rs-turn > .turn-nocac { flex-basis: 100%; }
.turn-sub { margin-top: 1px; } .turn-line .turn-sub { display: block; }
#res-spell .rs-push .fav-ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.hover-card .hc-push { display: flex; align-items: center; gap: 4px; margin: 2px 0 4px; }
/* "mode invité" (owner 2026-10-17): a share link / history entry with other inputs, not saved until "Garder" */
.guest-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 10px; padding: 8px 12px; max-width: 760px; border-radius: 14px; background: #3a2d1b; border: 1px solid #e0913a; color: #f3e6d3; font-size: 13px; }
.guest-bar[hidden] { display: none; }
.guest-bar .guest-txt { font-weight: 600; }
.guest-bar button { padding: 4px 10px; font-size: 13px; border-radius: 10px; }
.guest-bar #guest-keep { background: #e0913a; border-color: #e0913a; color: #1f1f1d; }

/* ---------- turn card (summary table) and cast card (one cast's calculation), owner 2026-10-17 ---------- */
.cast-hit { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; border-radius: 6px; }
.cast-hit:hover, .rk-cast:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hover-card:has(.hc-tt) { max-width: min(480px, calc(100vw - 16px)); }
.hover-card:has(.hc-ct) { max-width: min(470px, calc(100vw - 16px)); }
.hover-card .hc-mut { color: var(--muted); }
.hover-card .hc-b { font-weight: 700; }
.hover-card .hc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hover-card .hc-th { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-bottom: 2px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.hover-card .hc-thead { align-items: baseline; justify-content: space-between; }
.hover-card .hc-thead > strong { margin: 0; }
/* turn: icon | name + elements | PA | crit | average | share */
.hover-card .hc-tt { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto auto auto 60px; column-gap: 8px; row-gap: 4px; align-items: center; margin: 2px 0 6px; font-size: 12px; }
.hover-card .hc-tt .hc-tico { width: 20px; height: 20px; border-radius: 4px; }
.hover-card .hc-tn { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; min-width: 0; }
.hover-card .hc-tnt { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.hover-card .hc-tnt .cast-el { width: 14px; height: 14px; }
.hover-card .hc-els { display: inline-flex; gap: 1px; }
.hover-card .hc-els .hc-ic { width: 14px; height: 14px; }
.hover-card .hc-ttag { flex-basis: 100%; font-size: 10.5px; color: var(--muted); white-space: normal; }
.hover-card .hc-share { display: flex; align-items: center; gap: 4px; font-size: 11px; font-variant-numeric: tabular-nums; }
.hover-card .hc-bar { position: relative; flex: 1; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 22%, transparent); overflow: hidden; min-width: 20px; }
.hover-card .hc-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); }
.hover-card .hc-tot { justify-content: flex-start; }
.hover-card .hc-tot strong { margin: 0; }
.hover-card .hc-totpa { margin-left: auto; font-size: 12px; }
.hover-card .hc-foot { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; margin: 2px 0 2px; font-variant-numeric: tabular-nums; }
.hover-card .hc-hint { margin-top: 4px; font-style: italic; }
/* cast: label | Base | Stat + Puiss. | Do fixes | Multipl. | Résultat */
.hover-card .hc-ct { display: grid; grid-template-columns: auto repeat(5, auto); column-gap: 10px; row-gap: 1px; align-items: center; font-size: 12px; margin: 2px 0 4px; }
.hover-card .hc-ct .hc-th { font-size: 9.5px; }
.hover-card .hc-cl { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hover-card .hc-cl .hc-ic { width: 14px; height: 14px; }
.hover-card .hc-ct .hc-gap { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); }
.hover-card .hc-ct .hc-crow { color: var(--warn); }
.hover-card .hc-ct .hc-crow.hc-mut { color: var(--muted); }
.hover-card .hc-critlab { font-weight: 700; color: var(--warn); }
.hover-card .hc-cnt { font-size: 10.5px; font-weight: 700; padding: 0 4px; border-radius: 6px; background: var(--chip); color: var(--text); }
.hover-card .hc-ctag { grid-column: 1 / -1; font-size: 10.5px; color: var(--muted); }
.hover-card .hc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.hover-card .hc-fchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 4px; border-radius: 10px; background: var(--chip); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hover-card .hc-fchip .hc-ic { width: 14px; height: 14px; }
.hover-card .hc-avg { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.hover-card .hc-avg1 { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hover-card .hc-avg1 strong { margin: 0; font-size: 14px; }
.hover-card .hc-avg2 { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.hover-card .hc-ccbar { flex: 0 0 60px; margin-left: 4px; }
.hover-card .hc-ccbar > span { background: var(--warn); }
:root[data-theme="dark"] .hover-card .hc-ct .hc-crow, :root[data-theme="dark"] .hover-card .hc-critlab { color: #f0a46a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hover-card .hc-ct .hc-crow, :root:not([data-theme="light"]) .hover-card .hc-critlab { color: #f0a46a; } }
:root[data-view="duffus"] .hover-card .hc-bar > span { background: var(--dx-lime2); }
:root[data-view="duffus"] .hover-card .hc-fchip, :root[data-view="duffus"] .hover-card .hc-cnt { background: rgba(255, 255, 255, .07); }
:root[data-view="duffus"] .hover-card .hc-ct .hc-crow, :root[data-view="duffus"] .hover-card .hc-critlab { color: #e9b56b; }
:root[data-view="duffus"] .hover-card .hc-ccbar > span { background: #e9b56b; }
@media (max-width: 480px) {
  .hover-card .hc-ct { column-gap: 6px; font-size: 11px; }
  .hover-card .hc-ct .hc-th { font-size: 8.5px; letter-spacing: 0; }
  .hover-card .hc-tt { column-gap: 5px; grid-template-columns: 18px minmax(0, 1fr) auto auto auto auto 40px; }
}
/* cast card (2026-10-17): the average right under the header, the spell's own effects at the bottom, scrolling when long */
.hover-card .hc-head + .hc-avg { margin-top: 4px; padding-top: 5px; }
.hover-card .hc-avgsum { font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.hover-card .hc-spbody { max-height: 34vh; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.hover-card .hc-spbody .hc-lim { margin-top: 2px; }
.hover-card .hc-spbody .hc-desc { border-top: 0; padding-top: 2px; margin-top: 4px; }
/* one comparison reference (owner 2026-10-17): every tab and card against Stuff 1; cards keep a fixed width and the row
   slides sideways, so a trial or a third stuff never squashes the columns */
#results { min-width: 0; max-width: 100%; }
#results .variants { min-width: 0; max-width: 100%; width: 100%; }
#results .stuff-tabs { max-width: 100%; }
#results .stuff-tab .st-cmp { font-size: 11px; font-weight: 600; }
#results .stuff-tab .st-ref { color: var(--muted); font-weight: 400; font-style: italic; }
#results .cmp-note { font-size: 11px; color: var(--muted); }
#results .cmp-row { width: 100%; max-width: 100%; box-sizing: border-box; }
#results .cmp-row .var-line { flex: 0 0 300px; width: 300px; min-width: 300px; max-width: 300px; box-sizing: border-box; }
#results .var-line .var-adv { font-weight: 600; font-size: 12px; }
@media (max-width: 480px) { #results .cmp-row .var-line { flex-basis: 260px; width: 260px; min-width: 260px; max-width: 260px; } }
.rk-mlab { font-size: .78em; font-weight: 600; opacity: .8; }
