/* === v0.10.3 Compound DB: header-width body and pixel-aligned compose frame === */
.compound-tool {
  width: 100%;
  position: relative;
  overflow: visible;
}

.compound-layout {
  display: grid;
  grid-template-columns: 414px 708px;
  gap: 14px;
  align-items: start;
  min-height: 717px;
}

.compound-appendix {
  position: absolute;
  top: 0;
  right: calc(100% + 12px);
  width: 354px;
  min-height: 512px;
  padding: 12px;
  border: 1px solid rgba(254, 207, 125, 0.32);
  background: linear-gradient(180deg, rgba(25, 14, 14, 0.95), rgba(7, 6, 7, 0.96));
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.6), 0 12px 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  z-index: 8;
}

.compound-search-panel {
  height: 717px;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid rgba(254, 207, 125, 0.25);
  background: linear-gradient(180deg, rgba(25, 15, 15, 0.88), rgba(6, 5, 6, 0.94));
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.55), 0 10px 28px rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  box-sizing: border-box;
  overflow: hidden;
}

.compound-toolbar {
  display: grid;
  grid-template-columns: 166px 112px 96px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.compound-toolbar .compound-search {
  min-width: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  align-self: stretch;
}

.compound-toolbar select,
.compound-toolbar input {
  height: 34px;
  min-width: 0;
  margin: 0;
  align-self: stretch;
  border: 1px solid rgba(254, 207, 125, 0.28);
  background: rgba(8, 7, 8, 0.9);
  color: #fff;
  border-radius: 3px;
  padding: 0 10px;
  font-size: 14px;
  box-sizing: border-box;
}

.compound-toolbar input::placeholder {
  color: rgba(245, 238, 228, 0.55);
}

.compound-meta {
  color: #bda985;
  font-size: 13px;
  margin: 0 0 8px;
  min-height: 18px;
  flex: 0 0 auto;
}

.compound-toolbar #compoundModeFilter {
  width: 112px;
}

.compound-toolbar #compoundGradeFilter {
  width: 96px;
}

.compound-note {
  color: #a99472;
  font-size: 12px;
  line-height: 1.25;
  margin: -2px 0 8px;
  flex: 0 0 auto;
}

.compound-item-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;
}

.compound-item-list::-webkit-scrollbar,
.compound-recipe-choice-list::-webkit-scrollbar,
.compound-process-info::-webkit-scrollbar,
.compound-expected-result::-webkit-scrollbar {
  width: 10px;
}

.compound-item-list::-webkit-scrollbar-track,
.compound-recipe-choice-list::-webkit-scrollbar-track,
.compound-process-info::-webkit-scrollbar-track,
.compound-expected-result::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.55);
}

.compound-item-list::-webkit-scrollbar-thumb,
.compound-recipe-choice-list::-webkit-scrollbar-thumb,
.compound-process-info::-webkit-scrollbar-thumb,
.compound-expected-result::-webkit-scrollbar-thumb {
  background: rgba(133, 94, 58, 0.88);
  border: 1px solid rgba(254, 207, 125, 0.25);
}

.compound-recipe-choice-list::-webkit-scrollbar {
  width: 16px;
}

.compound-recipe-choice-list::-webkit-scrollbar-thumb {
  border: 4px solid rgba(0, 0, 0, 0);
  background-clip: content-box;
}

.compound-item-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  margin: 0 0 5px;
  border: 1px solid rgba(120, 93, 61, 0.34);
  background: linear-gradient(180deg, rgba(23, 17, 17, 0.9), rgba(12, 10, 11, 0.92));
  color: #d9d0bd;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.compound-item-row:hover,
.compound-item-row.selected {
  border-color: rgba(254, 207, 125, 0.72);
  box-shadow: 0 0 12px rgba(184, 73, 35, 0.32), inset 0 0 12px rgba(254, 207, 125, 0.08);
}

.compound-item-row img,
.compound-recipe-slot img,
.compound-selected-head img,
.compound-result-card img,
.compound-choice-row img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: auto;
  flex: 0 0 34px;
}

