.d4eq-planner {
  --d4eq-bg: #0b0b0e;
  --d4eq-panel: #15151a;
  --d4eq-panel-2: #1d1d24;
  --d4eq-line: #2f2e34;
  --d4eq-line-strong: #5f584b;
  --d4eq-accent: #c69a45;
  --d4eq-red: #9e252e;
  --d4eq-muted: #898793;
  --d4eq-text: #ececf1;
  width: min(760px, calc(100vw - 40px));
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
  color: var(--d4eq-text);
  background: var(--d4eq-bg);
  border: 1px solid #2c2b30;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .38);
}
.d4eq-planner * { box-sizing: border-box; }
.d4eq-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 20px 24px 17px; border-bottom: 1px solid var(--d4eq-line); background: linear-gradient(180deg, #17171b, #101014); }
.d4eq-header h2 { margin: 2px 0 0; color: #fff; font-family: Georgia, serif; font-size: 27px; line-height: 1; font-weight: 500; }
.d4eq-header p { margin: 7px 0 0; color: var(--d4eq-muted); }
.d4eq-kicker { color: #c63a42 !important; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.d4eq-classes { max-width: 590px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.d4eq-class { border: 1px solid var(--d4eq-line); background: #18181d; color: #aaa8b1; padding: 8px 10px; border-radius: 2px; cursor: pointer; font: inherit; font-size: 12px; }
.d4eq-class:hover { color: #fff; border-color: #55525a; }
.d4eq-class.is-active { color: #fff; border-color: #74333a; background: linear-gradient(180deg, #3a1b20, #231418); box-shadow: inset 0 -2px #b8323b; }

.d4eq-gear-shell { padding: 18px; background: radial-gradient(ellipse at 50% 35%, rgba(102, 80, 58, .15), transparent 46%), #0d0d10; }
.d4eq-paperdoll {
  min-height: 670px;
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr) 150px;
  grid-template-rows: 44px 455px auto;
  grid-template-areas: "topline topline topline" "armor avatar jewelry" "weapons weapons weapons";
  column-gap: 14px;
  position: relative;
  overflow: hidden;
  padding: 0 18px 18px;
  border: 1px solid #353238;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(119, 100, 73, .17), transparent 37%),
    linear-gradient(180deg, #161619, #0d0d10 72%);
}
.d4eq-paperdoll::before { content: ""; position: absolute; inset: 50px 165px 155px; pointer-events: none; border: 1px solid rgba(164,139,96,.08); border-radius: 48% 48% 30% 30%; box-shadow: inset 0 0 80px rgba(0,0,0,.46); }
.d4eq-paperdoll__topline { grid-area: topline; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; border-bottom: 1px solid rgba(103,98,91,.34); color: #d6d2cb; }
.d4eq-paperdoll__topline strong { font-family: Georgia, serif; font-size: 15px; font-weight: 500; letter-spacing: .04em; }
.d4eq-paperdoll__topline span { color: #817e84; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.d4eq-paperdoll__armor { grid-area: armor; display: flex; flex-direction: column; justify-content: flex-start; gap: 10px; padding-top: 12px; }
.d4eq-paperdoll__jewelry { grid-area: jewelry; display: flex; flex-direction: column; justify-content: flex-start; gap: 10px; padding-top: 12px; }
.d4eq-paperdoll__avatar { grid-area: avatar; position: relative; z-index: 0; display: flex; align-items: center; justify-content: flex-end; flex-direction: column; min-width: 0; padding-top: 18px; color: #77747b; }
.d4eq-paperdoll__avatar::after { content: ""; position: absolute; z-index: -1; width: 280px; height: 48px; bottom: 27px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.9), transparent 68%); }
.d4eq-paperdoll__character-art { width: 100%; height: 410px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 18px 18px rgba(0,0,0,.72)); user-select: none; pointer-events: none; }
.d4eq-paperdoll__avatar[data-d4eq-avatar="barbarian"] { justify-content: center; mix-blend-mode: screen; }
.d4eq-paperdoll__avatar[data-d4eq-avatar="barbarian"] .d4eq-paperdoll__character-art { width: 100%; height: 100%; max-height: 430px; object-position: center; mix-blend-mode: screen; filter: none; }
.d4eq-paperdoll__avatar span { position: absolute; bottom: 12px; color: #716f76; font-family: Georgia, serif; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }

.d4eq-paperdoll__slot { width: 100%; min-width: 0; height: 74px; display: grid; align-items: center; gap: 9px; position: relative; z-index: 1; overflow: visible; padding: 4px; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; text-align: left; }
.d4eq-paperdoll__slot-icon { width: 66px; height: 66px; display: grid; place-items: center; overflow: hidden; position: relative; border: 2px solid #4a4339; outline: 1px solid #19181b; background: radial-gradient(circle at 50% 38%, #302e2c, #141417 70%); box-shadow: inset 0 0 0 2px #252328, 0 5px 12px rgba(0,0,0,.5); transition: border-color .16s, box-shadow .16s, transform .16s; }
.d4eq-paperdoll__slot-icon::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(205,174,111,.11); pointer-events: none; }
.d4eq-paperdoll__slot-icon img { width: 52px; height: 52px; object-fit: contain; opacity: .64; filter: grayscale(.9) brightness(1.03) sepia(.12); }
.d4eq-paperdoll__gem-badges { position: absolute; right: 2px; bottom: 2px; z-index: 2; display: flex; gap: 2px; }
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-icon .d4eq-paperdoll__gem-badges img.d4eq-paperdoll__gem-badge { width: 13px; height: 13px; border: 1.5px solid #17151a; border-radius: 50%; background: #1c1b21; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.7); opacity: 1; filter: none; }
.d4eq-paperdoll__slot-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.d4eq-paperdoll__slot-label { overflow: hidden; color: #d1cdc5; font-family: Georgia, serif; font-size: 13px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.d4eq-paperdoll__slot-state { overflow: hidden; color: #66636b; font-size: 10px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.d4eq-paperdoll__slot:hover .d4eq-paperdoll__slot-icon,
.d4eq-paperdoll__slot.is-selected .d4eq-paperdoll__slot-icon { border-color: #9a773c; box-shadow: inset 0 0 0 2px #322820, 0 0 20px rgba(190,132,49,.2); transform: translateY(-1px); }
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-icon { border-color: #b0642e; background: radial-gradient(circle at 50% 38%, #4a2a18, #171313 72%); }
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-icon img { opacity: .94; filter: none; }
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-state { color: #c37d40; }
.d4eq-paperdoll__slot.is-filled.d4eq-paperdoll__slot--r-magic .d4eq-paperdoll__slot-state { color: #8c8cff; }
.d4eq-paperdoll__slot.is-filled.d4eq-paperdoll__slot--r-rare .d4eq-paperdoll__slot-state { color: #ffff00; }
.d4eq-paperdoll__slot.is-filled.d4eq-paperdoll__slot--r-legendary .d4eq-paperdoll__slot-state { color: #ff8a1f; }
.d4eq-paperdoll__slot.is-filled.d4eq-paperdoll__slot--r-unique .d4eq-paperdoll__slot-state { color: #dca779; }
.d4eq-paperdoll__slot.is-filled.d4eq-paperdoll__slot--r-mythic .d4eq-paperdoll__slot-state { color: #dc9bf2; }
.d4eq-paperdoll__slot.is-filled.d4eq-paperdoll__slot--r-magic .d4eq-paperdoll__slot-icon { border-color: #4f4fb0; background: radial-gradient(circle at 50% 38%, #1f1f4a, #131317 72%); }
.d4eq-paperdoll__slot.is-filled.d4eq-paperdoll__slot--r-rare .d4eq-paperdoll__slot-icon { border-color: #b3ad1a; background: radial-gradient(circle at 50% 38%, #3d3816, #151413 72%); }
.d4eq-paperdoll__slot.is-filled.d4eq-paperdoll__slot--r-legendary .d4eq-paperdoll__slot-icon { border-color: #c8642a; box-shadow: inset 0 0 0 2px #4a2614, 0 0 14px rgba(255,128,0,.28); }
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-icon--unique { border-color: #c4956a; background: radial-gradient(circle at 50% 38%, #46301c, #171313 72%); box-shadow: inset 0 0 0 2px #4a3420, 0 0 16px rgba(220,167,121,.35); }
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-icon--unique img,
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-icon--art img { width: 60px; height: 60px; }
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-icon--mythic { border-color: #b34bf0; background: radial-gradient(circle at 50% 38%, #3a1650, #171313 72%); box-shadow: inset 0 0 0 2px #4a1f66, 0 0 20px rgba(179,75,240,.45); }
.d4eq-paperdoll__slot.is-filled .d4eq-paperdoll__slot-icon--mythic img { width: 60px; height: 60px; }
.d4eq-paperdoll__slot.is-filled:hover,
.d4eq-paperdoll__slot.is-filled:focus-visible,
.d4eq-paperdoll__slot.is-tooltip-open { z-index: 40; }
.d4eq-equipped-tooltip {
  width: min(330px, 72vw);
  max-height: min(420px, calc(100vh - 24px));
  margin: 0;
  position: absolute;
  z-index: 50;
  overflow: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  color: #ddd7cb;
  text-align: left;
  white-space: normal;
  box-shadow: 0 20px 50px rgba(0,0,0,.82), inset 0 0 35px rgba(91,52,20,.16);
  transform: translateY(-50%) scale(.98);
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
}
.d4eq-paperdoll__slot.is-filled:hover > .d4eq-equipped-tooltip,
.d4eq-paperdoll__slot.is-filled:focus-visible > .d4eq-equipped-tooltip,
.d4eq-paperdoll__slot.is-tooltip-open > .d4eq-equipped-tooltip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
.d4eq-paperdoll__armor .d4eq-equipped-tooltip { top: 50%; left: calc(100% + 10px); }
.d4eq-paperdoll__jewelry .d4eq-equipped-tooltip { top: 50%; right: calc(100% + 10px); }
.d4eq-paperdoll__weapon-slot .d4eq-equipped-tooltip {
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 5px) scale(.98);
}
.d4eq-paperdoll__weapon-slot.is-filled:hover > .d4eq-equipped-tooltip,
.d4eq-paperdoll__weapon-slot.is-filled:focus-visible > .d4eq-equipped-tooltip,
.d4eq-paperdoll__weapon-slot.is-tooltip-open > .d4eq-equipped-tooltip { transform: translate(-50%, 0) scale(1); }
/* Only the topmost slot in each column is safe to anchor from its own top edge and
   grow downward without risking the (variable-height, can exceed 400px with
   masterwork/gems/tempering all filled in) tooltip running past the viewport bottom. */
.d4eq-paperdoll__slot[data-d4eq-slot="helm"] > .d4eq-equipped-tooltip,
.d4eq-paperdoll__slot[data-d4eq-slot="amulet"] > .d4eq-equipped-tooltip {
  top: 0;
  bottom: auto;
  transform: scale(.98);
}
/* Likewise only the bottommost slots are safe anchored-bottom/grow-upward. Every
   other slot (chest, gloves, ring_1, ring_2) keeps the default vertically-centered
   anchor from .d4eq-paperdoll__armor/.d4eq-paperdoll__jewelry above, which gives a
   tall tooltip room to grow both up and down instead of only one direction. */
.d4eq-paperdoll__slot[data-d4eq-slot="pants"] > .d4eq-equipped-tooltip,
.d4eq-paperdoll__slot[data-d4eq-slot="boots"] > .d4eq-equipped-tooltip {
  top: auto;
  bottom: 0;
  transform: scale(.98);
}
.d4eq-paperdoll__slot[data-d4eq-slot="helm"]:is(:hover, :focus-visible, .is-tooltip-open) > .d4eq-equipped-tooltip,
.d4eq-paperdoll__slot[data-d4eq-slot="pants"]:is(:hover, :focus-visible, .is-tooltip-open) > .d4eq-equipped-tooltip,
.d4eq-paperdoll__slot[data-d4eq-slot="boots"]:is(:hover, :focus-visible, .is-tooltip-open) > .d4eq-equipped-tooltip,
.d4eq-paperdoll__slot[data-d4eq-slot="amulet"]:is(:hover, :focus-visible, .is-tooltip-open) > .d4eq-equipped-tooltip { transform: scale(1); }
.d4eq-paperdoll__slot.is-disabled { opacity: .3; cursor: not-allowed; }
.d4eq-paperdoll__armor .d4eq-paperdoll__slot { grid-template-columns: minmax(0, 1fr) 66px; }
.d4eq-paperdoll__armor .d4eq-paperdoll__slot-icon { grid-column: 2; grid-row: 1; }
.d4eq-paperdoll__armor .d4eq-paperdoll__slot-copy { grid-column: 1; grid-row: 1; text-align: right; }
.d4eq-paperdoll__jewelry .d4eq-paperdoll__slot { grid-template-columns: 66px minmax(0, 1fr); }
.d4eq-paperdoll__jewelry .d4eq-paperdoll__slot-icon { grid-column: 1; }
.d4eq-paperdoll__jewelry .d4eq-paperdoll__slot-copy { grid-column: 2; }

.d4eq-paperdoll__weapons { grid-area: weapons; align-self: end; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 8px; position: relative; z-index: 2; padding: 28px 8px 0; border-top: 1px solid rgba(103,98,91,.28); }
.d4eq-paperdoll__weapon-title { position: absolute; top: 8px; left: 0; width: 100%; color: #77737a; font-size: 9px; font-weight: 800; letter-spacing: .15em; text-align: center; text-transform: uppercase; }
.d4eq-paperdoll__weapon-slot { width: min(180px, calc(25% - 8px)); height: 86px; grid-template-columns: 58px minmax(0, 1fr); padding: 5px; border: 1px solid rgba(91,83,70,.24); background: rgba(20,19,21,.7); }
.d4eq-paperdoll__weapon-slot .d4eq-paperdoll__slot-icon { width: 58px; height: 76px; }
.d4eq-paperdoll__weapon-slot .d4eq-paperdoll__slot-icon img { width: 48px; height: 64px; }
.d4eq-paperdoll__weapons[data-d4eq-weapon-layout="single_two_handed"] .d4eq-paperdoll__weapon-slot { width: 220px; }
.d4eq-paperdoll__weapons[data-d4eq-weapon-layout="two_handed_or_main_offhand"] .d4eq-paperdoll__weapon-slot { width: 220px; }

.d4eq-inspector { min-width: 0; padding: 18px; border: 1px solid #2d2d35; border-radius: 4px; background: var(--d4eq-panel); }
.d4eq-inspector__head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--d4eq-line); }
.d4eq-inspector__head h3 { margin: 0; color: #fff; font-size: 17px; }
.d4eq-inspector__head span { color: #777786; font-size: 11px; text-transform: uppercase; }
.d4eq-picker-tabs { display: flex; gap: 3px; margin-top: 14px; padding: 4px; background: #111116; border-radius: 4px; }
.d4eq-picker-tabs button { flex: 1; border: 0; border-radius: 3px; padding: 9px; background: transparent; color: #777786; cursor: pointer; }
.d4eq-picker-tabs button.is-active { color: #fff; background: #292931; }
.d4eq-picker-note { margin: 12px 0; color: #858594; font-size: 12px; }
.d4eq-picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.d4eq-picker-grid section { min-width: 0; max-height: 290px; overflow: auto; padding: 10px; border: 1px solid #292931; background: #121217; }
.d4eq-picker-grid h4 { margin: 0 0 8px; color: #b8b8c2; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.d4eq-pick-row { width: 100%; display: block; margin: 0; padding: 9px 8px; border: 0; border-bottom: 1px solid #292931; background: transparent; color: #dddde3; text-align: left; cursor: pointer; }
.d4eq-pick-row:hover { background: #222229; }
.d4eq-pick-row.is-selected { background: linear-gradient(90deg, rgba(86,112,72,.28), rgba(36,45,34,.55)); box-shadow: inset 3px 0 #91ae65; }
.d4eq-pick-row strong, .d4eq-pick-row em, .d4eq-pick-row span { display: block; }
.d4eq-pick-row strong { color: #d4d4da; font-size: 12px; }
.d4eq-pick-row em { margin-top: 3px; color: #b38b49; font-size: 9px; font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
.d4eq-pick-row span { margin-top: 3px; color: #777786; font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d4eq-pick-check { display: inline-block; margin-top: 5px; color: #a8ca7e; font-size: 10px; font-weight: 800; }
.d4eq-pick-row.has-icon { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 10px; }
.d4eq-pick-row__icon { grid-column: 1; grid-row: 1 / span 4; align-self: start; width: 40px; height: 40px; object-fit: contain; border: 1px solid #3a3742; border-radius: 3px; background: radial-gradient(circle at 50% 38%, #242229, #151318 72%); padding: 3px; }
.d4eq-pick-row__icon.is-unique { border-color: #c4956a; box-shadow: 0 0 8px rgba(220,167,121,.25); }
.d4eq-pick-row__icon.is-mythic { border-color: #b34bf0; box-shadow: 0 0 8px rgba(179,75,240,.35); }
.d4eq-pick-subheading { margin: 12px 0 4px; padding-top: 8px; border-top: 1px solid #2f2e34; color: #c78dfa; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.d4eq-tempering-recipe { border-bottom: 1px solid #292931; }
.d4eq-tempering-recipe .d4eq-pick-row { border-bottom: 0; }
.d4eq-tempering-recipe.has-selection > .d4eq-pick-row { box-shadow: inset 3px 0 #b38b49; }
.d4eq-tempering-recipe.is-expanded > .d4eq-pick-row { background: #1c1c22; }
.d4eq-tempering-tier { padding: 6px 8px 10px 18px; background: #0e0e12; }
.d4eq-tempering-tier h6 { margin: 6px 0 4px; color: #858594; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.d4eq-tempering-tier .d4eq-pick-row { border: 1px solid #292931; border-radius: 3px; margin-bottom: 4px; padding: 7px 8px; }
.d4eq-empty { color: #696977; font-size: 12px; }
.d4eq-hint { margin: 0 0 8px; color: #7d7d8e; font-size: 10px; line-height: 1.4; }
.d4eq-selected-affixes { margin-top: 14px; padding: 12px; border: 1px solid #343039; background: #111116; }
.d4eq-selected-affixes > h4 { margin: 0 0 10px; color: #b8b8c2; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.d4eq-mythic-upgrade { margin-top: 14px; padding: 10px 12px; border: 1px solid #4b2f5e; background: #150f1a; }
.d4eq-mythic-upgrade__toggle { display: flex; align-items: center; gap: 8px; color: #dc9bf2; font-size: 13px; font-weight: 600; cursor: pointer; }
.d4eq-mythic-upgrade__toggle input { accent-color: #b34bf0; width: 16px; height: 16px; margin: 0; }
.d4eq-mythic-upgrade__toggle input:focus-visible { outline: 2px solid #dc9bf2; outline-offset: 2px; }
.d4eq-mythic-upgrade .d4eq-hint { margin: 6px 0 0; }
.d4eq-selected-affix { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 10px 0; border-top: 1px solid #292931; }
.d4eq-selected-affix.is-greater { margin-inline: -7px; padding-inline: 7px; border-left: 2px solid #e1bc65; background: linear-gradient(90deg, rgba(123,89,35,.2), transparent 72%); }
.d4eq-selected-affix:first-of-type { border-top: 0; }
.d4eq-selected-affix strong { color: #ded9cf; font-size: 12px; }
.d4eq-selected-affix p { grid-column: 1; margin: 0; color: #8e8992; font-size: 11px; line-height: 1.4; }
.d4eq-affix-roll { grid-column: 2; grid-row: 2; display: flex; align-items: flex-end; flex-direction: column; gap: 5px; }
.d4eq-affix-roll span { color: #9a7d50; font-size: 9px; white-space: nowrap; }
.d4eq-affix-roll.is-greater strong { color: #f1ce75; font-family: Georgia, serif; font-size: 17px; text-shadow: 0 0 10px rgba(231,180,69,.3); }
.d4eq-affix-roll--manual { grid-column: 1 / -1; grid-row: auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.d4eq-affix-roll--manual input { width: 128px; box-sizing: border-box; border: 1px solid #5e4931; border-radius: 2px; padding: 7px 6px; background: #1c1712; color: #f0c878; font: inherit; font-size: 13px; text-align: center; outline: none; }
.d4eq-affix-roll--manual input:focus { border-color: #c38a43; box-shadow: 0 0 0 2px rgba(195,138,67,.16); }
.d4eq-affix-roll--manual input::placeholder { color: #6e5a3a; }
.d4eq-manual-block p { grid-column: 1 / -1; }
.d4eq-stepper { display: inline-flex; align-items: stretch; width: 128px; border: 1px solid #5e4931; border-radius: 2px; overflow: hidden; background: #1c1712; transition: border-color .12s, box-shadow .12s; }
.d4eq-stepper:focus-within { border-color: #c38a43; box-shadow: 0 0 0 2px rgba(195,138,67,.16); }
.d4eq-stepper input[type="number"] { flex: 1; min-width: 0; border: 0; padding: 7px 4px; background: transparent; color: #f0c878; font: inherit; font-size: 13px; text-align: center; outline: none; -moz-appearance: textfield; }
.d4eq-stepper input[type="number"]::-webkit-inner-spin-button,
.d4eq-stepper input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.d4eq-stepper__btn { flex: 0 0 26px; border: 0; background: #211b13; color: #b38b49; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; transition: background .12s, color .12s; }
.d4eq-stepper__btn--down { border-right: 1px solid #3a2f22; }
.d4eq-stepper__btn--up { border-left: 1px solid #3a2f22; }
.d4eq-stepper__btn:hover { background: #332818; color: #f3d27b; }
.d4eq-stepper__btn:active { background: #3d2f19; }
.d4eq-masterwork { margin-top: 14px; padding: 12px; border: 1px solid #343039; background: #111116; }
.d4eq-masterwork > h4 { margin: 0 0 10px; color: #b8b8c2; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.d4eq-masterwork-rank { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #9a7d50; font-size: 12px; }
.d4eq-masterwork-tier { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; color: #9a7d50; font-size: 12px; }
.d4eq-masterwork-tier select { min-width: 0; flex: 1; max-width: 260px; border: 1px solid #5e4931; border-radius: 2px; padding: 7px 8px; background: #1c1712; color: #f0c878; font: inherit; font-size: 12px; }
.d4eq-affix-locked-badge { grid-column: 2; grid-row: 1; align-self: start; color: #80735a; font-size: 10px; white-space: nowrap; }
.d4eq-selected-gem { position: relative; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 2px 10px; }
.d4eq-selected-gem-icon { grid-row: 1 / -1; width: 34px; height: 34px; object-fit: contain; border: 1px solid #3a3742; border-radius: 3px; background: radial-gradient(circle at 50% 38%, #242229, #151318 72%); padding: 3px; }
.d4eq-selected-affix__remove { position: absolute; top: 8px; right: 0; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #3a3742; border-radius: 50%; background: #1c1b21; color: #9a95a0; font-size: 10px; line-height: 1; cursor: pointer; transition: border-color .16s, color .16s; }
.d4eq-selected-affix__remove:hover { border-color: #c0503a; color: #e0796a; }
.d4eq-tooltip__gem { display: flex !important; align-items: center; gap: 8px; }
.d4eq-tooltip__gem-icon { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; border: 1px solid #4a3714; border-radius: 2px; background: #171313; padding: 2px; }
.d4eq-greater-affix-toggle { grid-column: 2; grid-row: 1; align-self: start; border: 1px solid #504633; border-radius: 2px; padding: 6px 8px; background: #191713; color: #80735a; font: inherit; font-size: 10px; cursor: pointer; white-space: nowrap; }
.d4eq-greater-affix-toggle:hover { border-color: #9d8148; color: #d5b66d; }
.d4eq-greater-affix-toggle.is-active { border-color: #d3a94e; background: linear-gradient(180deg, #463616, #211a0f); color: #f3d27b; box-shadow: 0 0 12px rgba(216,166,59,.18), inset 0 1px rgba(255,255,255,.08); }
.d4eq-tooltip { margin-top: 14px; padding: 15px; border: 1px solid #7b5a27; background: #17130d; }
.d4eq-tooltip--legendary { border-color: #b2632d; box-shadow: 0 0 16px rgba(178,99,45,.16); }
.d4eq-tooltip--unique { border-color: #c4956a; box-shadow: 0 0 22px rgba(220,167,121,.32), inset 0 0 30px rgba(220,167,121,.06); }
.d4eq-tooltip--mythic { border-color: #b34bf0; box-shadow: 0 0 28px rgba(179,75,240,.5), inset 0 0 34px rgba(179,75,240,.1); }
.d4eq-tooltip__header { display: flex; align-items: flex-start; gap: 10px; }
.d4eq-tooltip__header-icon { flex: 0 0 auto; width: 44px; height: 44px; object-fit: contain; border: 1px solid #4a3714; border-radius: 3px; background: radial-gradient(circle at 50% 38%, #2e2410, #171313 72%); padding: 3px; }
.d4eq-tooltip--unique .d4eq-tooltip__header-icon { border-color: #c4956a; box-shadow: 0 0 10px rgba(220,167,121,.35); }
.d4eq-tooltip--mythic .d4eq-tooltip__header-icon { border-color: #b34bf0; box-shadow: 0 0 12px rgba(179,75,240,.55); }
.d4eq-tooltip__header-text { min-width: 0; }
.d4eq-tooltip__name { color: #e2bb65; font-family: Georgia, serif; font-size: 19px; }
.d4eq-tooltip--unique .d4eq-tooltip__name { color: #dca779; text-shadow: 0 0 12px rgba(220,167,121,.4); }
.d4eq-tooltip--mythic .d4eq-tooltip__name { color: #d9a4fa; text-shadow: 0 0 14px rgba(217,164,250,.55); }
.d4eq-tooltip__subtitle { margin: 4px 0 10px; color: #9b8564; font-size: 12px; }
.d4eq-tooltip__ga-count { margin: -4px 0 9px; color: #e4bd61; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.d4eq-tooltip__section { padding-top: 9px; border-top: 1px solid rgba(190,145,71,.25); }
.d4eq-tooltip p { margin: 5px 0; font-size: 12px; line-height: 1.45; }
.d4eq-tooltip__affix.is-greater { color: #f0d17d; text-shadow: 0 0 8px rgba(218,165,57,.18); }
.d4eq-ga-star { color: #ffd36a; font-size: 13px; }
.d4eq-tooltip__aspect strong { color: #d47f39; }
.d4eq-tooltip__unique strong { color: #dca779; }
.d4eq-error { padding: 20px; color: #ff8d8d; background: #251111; }

.d4eq-modal { position: fixed; z-index: 999999; inset: 0; display: grid; place-items: center; padding: 24px; }
.d4eq-modal__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(4, 4, 7, .82); backdrop-filter: blur(4px); cursor: default; }
.d4eq-modal__dialog { position: relative; z-index: 1; width: min(760px, calc(100vw - 36px)); max-height: calc(100vh - 42px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #4a4a56; border-radius: 5px; background: #121217; box-shadow: 0 28px 90px rgba(0,0,0,.72); }
.d4eq-modal__head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid #303038; background: linear-gradient(180deg, #1d1d24, #17171d); }
.d4eq-modal__head div { display: flex; flex-direction: column; gap: 3px; }
.d4eq-modal__head span { color: #7d7d8e; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.d4eq-modal__head strong { color: #fff; font-size: 20px; }
.d4eq-modal__head button { width: 38px; height: 38px; border: 1px solid #3b3b45; border-radius: 3px; background: #202027; color: #aaaab5; font-size: 26px; line-height: 1; cursor: pointer; }
.d4eq-modal__head button:hover { color: #fff; border-color: #60606e; }
.d4eq-modal__body { min-height: 0; overflow: auto; padding: 16px; }
.d4eq-modal__body .d4eq-inspector { border: 0; padding: 0; background: transparent; }
.d4eq-modal__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid #303038; background: #17171d; }
.d4eq-modal__footer button { min-width: 138px; border-radius: 3px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.d4eq-modal__cancel { border: 1px solid #3b3b45; background: #202027; color: #a6a6b1; }
.d4eq-modal__commit { border: 1px solid #9d343c; background: linear-gradient(180deg, #a92c36, #721e25); color: #fff; box-shadow: inset 0 1px rgba(255,255,255,.13); }
.d4eq-modal__commit:hover { background: linear-gradient(180deg, #bd3540, #81232a); }

@media (max-width: 760px) {
  .d4eq-header { align-items: flex-start; flex-direction: column; }
  .d4eq-classes { justify-content: flex-start; }
  .d4eq-gear-shell { padding: 10px; }
  .d4eq-paperdoll { min-height: 570px; grid-template-columns: 96px minmax(130px, 1fr) 96px; grid-template-rows: 40px 390px auto; column-gap: 5px; padding: 0 6px 10px; }
  .d4eq-paperdoll::before { inset: 46px 102px 140px; }
  .d4eq-paperdoll__armor, .d4eq-paperdoll__jewelry { gap: 5px; padding-top: 9px; }
  .d4eq-paperdoll__slot { height: 66px; }
  .d4eq-paperdoll__slot-icon { width: 58px; height: 58px; }
  .d4eq-paperdoll__slot-icon img { width: 46px; height: 46px; }
  .d4eq-paperdoll__armor .d4eq-paperdoll__slot { grid-template-columns: minmax(0, 1fr) 58px; }
  .d4eq-paperdoll__jewelry .d4eq-paperdoll__slot { grid-template-columns: 58px minmax(0, 1fr); }
  .d4eq-paperdoll__slot-copy { display: none; }
  .d4eq-paperdoll__character-art { width: 100%; height: 340px; }
  .d4eq-paperdoll__weapon-slot { width: 72px !important; height: 72px; display: block; padding: 4px; }
  .d4eq-paperdoll__weapon-slot .d4eq-paperdoll__slot-icon { width: 62px; height: 62px; }
  .d4eq-paperdoll__weapon-slot .d4eq-paperdoll__slot-icon img { width: 52px; height: 52px; }
  .d4eq-paperdoll__weapons { gap: 5px; padding-inline: 0; }
}
@media (max-width: 620px) {
  .d4eq-planner { width: calc(100vw - 20px); }
  .d4eq-header { padding: 15px; }
  .d4eq-picker-grid { grid-template-columns: 1fr; }
  .d4eq-modal { padding: 10px; }
  .d4eq-modal__dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .d4eq-selected-affix { grid-template-columns: 1fr; }
  .d4eq-affix-roll, .d4eq-greater-affix-toggle { grid-column: 1; grid-row: auto; align-items: flex-start; justify-self: start; }
}

/* Sanctuary palette and accessible item editing. Author: vlad1116. */
.d4eq-planner { --d4eq-bg: #0c0b09; --d4eq-panel: #191611; --d4eq-line: #44382a; --d4eq-muted: #aaa092; --d4eq-text: #ede3d0; border-color: #695235; box-shadow: inset 0 0 0 3px #17130e, 0 20px 60px #0006; }
.d4eq-header { background: radial-gradient(ellipse at 10% 0, #50311e55, transparent 65%), linear-gradient(#251c15, #100e0b); border-bottom: 1px solid #735631; }
.d4eq-header h2 { color: #ebd8b4; text-shadow: 0 2px 3px #000; }
.d4eq-kicker { color: #c39b64 !important; }
.d4eq-class { background: linear-gradient(#231d17, #15120e); color: #bbae99; border-color: #4c3c2a; }
.d4eq-class.is-active { background: linear-gradient(#5a2520, #2b1510); border-color: #b4844c; box-shadow: inset 0 -2px #aa753d; color: #f7e3bc; }
.d4eq-gear-shell { background: radial-gradient(ellipse at 50% 40%, #51402822, transparent 65%), #0c0b09; }
.d4eq-paperdoll { border-color: #53432d; background: radial-gradient(ellipse at 50% 45%, #3d302033, transparent 60%), linear-gradient(#181510, #0c0b09); }
.d4eq-paperdoll__topline { border-color: #69533666; }
.d4eq-paperdoll__slot-state { font-size: 12px; color: #a09586; }
.d4eq-paperdoll__slot-label { font-size: 14px; }
.d4eq-paperdoll__weapons { border-color: #69533666; }
.d4eq-paperdoll__weapon-title { color: #b49b76; font-size: 11px; }
.d4eq-paperdoll__weapon-slot { background: #1c1811aa; border-color: #64503766; }
.d4eq-modal__dialog { border-color: #8b6a3d; border-radius: 2px; background: #15120e; box-shadow: 0 0 0 3px #0a0806, 0 30px 100px #000c; }
.d4eq-modal__head, .d4eq-modal__footer { background: linear-gradient(#2b2118, #1b150f); border-color: #57432c; }
.d4eq-modal__head strong, .d4eq-inspector__head h3 { color: #f0ddba; font-family: Georgia, serif; }
.d4eq-modal__head span { color: #b59a76; }
.d4eq-picker-tabs { background: #0e0c09; border: 1px solid #4d3b26; border-radius: 0; }
.d4eq-picker-tabs button { font: inherit; font-size: 13px; color: #b9ab96; }
.d4eq-picker-tabs button.is-active { background: linear-gradient(#4a2a1d, #2a1b12); color: #f0d7ad; box-shadow: inset 0 -2px #b4844c; }
.d4eq-picker-grid section { background: #100e0b; border-color: #493b29; }
.d4eq-pick-row { border-color: #4a3b2855; background: #1a1610; }
.d4eq-pick-row strong { color: #e8dcc5; font-size: 13px; }
.d4eq-pick-row span { white-space: normal; font-size: 12px; color: #b0a38f; line-height: 1.5; }
.d4eq-pick-row em { font-size: 10px; }
.d4eq-pick-row.is-selected { border-color: #b18b4d; background: #33271a; }
.d4eq-tempering-recipe { border-bottom-color: #4a3b2855; }
.d4eq-tempering-tier { background: #0d0b08; }
.d4eq-tempering-recipe.is-expanded > .d4eq-pick-row { background: #241c13; }
.d4eq-preview-label { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid #60482c; color: #c4a570; font: 15px Georgia, serif; }
.d4eq-search, .d4eq-item-type { display: flex; flex-direction: column; gap: 7px; margin: 14px 0; color: #c8b99f; font-size: 13px; }
.d4eq-search input, .d4eq-item-type select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #705333; border-radius: 2px; background: #0d0b08; color: #efe0c3; font: inherit; }
.d4eq-search input::placeholder { color: #988872; }
.d4eq-search-empty { padding: 12px; color: #d6ba8b; }
.d4eq-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; background: #272013; color: #ddc8a2; font-size: 13px; }
.d4eq-notice button { flex-shrink: 0; border: 1px solid #917044; padding: 6px 10px; background: #17110b; color: #f4d59e; cursor: pointer; font: inherit; }
.d4eq-modal__footer .d4eq-modal__remove { margin-right: auto; color: #dcaa9a; background: #2b1712; border: 1px solid #774738; }
.d4eq-modal__footer .d4eq-modal__cancel { background: #221c14; border-color: #6a5135; color: #d1bfa0; }
.d4eq-modal__footer .d4eq-modal__commit { border-color: #aa7840; background: linear-gradient(#733a24, #421e13); color: #ffe6ba; }
.d4eq-modal__footer button:disabled { opacity: .4; cursor: wait; }
.d4eq-planner :is(button, input, select):focus-visible { outline: 2px solid #e8b971; outline-offset: 3px; }
.d4eq-planner [hidden] { display: none !important; }
@media (max-width: 620px) {
  .d4eq-paperdoll { grid-template-columns: 74px minmax(100px, 1fr) 74px; padding-inline: 2px; }
  .d4eq-paperdoll__avatar[data-d4eq-avatar="barbarian"] .d4eq-paperdoll__character-art { width: 140%; max-width: none; height: 365px; }
  .d4eq-modal__footer { flex-wrap: wrap; padding: 12px; gap: 8px; }
  .d4eq-modal__footer button { min-width: 0; flex: 1 1 120px; font-size: 13px; }
  .d4eq-modal__footer .d4eq-modal__remove { flex: 1 1 100%; margin: 0; }
  .d4eq-modal__head { min-height: 62px; }
  .d4eq-modal__body { padding: 12px; }
  /* editor only: in the read-only view the block is a layout container, which would anchor position:fixed to the block */
  .d4eq-planner:not([data-d4eq-readonly]) .d4eq-equipped-tooltip { position: fixed; top: auto !important; right: 10px !important; bottom: 12px !important; left: 10px !important; width: auto; max-height: min(65vh, 520px); transform: none !important; z-index: 100000; }
}
@media (prefers-reduced-motion: reduce) { .d4eq-planner * { transition: none !important; } }

.d4eq-pick-row.has-icon > :not(.d4eq-pick-row__icon) { grid-column: 2; }

.d4eq-header.d4eq-header--view { padding: 10px 18px; align-items: center; gap: 12px; flex-direction: row; }
.d4eq-header--view span { color: #b0a38f; font-size: 12px; }
.d4eq-header--view strong { color: #e8dcc5; font: 17px Georgia, serif; }

.d4eq-pick-row__en { display: block; margin-top: 1px; color: #8f8a80; font-size: 11px; font-style: italic; }

/* Unique power value row (Horadric Cube "Unique Power Reroll"): unique-gold
   name, the power text keeps its own paragraph breaks. Author: vlad1116. */
.d4eq-selected-affix.is-unique-power strong { color: #e8a85a; }
.d4eq-selected-affix.is-unique-power p { white-space: pre-line; color: #b9ad9b; }

/* Horadric Cube transfiguration: its own tooltip line with a cube mark, and
   the selected row in the editor. Author: vlad1116. */
.d4eq-tooltip__affix.is-transfigured { color: #8fdccf; }
.d4eq-cube-mark { color: #5cc9b8; font-size: .9em; }
.d4eq-selected-transfiguration .d4eq-selected-affix strong { color: #8fdccf; }

/* Runes / runewords — full description with the game's colors: ritual
   condition gold, invocation effect purple, labels beige, numbers warm gold,
   skill names light. Author: vlad1116. */
.d4eq-rune { display: grid; gap: 2px; margin-top: 2px; }
.d4eq-rune p { margin: 0; font-size: 12px; line-height: 1.45; color: #c9c2b5; }
.d4eq-rune__label { color: #b69e7a; }
.d4eq-rune__value { color: #ce911a; font-weight: 600; }
.d4eq-rune__desc--ritual { color: #ce911a !important; }
.d4eq-rune__desc--invocation { color: #b866d1 !important; }
.d4eq-rune__important { color: #e3e0d9; }
.d4eq-rune__number { color: #dba864; }
.d4eq-rune-name.is-magic { color: #8c8cff; }
.d4eq-rune-name.is-rare { color: #ffff00; }
.d4eq-rune-name.is-legendary { color: #ff8000; }
.d4eq-rune-name em, .d4eq-tooltip__rune-head em { font-style: normal; font-size: 11px; color: #8e8992; margin-left: 4px; }
.d4eq-tooltip__rune { padding: 4px 0; }
.d4eq-tooltip__rune + .d4eq-tooltip__rune { border-top: 1px solid rgba(182,158,122,.18); }
.d4eq-tooltip__rune-head { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; }
.d4eq-pick-row__rune { display: block; }
.d4eq-selected-rune .d4eq-rune { grid-column: 1; }

/* ============================================================
   Game-style item tooltip. Author: vlad1116.
   Frame, rarity-tinted header, ornamental separators and line markers are
   drawn with CSS only (no game art files).
   ============================================================ */
.d4eq-tooltip {
  --tt-rarity: #b8afa1;
  --tt-glow: rgba(184,175,161,.18);
  --tt-text: #b8afa1;
  --tt-bright: #e3e0d9;
  --tt-line: #5b4a35;
  padding: 0 0 12px;
  color: var(--tt-text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.45;
  text-shadow: 0 0 2px #000;
  background:
    radial-gradient(120% 60% at 50% 0%, var(--tt-glow), transparent 60%),
    linear-gradient(180deg, #14110d 0%, #0c0a08 55%, #0a0806 100%);
  border: 1px solid #6c573a;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 3px #231c13, inset 0 0 0 4px #3d3122, 0 10px 30px rgba(0,0,0,.55);
}
/* The editor's preview sits in the flow; the hover tooltip on a filled slot
   (.d4eq-equipped-tooltip) keeps its own absolute/fixed placement. */
.d4eq-tooltip:not(.d4eq-equipped-tooltip) { position: relative; max-width: 380px; margin-top: 14px; }
.d4eq-tooltip::before, .d4eq-tooltip::after {
  content: ""; position: absolute; top: -4px; width: 8px; height: 8px;
  background: #0c0a08; border: 1px solid #a8885a; transform: rotate(45deg);
}
.d4eq-tooltip::before { left: -4px; }
.d4eq-tooltip::after { right: -4px; }
.d4eq-tooltip--rare { --tt-rarity: #ffff00; --tt-glow: rgba(255,255,0,.12); }
.d4eq-tooltip--legendary { --tt-rarity: #ff8a1f; --tt-glow: rgba(255,128,0,.2); border-color: #8a5a2c; box-shadow: inset 0 0 0 1px #000, inset 0 0 0 3px #231c13, inset 0 0 0 4px #4b3420, 0 10px 30px rgba(0,0,0,.55); }
.d4eq-tooltip--unique { --tt-rarity: #dca779; --tt-glow: rgba(220,167,121,.24); border-color: #9a7b4f; box-shadow: inset 0 0 0 1px #000, inset 0 0 0 3px #231c13, inset 0 0 0 4px #5a4630, 0 0 22px rgba(220,167,121,.18), 0 10px 30px rgba(0,0,0,.55); }
.d4eq-tooltip--mythic { --tt-rarity: #dc9bf2; --tt-glow: rgba(176,90,230,.3); border-color: #8b5aa8; box-shadow: inset 0 0 0 1px #000, inset 0 0 0 3px #1d1424, inset 0 0 0 4px #4b2f5e, 0 0 26px rgba(176,90,230,.3), 0 10px 30px rgba(0,0,0,.55); }

.d4eq-tooltip .d4eq-tooltip__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, var(--tt-glow) 0%, transparent 100%);
  border-bottom: 1px solid var(--tt-line);
  position: relative;
}
.d4eq-tooltip .d4eq-tooltip__header::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; margin-left: -4px;
  background: #0f0c09; border: 1px solid var(--tt-rarity); transform: rotate(45deg); opacity: .8;
}
.d4eq-tooltip .d4eq-tooltip__name {
  color: var(--tt-rarity);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px; font-variant: small-caps; letter-spacing: .02em; line-height: 1.15;
  text-shadow: 0 0 10px var(--tt-glow), 0 0 2px #000;
}
.d4eq-tooltip .d4eq-tooltip__subtitle { margin: 4px 0 0; color: var(--tt-rarity); opacity: .78; font-size: 12.5px; }
.d4eq-tooltip .d4eq-tooltip__ga-count { margin: 6px 0 0; color: #e4bd61; font-size: 11px; letter-spacing: .04em; }
.d4eq-tooltip .d4eq-tooltip__header-icon {
  flex: 0 0 auto; width: 60px; height: 60px; object-fit: contain; padding: 0;
  border: 0; background: none; filter: drop-shadow(0 0 6px var(--tt-glow)) drop-shadow(0 2px 3px #000);
  box-shadow: none;
}
.d4eq-tooltip > div:not(.d4eq-tooltip__header):not(.d4eq-tt-sep), .d4eq-tooltip > ul { margin: 0 16px; }
.d4eq-tooltip > :nth-child(2) { margin-top: 12px; }

.d4eq-tt-sep { position: relative; height: 9px; margin: 8px 16px; }
.d4eq-tt-sep::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: linear-gradient(90deg, transparent, #6c573a 18%, #6c573a 82%, transparent); }
.d4eq-tt-sep::after { content: ""; position: absolute; left: 50%; top: 1px; width: 6px; height: 6px; margin-left: -3px; background: #0c0a08; border: 1px solid #8f7550; transform: rotate(45deg); }

.d4eq-tt-list { list-style: none; margin: 0; padding: 0 0 0 18px; }
.d4eq-tt-list li { position: relative; margin: 3px 0; color: var(--tt-text); }
.d4eq-tt-list li::before {
  content: ""; position: absolute; left: -14px; top: .5em; width: 6px; height: 6px;
  transform: rotate(45deg); border: 1px solid #8a7b67; background: #2a241c;
}
.d4eq-tt-list li.is-greater { color: #f0d17d; }
.d4eq-tt-list li.is-greater::before { display: none; }
.d4eq-tt-list li.is-greater .d4eq-ga-star { position: absolute; left: -17px; top: -1px; color: #f2c14e; font-size: 13px; text-shadow: 0 0 6px rgba(242,193,78,.6); }
.d4eq-tt-list li.is-tempered { color: #a9c3e8; }
.d4eq-tt-list li.is-tempered::before { border-color: #6f9bd8; background: #1b2a40; box-shadow: 0 0 4px rgba(111,155,216,.6); }
.d4eq-tt-list li.is-transfigured { color: #8fdccf; }
.d4eq-tt-list li.is-transfigured::before { display: none; }
.d4eq-tt-list li.is-transfigured .d4eq-cube-mark { position: absolute; left: -17px; top: 0; color: #5cc9b8; font-size: 12px; }
.d4eq-tt-list li.is-legendary-power { color: var(--tt-text); }
.d4eq-tt-list li.is-legendary-power::before { border-color: #ff8a1f; background: #4a2508; box-shadow: 0 0 5px rgba(255,128,0,.55); }
.d4eq-tt-list li.is-unique-power { color: #dcc6a6; white-space: pre-line; }
.d4eq-tt-list li.is-unique-power::before { border-color: #dca779; background: #3a2a17; box-shadow: 0 0 6px rgba(220,167,121,.55); }
.d4eq-tooltip--mythic .d4eq-tt-list li.is-unique-power::before { border-color: #dc9bf2; background: #33173f; box-shadow: 0 0 6px rgba(220,155,242,.6); }
.d4eq-tt-list--plain li::before { display: none; }
.d4eq-tt-list--plain { padding-left: 0; }
.d4eq-tt-power-name { color: #ff8a1f; font-size: 12.5px; margin-bottom: 2px; }

.d4eq-tt-subheading { color: var(--tt-bright); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin: 2px 0 6px; }
.d4eq-tooltip__masterwork .d4eq-tt-list li { font-size: 12px; color: #a59c8e; }

.d4eq-tt-socket { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.d4eq-tt-socket__ring {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, #1a1612 55%, #0b0907 100%);
  border: 1px solid #6c573a; box-shadow: inset 0 0 4px #000, 0 0 0 1px #000;
}
.d4eq-tooltip .d4eq-tt-socket__ring .d4eq-tooltip__gem-icon { width: 20px; height: 20px; border: 0; padding: 0; background: none; border-radius: 50%; }
.d4eq-tt-socket__text { color: var(--tt-text); font-size: 12.5px; }
.d4eq-tt-socket__name { color: #dca779; }

.d4eq-tt-runes { position: relative; display: grid; gap: 8px; }
.d4eq-tooltip .d4eq-tooltip__rune { display: flex; align-items: flex-start; gap: 8px; padding: 0; border: 0; }
.d4eq-tt-runes .d4eq-tooltip__rune + .d4eq-tooltip__rune .d4eq-tt-socket__ring::before {
  content: ""; position: absolute; width: 2px; height: 14px; margin-top: -22px; background: linear-gradient(#8f7550, #5b4a35);
}
.d4eq-tt-rune__body { min-width: 0; }
.d4eq-tooltip .d4eq-tooltip__rune-head { margin: 2px 0 1px; }

.d4eq-tt-flavor p { margin: 2px 0; color: #8a8478; font-style: italic; font-size: 12px; }
.d4eq-tooltip p { font-size: inherit; }

.d4eq-tt-socket__ring { position: relative; }

/* Tempering recipe row: its top-tier effects listed under the name. */
.d4eq-pick-row .d4eq-tempering-effects { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; white-space: normal; }
.d4eq-pick-row .d4eq-tempering-effects span { display: block; margin: 0; color: #9a9389; font-size: 11px; line-height: 1.35; white-space: normal; overflow: visible; }
.d4eq-pick-row .d4eq-tempering-effects span::before { content: "◆ "; color: #6f9bd8; font-size: 8px; vertical-align: 1px; }

/* Soul splinters (Season 15): the splinter's own power sits under its stat line. */
.d4eq-pick-row .d4eq-pick-row__power { margin-top: 3px; color: #dcc6a6; font-size: 12px; line-height: 1.45; white-space: normal; }
.d4eq-selected-gem .d4eq-selected-gem__power { color: #dcc6a6; }
.d4eq-tt-socket__power { display: block; margin-top: 2px; color: #dcc6a6; }
.d4eq-rune-name.is-common { color: #d6d1c7; }

/* ============================================================
   Read-only view on a narrow block: list instead of the doll, bottom sheet
   for the item text, ✕ on a pinned tooltip. Author: vlad1116.
   The block itself is the size container (not the viewport).
   ============================================================ */
.d4eq-planner[data-d4eq-readonly] { container: d4eq / inline-size; }
.d4eq-list { display: none; }
.d4eq-list__row { width: 100%; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid #3a2f22; border-radius: 2px; background: #15120e; color: #ede3d0; cursor: pointer; font: inherit; text-align: left; }
.d4eq-list__row:hover, .d4eq-list__row:focus-visible { border-color: #8b6a3d; background: #1f1a13; }
.d4eq-list__icon { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--d4eq-row-rarity, #4a4339); background: radial-gradient(circle at 50% 38%, #302e2c, #141417 70%); box-shadow: inset 0 0 0 2px #252328; }
.d4eq-list__icon img { width: 38px; height: 38px; object-fit: contain; }
.d4eq-list__icon--art img, .d4eq-list__icon--mythic img { width: 44px; height: 44px; }
.d4eq-list__copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.d4eq-list__name { color: var(--d4eq-row-rarity, #b8afa1); font-family: Georgia, serif; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.d4eq-list__slot { color: #a09586; font-size: 12px; line-height: 1.2; }
.d4eq-list__sockets { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 64px; }
.d4eq-list__socket { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; border: 1px solid #17151a; background: #1c1b21; }
.d4eq-list__socket--plain { display: grid; place-items: center; border-color: #6c573a; color: #dca779; font-size: 9px; line-height: 1; }
.d4eq-list__row--magic { --d4eq-row-rarity: #8c8cff; }
.d4eq-list__row--rare { --d4eq-row-rarity: #ffff00; }
.d4eq-list__row--legendary { --d4eq-row-rarity: #ff8a1f; }
.d4eq-list__row--unique { --d4eq-row-rarity: #dca779; }
.d4eq-list__row--mythic { --d4eq-row-rarity: #dc9bf2; }
.d4eq-list__empty { margin: 0; padding: 14px 4px; color: #a09586; font-size: 13px; }
@container d4eq (width < 560px) {
  .d4eq-gear-shell { padding: 10px; }
  .d4eq-list { display: flex; flex-direction: column; gap: 6px; }
  .d4eq-paperdoll { display: none; }
}

/* A pinned tooltip can be closed with its own ✕ (a span: it sits inside the slot's <button>). */
.d4eq-tooltip__close { display: none; position: absolute; top: 3px; right: 3px; z-index: 2; width: 22px; height: 22px; place-items: center; border: 1px solid #6c573a; border-radius: 2px; background: #1b150f; color: #dcc6a6; font: 12px/1 Georgia, serif; text-shadow: none; cursor: pointer; }
.d4eq-tooltip__close:hover, .d4eq-tooltip__close:focus-visible { border-color: #c39b64; background: #33271a; color: #fff; }
.d4eq-paperdoll__slot.is-tooltip-open .d4eq-tooltip__close { display: grid; }
.d4eq-planner .d4eq-paperdoll__slot.is-filled.is-tooltip-dismissed > .d4eq-equipped-tooltip { visibility: hidden; opacity: 0; pointer-events: none; }
/* Touch screens use the bottom sheet only: no sticky hover tooltip next to it. */
@media (hover: none) {
  .d4eq-planner[data-d4eq-readonly] .d4eq-equipped-tooltip { display: none; }
}
/* Bottom sheet with the item tooltip (mounted on <body>, so it carries its own colours). */
.d4eq-sheet { position: fixed; inset: 0; z-index: 100000; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.d4eq-sheet * { box-sizing: border-box; }
.d4eq-sheet__backdrop { position: absolute; inset: 0; background: rgba(4, 3, 2, .72); }
.d4eq-sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 80vh; max-height: 80dvh; display: flex; flex-direction: column; border-top: 2px solid #8b6a3d; border-radius: 10px 10px 0 0; background: #15120e; box-shadow: 0 -14px 40px rgba(0, 0, 0, .7); animation: d4eq-sheet-up .18s ease-out; }
.d4eq-sheet__bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 4px 6px 4px 16px; border-bottom: 1px solid #57432c; background: linear-gradient(#2b2118, #1b150f); border-radius: 8px 8px 0 0; }
.d4eq-sheet__title { color: #f0ddba; font: 15px Georgia, serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d4eq-sheet__close { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #6a5135; border-radius: 2px; background: #221c14; color: #f4d59e; cursor: pointer; font: 18px/1 Georgia, serif; }
.d4eq-sheet__close:hover, .d4eq-sheet__close:focus-visible { border-color: #c39b64; background: #33271a; color: #fff; }
.d4eq-sheet :is(button, [tabindex]):focus-visible { outline: 2px solid #e8b971; outline-offset: -3px; }
.d4eq-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 18px; color: #ddd7cb; text-align: left; white-space: normal; }
.d4eq-sheet__body .d4eq-tooltip { max-width: 520px; margin: 14px auto 0; }
@keyframes d4eq-sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .d4eq-sheet__panel { animation: none; } }

/* theme-guard:start — generated by tools/theme-guard.mjs, do not edit */
html body .d4eq-class:where(:hover, :focus) { border: 1px solid var(--d4eq-line); background: #18181d; color: #aaa8b1; }
html body .d4eq-paperdoll__slot:where(:hover, :focus) { border: 0; background: transparent; color: inherit; }
html body .d4eq-picker-tabs button:where(:hover, :focus) { border: 0; background: transparent; color: #777786; }
html body .d4eq-pick-row:where(:hover, :focus) { border: 0; border-bottom: 1px solid #292931; background: transparent; color: #dddde3; }
html body .d4eq-stepper__btn:where(:hover, :focus) { border: 0; background: #211b13; color: #b38b49; }
html body .d4eq-stepper__btn--down:where(:hover, :focus) { border-right: 1px solid #3a2f22; }
html body .d4eq-stepper__btn--up:where(:hover, :focus) { border-left: 1px solid #3a2f22; }
html body .d4eq-selected-affix__remove:where(:hover, :focus) { border: 1px solid #3a3742; background: #1c1b21; color: #9a95a0; }
html body .d4eq-greater-affix-toggle:where(:hover, :focus) { border: 1px solid #504633; background: #191713; color: #80735a; }
html body .d4eq-modal__backdrop:where(:hover, :focus) { border: 0; background: rgba(4, 4, 7, .82); }
html body .d4eq-modal__head button:where(:hover, :focus) { border: 1px solid #3b3b45; background: #202027; color: #aaaab5; }
html body .d4eq-modal__cancel:where(:hover, :focus) { border: 1px solid #3b3b45; background: #202027; color: #a6a6b1; }
html body .d4eq-modal__commit:where(:hover, :focus) { border: 1px solid #9d343c; background: linear-gradient(180deg, #a92c36, #721e25); color: #fff; }
html body .d4eq-class:where(:hover, :focus) { background: linear-gradient(#231d17, #15120e); color: #bbae99; border-color: #4c3c2a; }
html body .d4eq-picker-tabs button:where(:hover, :focus) { color: #b9ab96; }
html body .d4eq-pick-row:where(:hover, :focus) { border-color: #4a3b2855; background: #1a1610; }
html body .d4eq-notice button:where(:hover, :focus) { border: 1px solid #917044; background: #17110b; color: #f4d59e; }
html body .d4eq-list__row:where(:hover, :focus) { border: 1px solid #3a2f22; background: #15120e; color: #ede3d0; }
html body .d4eq-sheet__close:where(:hover, :focus) { border: 1px solid #6a5135; background: #221c14; color: #f4d59e; }
/* theme-guard:end */
