/* Atelier : Coffre · Amélioration · Fabrication · Recyclage */
.av2-dialog .av2-legacy { display: none !important; }
.dialog.av2-dialog { width: min(1300px, calc(100vw - 32px)); max-width: none; }
.av2-dialog .dialog-card { width: 100%; box-sizing: border-box; height: min(92vh, 900px); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.av2 { --line: #22324d; --panel: #0a1322; --soft: #142238; --muted: #8ea0bf; --accent: #5fe0ff; --gold: #f2c45a; --good: #54e39e; --bad: #ff7d8d;
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.av2 .gold { color: var(--gold); } .av2 .green { color: #9ff0c4; }
.av2-ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.av2-head { display: flex; align-items: center; gap: 14px; padding-right: 44px; flex-wrap: wrap; }
.av2-crest { width: 60px; height: 60px; display: grid; place-items: center; flex: none; }
.av2-crest svg { width: 100%; height: 100%; }
.av2-title { flex: 1; } .av2-title .eyebrow { margin: 0 0 2px; } .av2-title h2 { margin: 0; }
.av2-res { display: flex; gap: 6px; flex-wrap: wrap; }
.av2-res > div { display: grid; padding: 5px 12px; border-radius: 12px; background: var(--soft); }
.av2-res span { font-size: .7rem; color: var(--muted); }
.av2-res strong { font-variant-numeric: tabular-nums; }
.av2-res .gold strong { color: #ffd76a; } .av2-res .rep strong { color: #fff1b8; } .av2-res .ether strong { color: #d4c4ff; } .av2-res .ess strong { color: #ffaed6; }
.av2-tabs { display: flex; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.av2-tab { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--soft); color: #b8c6e0; font: inherit; font-weight: 700; cursor: pointer; }
.av2-tab.active { background: var(--accent); color: #06202a; }
.av2-count { margin-left: auto; color: var(--muted); font-size: .85rem; }
.av2-body { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.av2-body > div { flex: 1; min-height: 0; }
.av2-lab { font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.av2-muted { color: var(--muted); font-size: .85rem; }
.av2-empty { margin: 0; padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; grid-column: 1 / -1; }
.av2-row { display: flex; gap: 8px; align-items: center; }
.av2 .grow { flex: 1; }
.av2 .dim { color: #5d6f8f; }

.av2-btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid #2c4060; background: transparent; color: #e8eefc; font: inherit; font-weight: 700; cursor: pointer; }
.av2-btn.sm { min-height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.av2-btn.primary { border: 0; background: var(--accent); color: #06202a; }
.av2-btn.outline { border-color: var(--accent); color: var(--accent); }
.av2-btn.ghost { color: #b8c6e0; }
.av2-btn.danger { border-color: #5a2a35; color: #ff9aa6; }
.av2-btn.danger-fill { border: 0; background: #c2394f; color: #fff; }
.av2-btn:disabled { opacity: .45; cursor: not-allowed; }
.av2-btn:hover:not(:disabled) { filter: brightness(1.12); }
.av2-field { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.av2-field select { min-height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid #2c4060; background: #0e1828; color: #e8eefc; font: inherit; font-weight: 600; }
.av2-field.full { display: grid; gap: 4px; }
.av2-field.full select { width: 100%; min-height: 40px; }
.av2-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.av2-card h3 { margin: 0; font-size: 1rem; }
.av2-cost { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.av2-cost span { color: var(--muted); }
.av2-cost .ok { color: var(--good); } .av2-cost .ko { color: var(--bad); }
.av2-gridhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.av2-gridhead h3 { margin: 0; font-size: 1.05rem; }

/* Coffre */
.av2-chest { display: grid; grid-template-columns: 210px minmax(0, 1fr) 320px; gap: 14px; }
.av2-filters { display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.av2-search { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.av2-search svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.av2-search input { flex: 1; min-width: 0; background: transparent; border: 0; color: #e8eefc; font: inherit; outline: none; }
.av2-typelist { display: grid; gap: 2px; }
.av2-typelist button { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; border-radius: 9px; border: 0; background: transparent; color: #b8c6e0; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; text-align: left; }
.av2-typelist button span { flex: 1; }
.av2-typelist button em { font-style: normal; color: var(--muted); }
.av2-typelist button.on { background: #22324d; color: #e8eefc; }
.av2-rars { display: flex; flex-wrap: wrap; gap: 4px; }
.av2-rars button { padding: 5px 9px; border-radius: 8px; border: 1px solid var(--c); background: transparent; color: var(--c); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.av2-rars button.on { background: color-mix(in srgb, var(--c) 22%, transparent); }
.av2-seg { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.av2-seg button { flex: 1; min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: #b8c6e0; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.av2-seg button.on { background: #22324d; color: #e8eefc; }
.av2-grid-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.av2-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; align-content: start; padding-right: 4px; }
.av2-item { --c: #fff; display: grid; gap: 6px; padding: 10px; text-align: left; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 50%, #22324d); background: var(--panel); color: #e8eefc; font: inherit; cursor: pointer; }
.av2-item.on { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 12%, #0a1322); }
.av2-item > small { font-size: .72rem; color: #b8c6e0; }
.av2-itop { display: flex; align-items: center; gap: 8px; }
.av2-ibox { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #13233b; color: var(--c); flex: none; }
.av2-ibox.big { width: 52px; height: 52px; border-radius: 14px; }
.av2-iname { display: grid; min-width: 0; flex: 1; }
.av2-iname strong { font-size: .8rem; color: var(--c, #e8eefc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av2-iname small { font-size: .72rem; color: var(--muted); }
.av2-imeta { display: flex; justify-content: space-between; font-size: .78rem; }
.av2-imeta b { color: var(--accent); }
.av2-imeta strong { color: var(--gold); }
.av2-detail { --c: #fff; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--c) 45%, #22324d); overflow: auto; }
.av2-dhead { display: flex; align-items: center; gap: 12px; }
.av2-dhead div { display: grid; }
.av2-dhead strong { color: var(--c); font-size: 1.02rem; }
.av2-dhead em { font-style: normal; color: var(--c); font-size: .85rem; }
.av2-stats { display: grid; gap: 5px; padding: 10px; border-radius: 12px; background: #0e1828; }
.av2-stats > div { display: flex; justify-content: space-between; font-size: .9rem; }
.av2-stats strong { color: #9ff0c4; }
.av2-talent { padding: 10px; border-radius: 12px; background: #2a2410; color: #fbbf24; font-size: .85rem; font-weight: 700; }
.av2-dactions { margin-top: auto; display: grid; gap: 8px; }

/* Amélioration */
.av2-up { display: grid; grid-template-columns: 240px minmax(0, 1fr) 360px; gap: 14px; }
.av2-hlist, .av2-gear, .av2-side { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; }
.av2-side { gap: 12px; }
.av2-hlist button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: #e8eefc; font: inherit; cursor: pointer; }
.av2-hlist button.on { border-color: var(--accent); background: #13233b; }
.av2-hlist button > span { display: grid; flex: 1; min-width: 0; }
.av2-hlist small { color: var(--muted); font-size: .75rem; }
.av2-hlist i { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }
.av2 .fantasy-class-icon { margin: 0; flex: none; }
.av2-gearrow { --c: #fff; display: grid; grid-template-columns: 96px minmax(0, 1fr) 46px 150px; align-items: center; gap: 10px; padding: 8px 12px; text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: #e8eefc; font: inherit; cursor: pointer; }
.av2-gearrow.on { border: 2px solid var(--accent); background: #13233b; }
.av2-slot { font-size: .68rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.av2-gearrow b { color: var(--accent); }
.av2-gearrow > small { font-size: .78rem; color: #b8c6e0; text-align: right; }
.av2-arrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--accent); font-weight: 800; }
.av2-arrow span { padding: 5px 12px; border-radius: 10px; background: var(--soft); color: #e8eefc; font-size: 1.05rem; }
.av2-arrow span.to { background: #0e3946; color: #a8efff; }
.av2-arrow span.rar { --c: #fff; background: transparent; border: 1px solid var(--c); color: var(--c); font-size: .9rem; }
.av2-arrow small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.av2-compare { display: grid; gap: 4px; }
.av2-compare > div { display: grid; grid-template-columns: minmax(0, 1fr) 56px 16px 56px; gap: 6px; font-size: .9rem; color: var(--muted); }
.av2-compare span { color: #e8eefc; }
.av2-compare em { font-style: normal; text-align: right; }
.av2-compare strong { color: #9ff0c4; }

/* Fabrication */
.av2-craft { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.av2-steps { display: flex; flex-direction: column; gap: 16px; overflow: auto; min-width: 0; padding-right: 4px; }
.av2-step { display: grid; gap: 8px; }
.av2-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.av2-types button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: #b8c6e0; font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer; }
.av2-roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.av2-roles button { display: grid; gap: 2px; padding: 10px; border-radius: 12px; border: 1px solid #2c4060; background: transparent; color: #e8eefc; font: inherit; cursor: pointer; }
.av2-roles small { color: var(--muted); font-size: .72rem; }
.av2-ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.av2-ranks button { display: grid; gap: 2px; padding: 10px; text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: #e8eefc; font: inherit; cursor: pointer; }
.av2-ranks strong { font-size: 1.15rem; color: var(--accent); }
.av2-ranks span { font-size: .8rem; color: #b8c6e0; }
.av2-ranks small { font-size: .7rem; color: var(--muted); }
.av2-types button.on, .av2-roles button.on, .av2-ranks button.on { border: 2px solid var(--accent); background: #13233b; color: #e8eefc; }
.av2-preview { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: #13233b; border: 1px solid #2c4060; overflow: auto; }
.av2-ptitle { font-size: 1.15rem; }
.av2-odd { display: grid; grid-template-columns: 90px minmax(0, 1fr) 44px; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; }
.av2-odd i, .av2-range input { display: block; }
.av2-odd i { height: 8px; border-radius: 9px; background: #1f2d45; overflow: hidden; }
.av2-odd s { display: block; height: 8px; text-decoration: none; }
.av2-odd b { text-align: right; }
.av2-costs { display: grid; gap: 5px; padding-top: 10px; border-top: 1px solid #2c4060; margin-top: auto; }

/* Recyclage */
.av2-recycle { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.av2-rlist { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.av2-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.av2-chips button { min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid #2c4060; background: transparent; color: #b8c6e0; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.av2-chips button.on { border: 2px solid var(--accent); background: #13233b; color: #e8eefc; }
.av2-table { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.av2-trow { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) 180px 140px; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid #1a2840; cursor: pointer; }
.av2-trow:first-child { border-top: 0; }
.av2-trow.on { background: #13233b; }
.av2-trow input { width: 18px; height: 18px; accent-color: var(--accent); }
.av2-trow > small { color: #b8c6e0; font-size: .78rem; }
.av2-trow b { font-size: .82rem; text-align: right; }
.av2-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--accent); color: var(--accent); font-weight: 800; font-size: .8rem; }
.av2-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: #13233b; border: 1px solid #2c4060; }
.av2-bar > div { display: grid; flex: 1; }
.av2-bar small { color: var(--muted); }
.av2-convert { display: flex; align-items: center; gap: 8px; }
.av2-convert > div { flex: 1; display: grid; justify-items: center; padding: 10px; border-radius: 12px; background: #0e1828; }
.av2-convert span { font-size: .75rem; color: var(--muted); }
.av2-convert strong { font-size: 1.4rem; }
.av2-convert .ether { color: #d4c4ff; }
.av2-convert svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; flex: none; }
.av2-range { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.av2-range strong { color: #e8eefc; }
.av2-range input { width: 100%; accent-color: var(--accent); }
.av2-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.av2-check input { width: 18px; height: 18px; accent-color: var(--accent); }

@media (max-width: 1000px) {
  .av2-body { overflow: auto; }
  .av2-chest, .av2-up, .av2-craft, .av2-recycle { grid-template-columns: 1fr; }
  .av2-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .av2-trow { grid-template-columns: 22px 30px minmax(0, 1fr) auto; }
  .av2-trow > small { display: none; }
}

/* Amélioration : portée (Éveillé / Groupe / Bâtiment) et filtres */
.av2-hlist .av2-seg { margin-bottom: 6px; }
.av2-upfilters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.av2-gearrow.multi { grid-template-columns: 120px 90px minmax(0, 1fr) 46px 150px; }
.av2-who { font-size: .8rem; font-weight: 700; color: #e8eefc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av2-hlist .av2-seg button { flex: 1; justify-content: center; min-width: 0; padding: 0 4px; border: 0; border-radius: 8px; background: transparent; color: #b8c6e0; font-size: .8rem; }
.av2-hlist .av2-seg button.on { background: #22324d; color: #e8eefc; }

/* Gestion de masse */
.av2-mass { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: #13233b; border: 1px solid #2c4060; }
.av2-mass .av2-seg button { flex: 1; }
.av2-masscost { display: grid; gap: 4px; }

/* Équipements Uniques : bloc de set (Atelier, fiche d'Éveillé) */
.uq-set { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(239, 68, 68, .55); background: rgba(239, 68, 68, .08); }
.uq-set strong { color: #ff8a8a; font-size: .86rem; }
.uq-set small { color: #8ea0bf; font-size: .76rem; }
.uq-set ul { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 3px; }
.uq-set li { font-size: .8rem; color: #8ea0bf; }
.uq-set li b { display: inline-block; min-width: 70px; color: #b8c6e0; }
.uq-set li.on { color: #ffd0d0; }
.uq-set li.on b { color: #ff6b6b; }
.uq-set li.on b::before { content: '✓ '; }
.eq-slot .eq-talent.uq, .eq-talent.uq { color: #ff8a8a; }

/* Icônes « Cristal d'Éther » : l'hexagone remplace le fond des cases d'icône */
.av2-ibox:has(.eq-cristal), .eq-icon:has(.eq-cristal), .pv-sico:has(.eq-cristal) { background: transparent; border-radius: 0; overflow: visible; }
.eq-cristal { display: block; flex: none; overflow: visible; }
.av2-typelist .eq-cristal, .av2-types .eq-cristal { margin: -2px 0; }
.eq-summary-head h3 { display: flex; align-items: center; gap: 8px; }
.ga-tile .eq-cristal { margin-top: 2px; }