.compound-item-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.compound-item-main b {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compound-item-main small {
  color: #a89b87;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compound-game-panel {
  width: 708px;
  height: 512px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.compound-game-frame {
  position: relative;
  width: 708px;
  height: 512px;
  padding: 0;
  border: 0;
  background: url("assets/ui/compound/Illustration.png") left top / 708px 717px no-repeat;
  box-shadow: none;
  border-radius: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.compound-left-workbench,
.compound-right-workbench {
  display: contents;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.compound-recipe-slots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.compound-recipe-slot {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 0;
  cursor: default;
  padding: 0;
  pointer-events: none;
}

.compound-recipe-slot.slot-1 { left: 62px; top: 44px; }
.compound-recipe-slot.slot-2 { left: 123px; top: 44px; }
.compound-recipe-slot.slot-3 { left: 184px; top: 44px; }
.compound-recipe-slot.slot-4 { left: 245px; top: 44px; }
.compound-recipe-slot.slot-5 { left: 122px; top: 99px; }
.compound-recipe-slot.slot-6 { left: 183px; top: 99px; }

.compound-recipe-slot.filled {
  pointer-events: auto;
}

.compound-recipe-slot.filled.selectable {
  cursor: pointer;
}

.compound-recipe-slot.filled.selectable:hover {
  filter: brightness(1.22);
  box-shadow: 0 0 10px rgba(254, 207, 125, 0.45);
}


.compound-slot-count {
  position: absolute;
  right: 1px;
  bottom: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-shadow: 1px 1px 2px #000;
}

.compound-progress {
  display: none;
}

.compound-progress span {
  display: none;
}

.compound-button-row {
  position: absolute;
  left: 47px;
  top: 221px;
  width: 278px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.compound-button-row button {
  width: 76px;
  height: 28px;
  color: #d8d2c8;
  border: 1px solid rgba(254, 207, 125, 0.24);
  background: linear-gradient(180deg, #333235, #111114);
  border-radius: 4px;
  font-size: 12px;
}

.compound-process-info {
  position: absolute;
  left: 30px;
  top: 270px;
  width: 314px;
  height: 230px;
  padding: 0;
  color: #bfb29d;
  font-size: 13px;
  line-height: 1.5;
  border: 0;
  background: transparent;
  overflow: auto;
  box-sizing: border-box;
}

.compound-process-info b {
  color: #f2d18c;
}

.compound-process-info .compound-process-slot {
  color: #9fb7ff;
}

.compound-right-workbench h2 {
  position: absolute;
  left: 355px;
  width: 345px;
  margin: 0;
  color: #c6a26f;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  background: transparent;
}

.compound-right-workbench h2:nth-of-type(1) {
  top: 42px;
}

.compound-right-workbench h2:nth-of-type(2) {
  top: 190px;
}

.compound-recipe-choice-list {
  position: absolute;
  left: 355px;
  top: 72px;
  width: 345px;
  height: 110px;
  overflow: auto;
  padding: 0 4px 0 0;
  box-sizing: border-box;
}

.compound-choice-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0 0 5px;
  padding: 5px 6px;
  text-align: left;
  color: #d9d0bd;
  border: 1px solid rgba(120, 93, 61, 0.34);
  background: transparent;
  box-sizing: border-box;
}

.compound-choice-row:hover,
.compound-choice-row.selected {
  border-color: rgba(254, 207, 125, 0.72);
  box-shadow: 0 0 12px rgba(184, 73, 35, 0.32), inset 0 0 12px rgba(254, 207, 125, 0.08);
}

.compound-choice-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.compound-choice-main b {
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.compound-choice-main small {
  color: #aa9b84;
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.compound-expected-result {
  position: absolute;
  left: 355px;
  top: 220px;
  width: 345px;
  height: 282px;
  padding: 0 5px 0 0;
  overflow: auto;
  color: #bfb29d;
  font-size: 13px;
  box-sizing: border-box;
  background: transparent;
}

.compound-result-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
}

.compound-result-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.compound-result-card p {
  margin: 6px 0 0;
  line-height: 1.35;
  color: #c6bba8;
}

.compound-result-card small {
  color: #aa9b84;
}

.compound-selected-title {
  color: #fecf7d;
  font-family: Cinzel, Georgia, serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 9px rgba(129, 38, 22, 0.75);
  margin: 0 0 10px;
}

.compound-empty {
  padding: 14px;
  color: #a99a83;
}

.compound-selected-empty {
  color: #a99a83;
  padding: 12px 0;
}

.compound-selected-card {
  color: #d8cfbd;
}

.compound-selected-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(254, 207, 125, 0.16);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.compound-selected-head h2 {
  margin: 0;
  font-size: 18px;
}

.compound-selected-head p {
  margin: 3px 0 0;
  color: #aa9b84;
  font-size: 12px;
}

.compound-selected-lines {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.compound-selected-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.compound-selected-lines b {
  color: #c5ad76;
}

.compound-selected-lines span {
  color: #e1d4c1;
  text-align: right;
}

.compound-selected-stats {
  color: #9db5ff;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid rgba(122, 144, 216, 0.18);
  background: rgba(26, 31, 52, 0.22);
  padding: 8px;
  margin-bottom: 10px;
}

.compound-selected-desc {
  color: #bfb29d;
  font-size: 13px;
  line-height: 1.45;
}


.compound-category-tree {
  grid-column: 1 / -1;
  max-height: 245px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(254, 207, 125, 0.25);
  background: rgba(5, 4, 5, 0.74);
  padding: 6px;
  box-sizing: border-box;
}

.compound-category-tree::-webkit-scrollbar {
  width: 8px;
}

.compound-category-tree::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.55);
}

.compound-category-tree::-webkit-scrollbar-thumb {
  background: rgba(133, 94, 58, 0.88);
  border: 1px solid rgba(254, 207, 125, 0.25);
}

.compound-tree-all,
.compound-tree-group,
.compound-tree-leaf {
  width: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: #d8cfbd;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 5px;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  font-size: 13px;
}

.compound-tree-group {
  color: #fecf7d;
  font-weight: 800;
}

.compound-tree-group span {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(254, 207, 125, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f0c46c;
  font-weight: 900;
  flex: 0 0 16px;
}

.compound-tree-children {
  margin: 1px 0 5px 21px;
  border-left: 1px solid rgba(254, 207, 125, 0.15);
  padding-left: 5px;
}

.compound-tree-leaf {
  color: #c8beaa;
}

.compound-tree-all:hover,
.compound-tree-group:hover,
.compound-tree-leaf:hover,
.compound-tree-all.selected,
.compound-tree-leaf.selected {
  color: #fff0bd;
  background: rgba(101, 45, 28, 0.42);
}

.compound-tree-all small,
.compound-tree-group small,
.compound-tree-leaf small {
  margin-left: auto;
  color: #a99472;
  font-size: 11px;
}

.compound-result-tooltip.equip-tooltip {
  position: static;
  width: auto;
  max-width: none;
  pointer-events: auto;
  box-shadow: none;
}

.grade-0 { color: #C7C7C7; }
.grade-1 { color: #95F995; }
.grade-2 { color: #F9F9B3; }
.grade-3 { color: #F9F932; }
.grade-4 { color: #F9C732; }
.grade-5 { color: #96F9F9; }
.grade-6 { color: #6464F9; }
.grade-7 { color: #C795F9; }
.grade-8 { color: #C795F9; }
.grade-9,
.grade-10,
.grade-11 { color: #C7C7C7; }

@media (max-width: 1500px) {
  .compound-appendix {
    position: static;
    width: auto;
    min-height: 0;
    margin-bottom: 12px;
  }
}

@media (max-width: 1260px) {
  .compound-layout {
    grid-template-columns: 1fr;
  }

  .compound-game-panel,
  .compound-game-frame {
    max-width: 100%;
  }
}



/* === v0.10.4 Compound DB alignment and slot cleanup === */
.tool-panel.compound-tool {
  width: 100%;
  max-width: none;
}

.compound-recipe-slot,
.compound-recipe-slot.filled,
button.compound-recipe-slot {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0;
  margin: 0;
  line-height: 34px;
  overflow: visible;
}

.compound-recipe-slot img {
  display: block;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  flex: 0 0 34px;
}

.compound-selected-title {
  margin: 0 0 8px;
  color: #fecf7d;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: none;
}

/* === v0.10.6 Compound DB cleanup === */
#page-compound.tool-page {
  width: min(1180px, calc(100vw - 24px));
}
#page-compound .tool-panel.compound-tool {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
}

.compound-result-appendix {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  width: 354px;
  min-height: 512px;
  padding: 12px;
  border: 1px solid rgba(254, 207, 125, 0.32);
  background: linear-gradient(180deg, rgba(25, 14, 14, 0.95), rgba(7, 6, 7, 0.96));
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.6), 0 12px 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  z-index: 8;
}

.compound-selected-title {
  margin: 0 0 8px;
  color: #fecf7d;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: none;
}

.compound-toolbar {
  grid-template-columns: 166px 112px 96px;
}
.compound-toolbar .compound-search,
#compoundModeFilter,
#compoundGradeFilter {
  grid-column: auto;
}
#compoundCategoryTree {
  grid-column: 1 / -1;
}

.compound-button-row {
  display: none;
}

.compound-right-workbench h2:nth-of-type(1) {
  top: 21px;
}
.compound-recipe-choice-list {
  top: 51px;
  height: 646px;
}
.compound-process-info {
  top: 231px;
  height: 271px;
}

.compound-result-appendix .compound-expected-result {
  position: static;
  left: auto;
  top: auto;
  width: auto;
  height: 468px;
  padding: 0;
  overflow-y: auto;
  background: transparent;
}

.compound-result-appendix .compound-result-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
}

.compound-recipe-slot,
button.compound-recipe-slot {
  box-sizing: border-box;
  overflow: hidden;
}
.compound-slot-count {
  right: 2px;
  bottom: 1px;
  line-height: 1;
  pointer-events: none;
}
.compound-recipe-slot img {
  display: block;
  width: 34px;
  height: 34px;
}

@media (max-width: 1500px) {
  .compound-result-appendix {
    position: static;
    width: auto;
    min-height: 0;
    margin-top: 12px;
  }
}
#page-compound .tool-panel.compound-tool {
  width: min(1180px, calc(100vw - 24px));
}


/* === v0.10.8 Compound DB tall frame polish === */
.compound-game-panel,
.compound-game-frame {
  width: 708px;
  height: 717px;
}

.compound-game-frame {
  background-image: url("assets/ui/compound/Illustration.png");
  background-size: 708px 717px;
}

.compound-toolbar {
  grid-template-columns: 166px 112px 96px;
}

.compound-right-workbench h2 {
  left: 355px;
  width: 345px;
}

.compound-recipe-choice-list {
  left: 355px;
  width: 345px;
  height: 646px;
}

.compound-slot-count {
  right: 1px;
  bottom: -1px;
  text-shadow:
    -1px -1px 0 #000,
     0   -1px 0 #000,
     1px -1px 0 #000,
    -1px  0   0 #000,
     1px  0   0 #000,
    -1px  1px 0 #000,
     0    1px 0 #000,
     1px  1px 0 #000;
}

.compound-result-appendix .compound-expected-result > .equip-tooltip,
.compound-result-appendix .compound-expected-result .compound-result-tooltip.equip-tooltip {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

/* === v0.10.9 Compound appendix/description correction === */
.tt-desc {
  color: #f2d78d;
  font-size: 12px;
  line-height: 1.35;
  margin: 7px 0;
  white-space: pre-line;
}
#page-compound .compound-appendix,
#page-compound .compound-result-appendix {
  min-height: 512px;
  overflow: visible;
}
#page-compound .compound-result-appendix .compound-expected-result {
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding: 0;
}
#page-compound .compound-result-appendix .compound-expected-result .equip-tooltip,
#page-compound .compound-result-appendix .compound-expected-result .compound-result-tooltip,
#page-compound .compound-appendix .compound-selected-card.equip-tooltip,
#page-compound .compound-appendix .compound-selected-card .equip-tooltip {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
#page-compound .compound-expected-result.selectable {
  cursor: pointer;
}

/* === v0.10.10 Search, scrollbars, and Reduction DB === */
#page-compound .compound-item-list::-webkit-scrollbar,
#page-compound .compound-recipe-choice-list::-webkit-scrollbar,
#page-compound .compound-process-info::-webkit-scrollbar,
#page-compound .compound-category-tree::-webkit-scrollbar,
#page-items .reduction-item-list::-webkit-scrollbar,
#page-items .reduction-results::-webkit-scrollbar,
#page-items .reduction-process-info::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}
#page-compound .compound-item-list::-webkit-scrollbar-track,
#page-compound .compound-recipe-choice-list::-webkit-scrollbar-track,
#page-compound .compound-process-info::-webkit-scrollbar-track,
#page-compound .compound-category-tree::-webkit-scrollbar-track,
#page-items .reduction-item-list::-webkit-scrollbar-track,
#page-items .reduction-results::-webkit-scrollbar-track,
#page-items .reduction-process-info::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.6);
  border-left: 1px solid rgba(254,207,125,0.10);
}
#page-compound .compound-item-list::-webkit-scrollbar-thumb,
#page-compound .compound-recipe-choice-list::-webkit-scrollbar-thumb,
#page-compound .compound-process-info::-webkit-scrollbar-thumb,
#page-compound .compound-category-tree::-webkit-scrollbar-thumb,
#page-items .reduction-item-list::-webkit-scrollbar-thumb,
#page-items .reduction-results::-webkit-scrollbar-thumb,
#page-items .reduction-process-info::-webkit-scrollbar-thumb {
  background: rgba(133,94,58,0.92);
  border: 3px solid rgba(0,0,0,0.35);
  background-clip: padding-box;
  border-radius: 8px;
}
#page-compound .compound-item-list::-webkit-scrollbar-thumb:hover,
#page-compound .compound-recipe-choice-list::-webkit-scrollbar-thumb:hover,
#page-compound .compound-process-info::-webkit-scrollbar-thumb:hover,
#page-compound .compound-category-tree::-webkit-scrollbar-thumb:hover,
#page-items .reduction-item-list::-webkit-scrollbar-thumb:hover,
#page-items .reduction-results::-webkit-scrollbar-thumb:hover,
#page-items .reduction-process-info::-webkit-scrollbar-thumb:hover {
  background-color: rgba(196,139,76,0.95);
}
#page-compound .compound-recipe-choice-list::-webkit-scrollbar-thumb {
  border: 3px solid rgba(0,0,0,0.35);
  background-clip: padding-box;
}

.reduction-tool {
  width: min(1180px, calc(100vw - 24px));
  max-width: none;
  position: relative;
  overflow: visible;
}
.reduction-layout {
  display: grid;
  grid-template-columns: 479px 627px;
  gap: 14px;
  align-items: start;
  justify-content: center;
  min-height: 430px;
}
.reduction-search-panel {
  height: 430px;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid rgba(254,207,125,0.25);
  background: linear-gradient(180deg, rgba(25,15,15,0.88), rgba(6,5,6,0.94));
  box-shadow: inset 0 0 22px rgba(0,0,0,0.55), 0 10px 28px rgba(0,0,0,0.35);
  border-radius: 4px;
  box-sizing: border-box;
  overflow: hidden;
}
.reduction-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 116px;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
.reduction-toolbar > input,
.reduction-toolbar > select {
  height: 36px;
  min-width: 0;
  margin: 0;
  align-self: stretch;
  border: 1px solid rgba(254,207,125,0.28);
  background: rgba(8,7,8,0.9);
  color: #fff;
  border-radius: 3px;
  padding: 0 10px;
  font-size: 14px;
  box-sizing: border-box;
}
.reduction-equipment-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  min-width: 0;
  margin: 0;
  align-self: stretch;
  border: 1px solid rgba(254,207,125,0.28);
  background: rgba(8,7,8,0.9);
  border-radius: 3px;
  box-sizing: border-box;
  color: #f0d68f;
  font-size: 13px;
  margin: 0;
  line-height: 1;
  user-select: none;
}
.reduction-equipment-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}
.reduction-meta,
.reduction-note {
  color: #bda985;
  font-size: 13px;
  margin: 0 0 7px;
  flex: 0 0 auto;
}
.reduction-note { color: #a99472; font-size: 12px; }
.reduction-item-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;
}
.reduction-item-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 6px 8px;
  border: 1px solid rgba(254,207,125,0.16);
  background: rgba(10,7,7,0.86);
  color: #ddd;
  text-align: left;
  cursor: pointer;
  margin: 0 0 6px;
}
.reduction-item-row:hover,
.reduction-item-row.selected {
  border-color: rgba(254,207,125,0.75);
  box-shadow: inset 0 0 12px rgba(254,207,125,0.14);
}
.reduction-item-row img,
.reduction-slot img,
.reduction-result-row img {
  width: 34px;
  height: 34px;
  image-rendering: auto;
}
.reduction-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.reduction-item-main b {
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reduction-item-main small {
  color: #b8aa92;
  font-size: 12px;
}
.reduction-game-panel,
.reduction-game-frame {
  width: 627px;
  height: 348px;
}
.reduction-game-frame {
  position: relative;
  background: url("assets/ui/reduction/ReductionUI.png") 0 0 / 627px 348px no-repeat;
  overflow: visible;
}
.reduction-slots,
.reduction-results,
.reduction-process-info { position: absolute; }
.reduction-slots {
  left: 0;
  top: 0;
  width: 627px;
  height: 348px;
  pointer-events: none;
  z-index: 2;
}
.reduction-slot {
  position: absolute;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8c7b66;
  font-size: 11px;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
  outline: none;
}
.reduction-slot.slot-input { left: 113px; top: 41px; }
.reduction-slot.slot-out-1 { left: 44px; top: 122px; }
.reduction-slot.slot-out-2 { left: 90px; top: 122px; }
.reduction-slot.slot-out-3 { left: 136px; top: 122px; }
.reduction-slot.slot-out-4 { left: 182px; top: 122px; }
.reduction-slot.selectable { cursor: help; }
.reduction-slot.selectable:hover { filter: brightness(1.25); }
.reduction-slot em {
  position: absolute;
  right: 1px;
  bottom: -1px;
  color: #fff0a8;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  text-shadow: -1px -1px 0 #000,0 -1px 0 #000,1px -1px 0 #000,-1px 0 0 #000,1px 0 0 #000,-1px 1px 0 #000,0 1px 0 #000,1px 1px 0 #000;
}
.reduction-results {
  left: 271px;
  top: 28px;
  width: 335px;
  height: 224px;
  overflow: hidden;
  padding-right: 0;
  box-sizing: border-box;
}
.reduction-results-header {
  padding: 0 0 7px;
  margin: 0 0 6px;
  border-bottom: 1px solid rgba(254,207,125,0.16);
}
.reduction-results-header b {
  display: block;
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reduction-results-header span {
  display: block;
  margin-top: 3px;
  color: #d8d0bd;
  font-size: 12px;
}
.reduction-results-table-head,
.reduction-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px 72px;
  gap: 8px;
  align-items: center;
}
.reduction-results-table-head {
  min-height: 22px;
  color: #c8b990;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(254,207,125,0.18);
  margin-bottom: 3px;
}
.reduction-results-table-head span:nth-child(2),
.reduction-results-table-head span:nth-child(3) { text-align: right; }
.reduction-result-row {
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(254,207,125,0.08);
  background: transparent;
  color: #d6c6aa;
  text-align: left;
  cursor: help;
  box-sizing: border-box;
}
.reduction-result-row.clickable { cursor: pointer; }
.reduction-result-row:hover { background: rgba(254,207,125,0.08); }
.reduction-result-row b {
  min-width: 0;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reduction-result-row span,
.reduction-result-row small {
  text-align: right;
  color: #d8d0bd;
  font-size: 12px;
  white-space: nowrap;
}
.reduction-process-info {
  left: 23px;
  bottom: 22px;
  width: 585px;
  height: 56px;
  color: #b8aa92;
  font-size: 12px;
  line-height: 1.35;
  overflow-y: auto;
}
.reduction-fee { margin-top: 4px; color: #f0d68f; }
.reduction-appendix { min-height: 398px; }
.reduction-empty { padding: 10px; }
@media (max-width: 1500px) {
  .reduction-appendix { position: static; width: auto; min-height: 0; margin-bottom: 12px; }
}


/* === v0.10.13 toolbar alignment and reduction result fit === */
#page-compound .compound-toolbar > .compound-search,
#page-compound .compound-toolbar > select,
#page-items .reduction-toolbar > .reduction-search,
#page-items .reduction-toolbar > select,
#page-items .reduction-toolbar > .reduction-equipment-toggle {
  margin: 0;
  box-sizing: border-box;
  align-self: stretch;
}
#page-compound .compound-toolbar > .compound-search,
#page-compound .compound-toolbar > select {
  height: 34px;
}
#page-items .reduction-toolbar > .reduction-search,
#page-items .reduction-toolbar > select,
#page-items .reduction-toolbar > .reduction-equipment-toggle {
  height: 36px;
}
#page-items .reduction-results {
  height: 224px;
  overflow: hidden;
  padding-right: 0;
}


