/* ==========================================================================
   parts_catalog.css - Parts Staging Catalog & Grouped BOM Card Grid
   ========================================================================== */

.parts-catalog-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 54px 30px 20px;
  box-sizing: border-box;
  background: var(--bg-main, #1e1e1e);
  overflow-y: auto;
  scrollbar-gutter: stable; /* 画面幅のガタつき（スクロールバー出現・消失時の横揺れ）を完全防止 */
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.parts-catalog-container::-webkit-scrollbar {
  width: 6px;
}

.parts-catalog-container::-webkit-scrollbar-track {
  background: transparent;
}

.parts-catalog-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
}

.parts-catalog-container::-webkit-scrollbar-thumb:hover {
  background: rgba(234, 118, 0, 0.5);
}

/* Sticky Top Section: Outer Tab Bar & Header Box (Always stays pinned during scroll) */
.catalog-sticky-top-section {
  position: sticky;
  top: -16px;
  z-index: 30;
  background: var(--bg-main, #1e1e1e);
  padding-top: 16px;
  margin-top: -16px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

/* 1. Outer Tab Bar (枠の外側・上部につくフォルダータブ) */
.catalog-outer-tab-bar {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  margin-left: 8px;
  margin-bottom: -1px;
  position: relative;
  z-index: 28;
  height: 38px;
}

.catalog-tab-btn {
  height: 38px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  background: #1e1e1e;
  border: 1px solid #383838;
  border-top: 3px solid transparent; /* 非アクティブ時も同幅確保でガタつき防止 */
  border-bottom: 1px solid #484848;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  user-select: none;
  position: relative;
}

.catalog-tab-btn:hover {
  color: #f1f5f9;
  background: #242424;
  border-color: #4a4a4a;
}

.catalog-tab-btn.active {
  color: #ffffff;
  background: #282828;
  font-weight: 700;
  border-color: #484848;
  border-top-color: #ea7600;
  border-bottom-color: #282828; /* 下枠とシームレス結合 */
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.35);
  z-index: 29;
}

.catalog-tab-btn[data-tab="filler"].active {
  border-top-color: #b47eb5;
  border-bottom-color: #282828;
}

.tab-icon {
  font-size: 14px;
  line-height: 1;
}

.tab-label {
  font-size: 12.5px;
  line-height: 1;
}

.tab-count-badge {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.15s ease;
}

.catalog-tab-btn.active .tab-count-badge {
  background: rgba(234, 118, 0, 0.25);
  color: #ff9f43;
  border: 1px solid rgba(234, 118, 0, 0.5);
}

.catalog-tab-btn[data-tab="filler"].active .tab-count-badge {
  background: rgba(180, 126, 181, 0.25);
  color: #e8d7ea;
  border: 1px solid rgba(180, 126, 181, 0.5);
}

/* 2. BOM Summary Header Bar / Box (枠内 - タブを切り替えると中身が連動) */
.parts-catalog-header {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  box-sizing: border-box;
  padding: 10px 18px;
  background: #282828;
  backdrop-filter: blur(14px);
  border: 1px solid #484848;
  border-radius: 0 8px 8px 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  margin-bottom: 0;
  flex-shrink: 0;
}

.catalog-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 34px;
}

/* File Actions Container */
.catalog-file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
}

/* Parts Catalog Material & Thickness Bar (パーツ群の属性) */
.parts-attr-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  box-sizing: border-box;
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 10px;
}

.parts-attr-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.parts-attr-label {
  font-size: 11px;
  font-weight: 700;
  color: #a0a0a0;
  white-space: nowrap;
}

.parts-attr-select {
  background: #181818;
  border: 1px solid #383838;
  color: #f0f0f0;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.parts-attr-select:focus {
  border-color: #ea7600;
}

.catalog-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 26px;
}

.catalog-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  box-sizing: border-box;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.catalog-stat-pill strong {
  color: #38bdf8;
  font-family: monospace;
}

.catalog-stat-pill.emerald strong {
  color: #34d399;
}

.catalog-stat-pill.purple strong {
  color: #a5b4fc;
}

/* Action CTA inside Catalog Header */
.catalog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  height: 34px;
}

.btn-catalog-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-catalog-reset:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-catalog-add-parts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-catalog-add-parts:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-catalog-filler-lib {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.4);
  border-radius: 8px;
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-catalog-filler-lib:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818cf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-catalog-filler-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-catalog-filler-reset:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-start-nest-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
  transition: all 0.2s ease;
}

