.item-type-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  height: 22px;
}

.item-type-manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(122, 74, 42, 0.4);
  background: rgba(122, 74, 42, 0.1);
  color: #e6c0a0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.7rem;
  line-height: 1;
}

.item-type-manage-btn:hover {
  background: rgba(122, 74, 42, 0.25);
  border-color: rgba(122, 74, 42, 0.7);
  color: #e0a3ae;
  transform: rotate(45deg);
}

.item-type-manage-btn:focus-visible {
  outline: 2px solid #a94c60;
  outline-offset: 2px;
}

.item-types-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.item-types-overlay.visible {
  opacity: 1;
}

.item-types-modal {
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 48px);
  background: linear-gradient(180deg, rgba(38, 26, 18, 0.97) 0%, rgba(20, 12, 7, 0.98) 100%);
  border: 1px solid rgba(122, 74, 42, 0.3);
  border-radius: 16px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(122, 74, 42, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
}

.item-types-overlay.visible .item-types-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.item-types-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.35);
  background: linear-gradient(180deg, rgba(20, 12, 7, 0.7) 0%, rgba(20, 12, 7, 0.4) 100%);
}

.item-types-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.item-types-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #c87743, #a94c60);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(200, 119, 67, 0.4);
  flex-shrink: 0;
}

.item-types-title h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #efe0cd;
  letter-spacing: 0.01em;
}

.item-types-subtitle {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: rgba(162, 143, 127, 0.85);
  font-weight: 500;
}

.item-types-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

.item-types-search-wrap {
  position: relative;
  flex: 1;
  max-width: 340px;
  min-width: 200px;
}

.item-types-search-wrap > i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(162, 143, 127, 0.7);
  pointer-events: none;
  font-size: 0.85rem;
}

.item-types-search {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: rgba(20, 12, 7, 0.7);
  border: 1px solid rgba(58, 42, 30, 0.4);
  border-radius: 8px;
  color: #e9ecef;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.18s ease;
}

.item-types-search:focus {
  border-color: rgba(122, 74, 42, 0.7);
  box-shadow: 0 0 0 3px rgba(122, 74, 42, 0.18);
}

.item-types-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(20, 12, 7, 0.6);
  border: 1px solid rgba(58, 42, 30, 0.4);
  border-radius: 8px;
  color: rgba(162, 143, 127, 0.85);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.item-types-icon-btn:hover {
  color: #e3a8b1;
  border-color: rgba(184, 70, 92, 0.5);
  background: rgba(184, 70, 92, 0.1);
}

.item-types-add-card {
  margin: 16px 22px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(122, 74, 42, 0.1) 0%, rgba(200, 119, 67, 0.06) 100%);
  border: 1px solid rgba(122, 74, 42, 0.25);
  border-radius: 12px;
}

.item-types-add-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e0a3ae;
  margin-bottom: 10px;
}

.item-types-add-grid {
  display: grid;
  grid-template-columns: 88px 1fr 132px 168px auto;
  gap: 10px;
  align-items: end;
}

.item-types-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.item-types-field-grow {
  min-width: 0;
}

.item-types-field label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(162, 143, 127, 0.85);
}

.item-types-field label .hint {
  font-weight: 500;
  color: rgba(162, 143, 127, 0.55);
  text-transform: lowercase;
}

.item-types-field input,
.item-types-field select {
  padding: 8px 10px;
  background: rgba(20, 12, 7, 0.7);
  border: 1px solid rgba(58, 42, 30, 0.45);
  border-radius: 7px;
  color: #e9ecef;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.18s ease;
  font-family: inherit;
}

.item-types-field input:focus,
.item-types-field select:focus {
  border-color: rgba(122, 74, 42, 0.7);
  box-shadow: 0 0 0 3px rgba(122, 74, 42, 0.18);
}

.item-types-add-btn {
  padding: 9px 18px;
  background: linear-gradient(135deg, #4f9d69, #059669);
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(91, 155, 112, 0.3);
}

.item-types-add-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(91, 155, 112, 0.45);
}