/* === v0.10.15 bugged quest + selected-item feedback === */
.summary-card.bugged-summary b,
.quest-row.bugged .quest-title,
.quest-row.bugged .quest-type,
.quest-row.bugged .quest-xp {
  color: #ff4f4f;
}
.quest-row.bugged {
  border-color: rgba(255, 72, 72, 0.55);
  background: linear-gradient(90deg, rgba(88, 8, 8, 0.42), rgba(0, 0, 0, 0.28));
  box-shadow: inset 0 0 12px rgba(130, 0, 0, 0.22);
}
.quest-row.bugged .quest-zone,
.quest-row.bugged .quest-id {
  color: rgba(255, 180, 180, 0.75);
}
.quest-row.bugged input {
  opacity: 0.45;
  cursor: not-allowed;
}
@keyframes selectedItemPanelPulseV1014 {
  0% {
    box-shadow: 0 0 0 rgba(255, 78, 78, 0), inset 0 0 0 rgba(254, 207, 125, 0);
    border-color: rgba(254, 207, 125, 0.32);
    transform: scale(1);
  }
  18% {
    box-shadow: 0 0 28px rgba(255, 78, 78, 0.55), inset 0 0 24px rgba(254, 207, 125, 0.22);
    border-color: rgba(255, 96, 96, 0.95);
    transform: scale(1.01);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 78, 78, 0), inset 0 0 0 rgba(254, 207, 125, 0);
    border-color: rgba(254, 207, 125, 0.32);
    transform: scale(1);
  }
}
#compoundSelectedPanel.selected-item-pulse,
#reductionSelectedPanel.selected-item-pulse,
#equipmentAppendixPanel.selected-item-pulse .equipment-appendix-inner {
  animation: selectedItemPanelPulseV1014 0.68s ease-out;
}