.btn-start-nest-hero:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.btn-start-nest-hero.filler-cta {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: #818cf8;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-start-nest-hero.filler-cta:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}

.btn-start-nest-hero:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 2. Parts Card Grid */
.parts-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  flex: 1;
  align-content: start;
  min-height: 350px;
  padding-bottom: 24px;
}

/* Individual Grouped Part Card */
.part-group-card {
  background: #252525;
  border: 1px solid #383838;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 335px;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.part-group-card:hover {
  background: #2b2b2b;
  border-color: #ea7600;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* Card Header (ID & Rotation badge) */
.part-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.part-group-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #f0f0f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.part-rot-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(234, 118, 0, 0.15);
  color: #ff9f43;
  border: 1px solid rgba(234, 118, 0, 0.35);
}

/* SVG Thumbnail Box */
.part-thumbnail-box {
  width: 100%;
  height: 90px;
  background: #181818;
  border-radius: 6px;
  border: 1px solid #333333;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  padding: 4px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.part-thumbnail-box svg {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   Card Layout Sections: Specs (Read-Only) vs Control Panel (Interactive)
   ========================================================================== */

/* 1. Status & Specs Box (Read-Only) */
.part-specs-section {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px;
  background: #1e1e1e;
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 6px;
  font-size: 10.5px;
  color: #a0a0a0;
  visibility: visible !important;
  opacity: 1 !important;
  flex-shrink: 0;
}

.part-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.35;
}

.part-spec-row .spec-label {
  color: #888888;
  font-weight: 600;
  font-size: 10px;
}

.part-spec-row .spec-val {
  color: #e0e0e0;
  font-family: monospace;
  font-size: 10.5px;
}

/* 2. Interactive Control Panel (Inputs & Toggles) */
.part-control-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px;
  background: #1c1c1c;
  border: 1px solid #383838;
  border-radius: 6px;
  padding: 6px 8px;
  position: relative;
  visibility: visible !important;
  opacity: 1 !important;
  margin-top: auto;
  box-sizing: border-box;
  flex-shrink: 0;
}

.filler-card-theme .part-control-panel {
  background: #1e1c24;
  border: 1px solid rgba(180, 126, 181, 0.35);
}

.part-control-panel-main {
  background: #1c1c1c;
  border: 1px solid #383838;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px;
  visibility: visible !important;
  opacity: 1 !important;
  margin-top: auto;
  box-sizing: border-box;
  flex-shrink: 0;
}

.control-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 3px;
  border-bottom: 1px solid #333333;
  margin-bottom: 2px;
}

.control-section-title {
  font-size: 9.5px;
  font-weight: 800;
  color: #ff9f43;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Filler Mode Container */
.filler-mode-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #181818;
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 4px 7px;
}

.control-row-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #a0a0a0;
}

.btn-max-fill-toggle {
  background: #252525;
  border: 1px solid #444444;
  color: #d0d0d0;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-max-fill-toggle:hover {
  background: #333333;
  border-color: #ea7600;
  color: #ff9f43;
  transform: translateY(-1px);
}

.btn-max-fill-toggle.active {
  background: linear-gradient(135deg, #ea7600, #d35400);
  border-color: #ff9f43;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(234, 118, 0, 0.45);
  transform: translateY(0);
}

/* Quantity Stepper Controller */
.part-qty-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #181818;
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 4px 7px;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.part-qty-container.disabled-mode {
  opacity: 0.45;
  pointer-events: none;
}

.part-qty-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #a0a0a0;
}

.part-qty-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-qty-step {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #484848;
  background: #2b2b2b;
  color: #f0f0f0;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
  touch-action: manipulation;
}

.btn-qty-step:hover:not(:disabled) {
  background: #ea7600;
  color: #ffffff;
  border-color: #ff9f43;
  box-shadow: 0 0 8px rgba(234, 118, 0, 0.4);
}

.btn-qty-step:active:not(:disabled) {
  background: #d35400;
  color: #ffffff;
  transform: scale(0.92);
}

.btn-qty-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Hide native number input spin arrows */
input[type="number"].input-part-qty::-webkit-inner-spin-button,
input[type="number"].input-part-qty::-webkit-outer-spin-button,
input[type="number"].input-qty-num::-webkit-inner-spin-button,
input[type="number"].input-qty-num::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none !important;
}

input[type="number"].input-part-qty,
input[type="number"].input-qty-num {
  -moz-appearance: textfield;
  appearance: textfield;
  width: 48px;
  height: 26px;
  text-align: center;
  background: #141414;
  border: 1px solid #444444;
  border-radius: 4px;
  color: #ff9f43;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 4px;
}