.item-types-add-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.item-types-readonly-banner {
  margin: 16px 22px 0;
  padding: 10px 14px;
  background: rgba(154, 138, 78, 0.1);
  border: 1px solid rgba(154, 138, 78, 0.3);
  border-radius: 8px;
  color: #e0a851;
  font-size: 0.82rem;
  font-weight: 500;
}

.item-types-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 8px;
  font-size: 0.78rem;
  color: rgba(162, 143, 127, 0.85);
  font-variant-numeric: tabular-nums;
}

.item-types-stat strong {
  color: #efe0cd;
  font-size: 0.95rem;
  font-weight: 700;
}

.item-types-stat small {
  color: rgba(162, 143, 127, 0.55);
  margin-left: 2px;
}

.item-types-stat-sep {
  color: rgba(162, 143, 127, 0.4);
}

.item-types-list-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 22px 12px;
}

.item-types-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 4px 4px 0;
  scrollbar-gutter: stable;
}

.item-types-list::-webkit-scrollbar {
  width: 8px;
}

.item-types-list::-webkit-scrollbar-thumb {
  background: rgba(58, 42, 30, 0.5);
  border-radius: 4px;
}

.item-types-list::-webkit-scrollbar-thumb:hover {
  background: rgba(122, 74, 42, 0.6);
}

.item-types-card {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(20, 12, 7, 0.55);
  border: 1px solid rgba(58, 42, 30, 0.3);
  border-radius: 10px;
  transition: all 0.18s ease;
  position: relative;
}

.item-types-card:hover {
  border-color: rgba(122, 74, 42, 0.45);
  background: rgba(20, 12, 7, 0.75);
  transform: translateX(2px);
}

.item-types-card.saving {
  opacity: 0.75;
  pointer-events: none;
}

.item-types-card.saved {
  border-color: rgba(91, 155, 112, 0.6);
  box-shadow: 0 0 0 1px rgba(91, 155, 112, 0.4);
  animation: itemTypesSavedPulse 0.7s ease;
}

@keyframes itemTypesSavedPulse {
  0% { background: rgba(91, 155, 112, 0.18); }
  100% { background: rgba(20, 12, 7, 0.55); }
}

.item-types-card.confirming {
  border-color: rgba(184, 70, 92, 0.6);
  background: rgba(184, 70, 92, 0.08);
}

.item-types-card-id-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: rgba(122, 74, 42, 0.1);
  border: 1px solid rgba(122, 74, 42, 0.4);
  border-radius: 8px;
  color: #e0a3ae;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-weight: 700;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.item-types-card-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.item-types-card-row input.item-types-name {
  width: 100%;
  padding: 7px 10px;
  background: rgba(20, 12, 7, 0.5);
  border: 1px solid transparent;
  border-radius: 6px;
  color: #efe0cd;
  font-size: 0.92rem;
  font-weight: 500;
  outline: none;
  transition: all 0.18s ease;
}

.item-types-card-row input.item-types-name:hover {
  border-color: rgba(58, 42, 30, 0.45);
}

.item-types-card-row input.item-types-name:focus {
  border-color: rgba(122, 74, 42, 0.7);
  background: rgba(20, 12, 7, 0.85);
  box-shadow: 0 0 0 3px rgba(122, 74, 42, 0.15);
}

.item-types-card-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.item-types-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
}

.item-types-meta-item label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: rgba(162, 143, 127, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
}

.item-types-meta-item input,
.item-types-meta-item select {
  padding: 4px 8px;
  background: rgba(20, 12, 7, 0.6);
  border: 1px solid rgba(58, 42, 30, 0.35);
  border-radius: 5px;
  color: #d6c3ae;
  font-size: 0.78rem;
  outline: none;
  transition: all 0.18s ease;
  font-family: inherit;
}

.item-types-meta-item input {
  width: 60px;
  text-align: center;
}