.bugged-changelog { color: #ff4f4f; font-weight: 900; }


/* === v0.10.16 EXP Calculator full-width scale === */
#page-exp.tool-page {
  width: min(1180px, calc(100vw - 24px));
}
#page-exp .exp-tool {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto;
  padding: 28px 30px 30px;
  font-size: 16px;
}
#page-exp .exp-tool h1 {
  font-size: 32px;
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: 0.07em;
}
#page-exp .exp-tool h2,
#page-exp .section-title-row h2 {
  font-size: 18px;
  line-height: 1.25;
}
#page-exp .exp-controls.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
#page-exp .exp-controls fieldset {
  padding: 13px 14px 14px;
  min-width: 0;
}
#page-exp .exp-controls legend {
  font-size: 14px;
  padding: 0 7px;
}
#page-exp .exp-controls label,
#page-exp .zone-rate-grid label,
#page-exp .option-toggle {
  font-size: 14px;
  line-height: 1.22;
}
#page-exp .exp-controls input,
#page-exp .zone-rate-grid input,
#page-exp .completed-row textarea {
  height: 34px;
  font-size: 15px;
  padding: 6px 8px;
}
#page-exp .exp-controls .checkline {
  gap: 9px;
  padding-top: 13px;
}
#page-exp .exp-controls .checkline input {
  width: 18px;
  height: 18px;
  min-width: 18px;
}
#page-exp .help-tip {
  width: 18px;
  height: 18px;
  font-size: 13px;
  margin-left: 5px;
}
#page-exp .field-tooltip {
  width: 310px;
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.4;
}
#page-exp .rate-panel,
#page-exp .completed-panel,
#page-exp .player-progress-panel,
#page-exp .quest-levels-panel {
  padding: 16px;
  margin: 15px 0;
}
#page-exp .zone-rate-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 11px;
}
#page-exp .zone-rate-grid label span {
  min-height: 34px;
  line-height: 1.16;
}
#page-exp .zone-rate-grid small {
  min-height: 15px;
  font-size: 12px;
}
#page-exp .percent-input {
  gap: 6px;
}
#page-exp .percent-input input {
  width: 82px;
  max-width: 82px;
}
#page-exp .completed-row {
  grid-template-columns: 1fr 164px;
  gap: 12px;
}
#page-exp .completed-row textarea {
  min-height: 78px;
  line-height: 1.35;
}
#page-exp .completed-buttons,
#page-exp .mini-actions {
  gap: 9px;
}
#page-exp .completed-buttons button,
#page-exp .mini-actions button {
  height: 36px;
  min-width: 112px;
  font-size: 14px;
  padding: 0 13px;
}
#page-exp .exp-summary {
  gap: 12px;
  margin: 16px 0;
}
#page-exp .summary-card {
  padding: 14px 12px;
}
#page-exp .summary-card b {
  font-size: 20px;
}
#page-exp .summary-card span {
  font-size: 13px;
  margin-top: 5px;
}
#page-exp .section-title-row {
  gap: 14px;
  margin-bottom: 11px;
}
#page-exp .player-level-row {
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 9px 0;
}
#page-exp .level-badge {
  font-size: 14px;
  padding: 9px 0;
}
#page-exp .bar {
  height: 14px;
}
#page-exp .bar-text {
  font-size: 13px;
  margin-top: 6px;
}
#page-exp .quest-level-block {
  margin: 9px 0;
}
#page-exp .quest-level-header {
  height: 42px;
  grid-template-columns: minmax(0, 1fr) 110px 160px;
  gap: 12px;
  padding: 0 14px;
  font-size: 15px;
}
#page-exp .quest-level-header b,
#page-exp .quest-level-header em {
  font-size: 14px;
}
#page-exp .quest-level-body {
  gap: 7px;
  padding: 10px;
}
#page-exp .quest-chain-group {
  gap: 7px;
  padding-left: 18px;
}
#page-exp .quest-chain-group::before {
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 12px;
}
#page-exp .quest-row {
  grid-template-columns: 28px minmax(0, 1fr) 150px 150px 126px 74px;
  gap: 10px;
  padding: 8px 10px;
  min-height: 40px;
}
#page-exp .quest-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
}
#page-exp .quest-title {
  font-size: 15px;
}
#page-exp .quest-type,
#page-exp .quest-zone,
#page-exp .quest-id {
  font-size: 13px;
}
#page-exp .quest-xp {
  font-size: 14px;
}
@media (max-width: 1180px) {
  #page-exp .exp-tool {
    padding: 24px 22px 26px;
  }
  #page-exp .exp-controls.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #page-exp .zone-rate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #page-exp .quest-row {
    grid-template-columns: 28px minmax(0, 1fr) 140px 132px 118px 66px;
  }
}
@media (max-width: 860px) {
  #page-exp.tool-page,
  #page-exp .exp-tool {
    width: calc(100vw - 16px) !important;
  }
  #page-exp .exp-tool {
    padding: 18px 14px;
    font-size: 14px;
  }
  #page-exp .exp-tool h1 {
    font-size: 25px;
  }
  #page-exp .exp-controls.compact,
  #page-exp .zone-rate-grid,
  #page-exp .exp-summary,
  #page-exp .completed-row {
    grid-template-columns: 1fr;
  }
  #page-exp .quest-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  #page-exp .quest-type,
  #page-exp .quest-zone,
  #page-exp .quest-xp,
  #page-exp .quest-id {
    grid-column: 2;
    text-align: left;
  }
  #page-exp .quest-title {
    white-space: normal;
  }
}