input[type="number"].input-part-qty:focus,
input[type="number"].input-qty-num:focus {
  outline: none;
  border-color: #ea7600;
  box-shadow: 0 0 8px rgba(234, 118, 0, 0.5);
}

/* Rotation Mode Segmented Button Bar */
.part-rot-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.part-rot-label {
  font-size: 9.5px;
  font-weight: 700;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.part-rot-btn-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: #181818;
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 2px;
}

.btn-rot-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  font-size: 10px;
  font-weight: 600;
  color: #999999;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-rot-mode:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-rot-mode.active {
  color: #ffffff;
  background: #ea7600;
  border-color: #ff9f43;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.4);
}

.btn-rot-mode .rot-icon {
  font-size: 10px;
}

.btn-rot-mode .rot-txt {
  font-size: 9.5px;
}

/* Empty Catalog State & Interactive Central Dropzone */
.parts-catalog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 75px auto 40px auto;
  max-width: 580px;
  width: 90%;
  min-height: 250px;
  padding: 38px 24px;
  background: rgba(15, 23, 42, 0.6);
  border: 2px dashed rgba(56, 189, 248, 0.38);
  border-radius: 14px;
  color: #94a3b8;
  text-align: center;
  gap: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.parts-catalog-empty:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.09);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.22);
  transform: translateY(-2px);
}

.parts-catalog-empty.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.22);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.45);
  transform: scale(1.02);
}

.parts-catalog-empty-icon {
  font-size: 54px;
  line-height: 1;
  margin-bottom: 2px;
  opacity: 0.88;
  transition: transform 0.25s ease;
}

.parts-catalog-empty:hover .parts-catalog-empty-icon {
  transform: scale(1.12);
}

.parts-catalog-empty-text {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.parts-catalog-empty-sub {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
}

.parts-catalog-empty-btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: none;
  transition: all 0.2s ease;
}

.parts-catalog-empty:hover .parts-catalog-empty-btn {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   2. Filler Parts Staging Section (Stage 1 Bottom Area)
   ========================================================================== */
.filler-section-divider {
  grid-column: 1 / -1;
  margin-top: 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 2px dashed rgba(99, 102, 241, 0.35);
  padding-top: 18px;
}

.filler-section-title-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filler-section-header-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filler-section-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(129, 140, 248, 0.15));
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filler-section-sub {
  font-size: 11px;
  color: #94a3b8;
}

.filler-section-hint-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  padding-left: 2px;
}

.filler-section-hint-line .hint-tag {
  color: #facc15;
  font-weight: 700;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
}

.filler-section-hint-line .hint-text {
  color: #cbd5e1;
}

.part-group-card.filler-card-theme {
  background: #232029;
  border: 1px solid rgba(180, 126, 181, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  min-height: 365px;
}

.part-group-card.filler-card-theme:hover {
  border-color: #c084fc;
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.25);
  transform: translateY(-2px);
}

.part-group-card.filler-card-theme.active-fill {
  border-color: #a855f7;
  background: #2a2533;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.3);
}

.part-tag-filler {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #e9d5ff;
}

.btn-max-fill-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-max-fill-toggle:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

.btn-max-fill-toggle.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* Filler Priority Star Button (☆ / ★) */
.btn-filler-priority {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

.btn-filler-priority:hover {
  background: rgba(234, 179, 8, 0.15);
  border-color: #facc15;
  color: #facc15;
  transform: scale(1.1);
}

.btn-filler-priority.active {
  background: rgba(234, 179, 8, 0.2);
  border-color: #facc15;
  color: #facc15;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.55);
  transform: scale(1.05);
  animation: pulseGold 2s infinite ease-in-out;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 10px rgba(234, 179, 8, 0.5); }
  50% { box-shadow: 0 0 18px rgba(234, 179, 8, 0.85); }
}

.part-group-card.priority-pinned {
  border-color: rgba(234, 179, 8, 0.65) !important;
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.25) !important;
}

.part-mat-badge {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.part-mat-badge.any {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
}

.filler-mat-tag {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.filler-match-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  line-height: 1.2;
}

.filler-match-badge.match {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.filler-match-badge.mismatch {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.part-group-card.mismatch-card,
.filler-card.mismatch-card {
  opacity: 0.58;
  filter: grayscale(0.25);
  border-color: rgba(239, 68, 68, 0.3) !important;
  transition: opacity 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.part-group-card.mismatch-card:hover,
.filler-card.mismatch-card:hover {
  opacity: 0.95;
  filter: none;
}