.item-types-meta-item select {
  width: 90px;
}

.item-types-meta-item input:focus,
.item-types-meta-item select:focus {
  border-color: rgba(122, 74, 42, 0.6);
  box-shadow: 0 0 0 2px rgba(122, 74, 42, 0.18);
}

.item-types-meta-hint {
  font-size: 0.7rem;
  color: rgba(162, 143, 127, 0.65);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.item-types-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.item-types-del-btn,
.item-types-confirm-cancel,
.item-types-confirm-yes {
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 7px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.item-types-del-btn {
  width: 34px;
  height: 34px;
  justify-content: center;
  background: rgba(184, 70, 92, 0.08);
  color: rgba(227, 168, 177, 0.85);
  border: 1px solid rgba(184, 70, 92, 0.25);
}

.item-types-del-btn:hover {
  background: rgba(184, 70, 92, 0.18);
  color: #e3a8b1;
  border-color: rgba(184, 70, 92, 0.5);
}

.item-types-confirm-cancel {
  width: 34px;
  height: 34px;
  justify-content: center;
  background: rgba(58, 42, 30, 0.25);
  color: rgba(198, 180, 163, 0.85);
  border: 1px solid rgba(58, 42, 30, 0.5);
}

.item-types-confirm-cancel:hover {
  background: rgba(58, 42, 30, 0.4);
  color: #efe0cd;
}

.item-types-confirm-yes {
  padding: 7px 12px;
  background: linear-gradient(135deg, #c0455a, #a33a4c);
  color: #fff;
  border: 1px solid rgba(184, 70, 92, 0.6);
  font-size: 0.78rem;
  box-shadow: 0 2px 8px rgba(184, 70, 92, 0.35);
}

.item-types-confirm-yes:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 70, 92, 0.5);
}

.item-types-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted, #b49a82);
}

.item-types-empty i {
  font-size: 2.5rem;
  color: rgba(122, 74, 42, 0.4);
  margin-bottom: 8px;
}

.item-types-empty p {
  margin: 0;
  font-size: 0.88rem;
}

.item-types-empty strong {
  color: #e0a3ae;
}

.item-types-name-readonly {
  color: #efe0cd;
  font-size: 0.92rem;
  font-weight: 500;
}

.item-types-card-meta-readonly {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.item-types-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid;
  letter-spacing: 0.01em;
}

.item-types-pill-muted {
  background: rgba(58, 42, 30, 0.25);
  border-color: rgba(58, 42, 30, 0.5);
  color: rgba(198, 180, 163, 0.9);
}

.item-types-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid rgba(58, 42, 30, 0.35);
  background: rgba(20, 12, 7, 0.6);
}

.item-types-footer-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(162, 143, 127, 0.75);
}

.item-types-footer-close {
  padding: 8px 18px;
  background: linear-gradient(135deg, #c87743, #a94c60);
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(200, 119, 67, 0.3);
}

.item-types-footer-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(200, 119, 67, 0.45);
}

@media (max-width: 800px) {
  .item-types-header {
    flex-direction: column;
    align-items: stretch;
  }
  .item-types-header-actions {
    justify-content: flex-start;
  }
  .item-types-search-wrap {
    max-width: none;
  }
  .item-types-add-grid {
    grid-template-columns: 1fr 1fr;
  }
  .item-types-add-grid .item-types-field-grow {
    grid-column: 1 / -1;
  }
  .item-types-add-btn {
    grid-column: 1 / -1;
  }
  .item-types-card {
    grid-template-columns: 60px 1fr;
  }
  .item-types-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .item-types-modal,
  .item-types-overlay,
  .item-types-card,
  .item-types-add-btn,
  .item-types-footer-close {
    transition: none !important;
    animation: none !important;
  }
}

/* Items Manager - Rarity Styles */

/* ============================================
   TABS BAR
   ============================================ */
.item-tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  padding: 0 16px;
  background: rgba(20, 12, 7, 0.5);
}

.item-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-tab:hover {
  color: var(--text-main);
}

.item-tab.active {
  color: var(--primary, #c87743);
}

.item-tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary, #c87743);
  border-radius: 2px 2px 0 0;
}

/* ============================================
   TAB PANES
   ============================================ */
.item-tab-pane {
  min-height: 200px;
}

/* ============================================
   HELP / EXPLAINER BOXES
   ============================================ */
.rarity-help-box {
  background: rgba(200, 119, 67, 0.08);
  border: 1px solid rgba(200, 119, 67, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: #b49a82;
  line-height: 1.5;
}

.rarity-help-box strong {
  color: #d6c3ae;
}

.rarity-help-box code {
  background: rgba(200, 119, 67, 0.15);
  color: #e6c0a0;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.78rem;
}

.rarity-help-box ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
}

.rarity-help-box li {
  margin-bottom: 3px;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.rarity-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rarity-section-header h6 {
  margin: 0;
}

.rarity-section-subtitle {
  font-size: 0.78rem;
  color: #8b7461;
  margin-bottom: 12px;
}

/* ============================================
   RARITY OVERVIEW CARDS
   ============================================ */
.rarity-overview-card {
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.rarity-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.rarity-overview-card .rarity-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rarity-overview-card .rarity-card-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 3px 0;
  border-bottom: 1px solid rgba(58, 42, 30, 0.2);
}

.rarity-overview-card .rarity-card-stat:last-child {
  border-bottom: none;
}

.rarity-overview-card .rarity-card-stat .lbl {
  color: var(--text-muted);
  font-weight: 500;
}

.rarity-overview-card .rarity-card-stat .val {
  font-weight: 700;
  color: #e9ecef;
}

/* ============================================
   RARITY CATEGORY BLOCKS (bulk)
   ============================================ */
.rarity-category-block {
  transition: border-color 0.15s;
}

.rarity-category-block:hover {
  filter: brightness(1.05);
}

.rarity-value-input {
  text-align: center;
  font-weight: 600;
}

/* ============================================
   VARIANT CARDS
   ============================================ */
.variant-card {
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.variant-card:hover {
  filter: brightness(1.08);
}

.variant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
}

.variant-card-header .variant-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.variant-card-header .variant-id {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.variant-card-body {
  padding: 10px 14px;
  font-size: 0.85rem;
  border-top: 1px solid rgba(58, 42, 30, 0.3);
}

.variant-card-body .variant-info-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid rgba(58, 42, 30, 0.15);
}

.variant-card-body .variant-info-row:last-child {
  border-bottom: none;
}

.variant-card-body .variant-info-row .lbl {
  color: var(--text-muted);
  font-weight: 500;
}

.variant-card-body .variant-info-row .val {
  color: #e9ecef;
  font-weight: 700;
}

/* ============================================
   RARITY BADGES
   ============================================ */
.rarity-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.rarity-badge.cat-0 { background: rgba(91, 155, 112, 0.2); color: #a3d4b5; }
.rarity-badge.cat-1 { background: rgba(184, 70, 92, 0.2); color: #e3a8b1; }
.rarity-badge.cat-2 { background: rgba(154, 138, 78, 0.2); color: #ecc276; }
.rarity-badge.cat-3 { background: rgba(200, 119, 67, 0.2); color: #e6c0a0; }
.rarity-badge.cat-4 { background: rgba(184, 70, 92, 0.2); color: #f9a8d4; }
.rarity-badge.cat-5 { background: rgba(184, 70, 92, 0.2); color: #e0a3ae; }
.rarity-badge.cat-6 { background: rgba(154, 138, 78, 0.2); color: #fde047; }

/* ============================================
   SWF SYNC BADGES
   ============================================ */
.swf-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.swf-sync-badge.sync-ok {
  background: rgba(91, 155, 112, 0.2);
  color: #a3d4b5;
}

.swf-sync-badge.sync-warn {
  background: rgba(154, 138, 78, 0.2);
  color: #ecc276;
}

.swf-sync-badge.sync-error {
  background: rgba(184, 70, 92, 0.2);
  color: #e3a8b1;
}

/* ============================================
   PREVIEW RESULT BOX
   ============================================ */
.rarity-preview-box {
  background: rgba(20, 12, 7, 0.8);
  border: 1px solid rgba(200, 119, 67, 0.25);
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
  font-size: 0.85rem;
}

.rarity-preview-box .preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(200, 119, 67, 0.15);
}

.rarity-preview-box .preview-header .preview-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #e6c0a0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rarity-preview-box .preview-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.rarity-preview-box .preview-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(38, 26, 18, 0.6);
}

.rarity-preview-box .preview-stat .lbl {
  color: #b49a82;
  font-size: 0.8rem;
}

.rarity-preview-box .preview-stat .val {
  font-weight: 700;
  color: #e9ecef;
  font-size: 0.8rem;
}

/* ============================================
   PREVIEW SAMPLE TABLE
   ============================================ */
.rarity-preview-sample {
  max-height: 220px;
  overflow-y: auto;
  margin-top: 10px;
  border: 1px solid rgba(58, 42, 30, 0.25);
  border-radius: 6px;
}

.rarity-preview-sample table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.rarity-preview-sample thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.rarity-preview-sample th {
  color: #b49a82;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 10px;
  border-bottom: 2px solid rgba(200, 119, 67, 0.2);
  background: #241710;
  text-align: left;
}

.rarity-preview-sample td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.15);
  color: #d6c3ae;
}

.rarity-preview-sample tbody tr:hover {
  background: rgba(200, 119, 67, 0.06);
}

.rarity-preview-sample .old-val {
  color: #b49a82;
}

.rarity-preview-sample .new-val {
  color: #6bb383;
  font-weight: 700;
}

.rarity-preview-sample .arrow-col {
  color: #8b7461;
  text-align: center;
  font-size: 0.75rem;
}

/* ============================================
   VARIANT SEARCH
   ============================================ */
.variant-search-wrap {
  position: relative;
}

.variant-search-results {
  position: absolute;
  z-index: 200;
  background: #1a0f07;
  border: 1px solid rgba(200, 119, 67, 0.4);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 2px;
}

.variant-search-results .search-result-item {
  padding: 7px 12px;
  font-size: 0.82rem;
  color: #e9ecef;
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 42, 30, 0.1);
  transition: background 0.1s;
}

.variant-search-results .search-result-item:hover {
  background: rgba(200, 119, 67, 0.1);
}

/* ============================================
   SWF SYNC ANALYSIS
   ============================================ */
.swf-sync-category-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.2);
  font-size: 0.85rem;
}

.swf-sync-category-row:last-child {
  border-bottom: none;
}

.swf-sync-category-name {
  font-weight: 700;
}

.swf-sync-desync-list {
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.8rem;
  margin-top: 8px;
}

.swf-sync-desync-list table {
  width: 100%;
  border-collapse: collapse;
}

.swf-sync-desync-list th {
  color: #b49a82;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 6px 10px;
  border-bottom: 2px solid rgba(58, 42, 30, 0.3);
  position: sticky;
  top: 0;
  background: #241710;
  text-align: left;
}

.swf-sync-desync-list td {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.12);
  color: #d6c3ae;
}

.swf-sync-desync-list tbody tr:hover {
  background: rgba(184, 70, 92, 0.05);
}

/* ============================================
   TYPE SELECTOR
   ============================================ */
#rarityTypeSelector .rarity-type-checkbox {
  cursor: pointer;
}

#rarityTypeSelector .rarity-type-checkbox:checked + span,
#rarityTypeSelector label:has(.rarity-type-checkbox:checked) {
  color: #e9ecef;
  background: rgba(200, 119, 67, 0.15);
}

#rarityTypeSelector .type-group-chevron {
  transition: transform 0.2s;
}
