/* Palworld Breeding Calculator Styles */

.pal-tool {
  max-width: 1560px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: var(--cq-text, #1e293b);
  font-family: inherit;
}

html.dark .pal-tool {
  color: var(--cq-text-dark, #f1f5f9);
}

.pal-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--cq-border, #e2e8f0);
  padding-bottom: 1.5rem;
}

html.dark .pal-header {
  border-color: var(--cq-border-dark, #334155);
}

.pal-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pal-brand-lockup span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
}

.pal-brand-lockup small {
  display: block;
  font-size: 0.7rem;
  color: var(--cq-muted, #64748b);
  font-weight: 500;
}

.pal-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.pal-lead {
  font-size: 1.05rem;
  color: var(--cq-muted, #64748b);
  max-width: 800px;
  margin: 0;
  line-height: 1.5;
}

html.dark .pal-lead {
  color: var(--cq-muted-dark, #94a3b8);
}

/* Tabs Navigation */
.pal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--cq-border, #e2e8f0);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

html.dark .pal-tabs {
  border-color: var(--cq-border-dark, #334155);
}

.pal-tab-btn {
  background: transparent;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cq-muted, #64748b);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pal-tab-btn:hover {
  color: var(--cq-text, #0f172a);
  background: var(--cq-hover, #f8fafc);
}

html.dark .pal-tab-btn:hover {
  color: #fff;
  background: #1e293b;
}

.pal-tab-btn.active {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 2px solid #6366f1;
}

/* Roster / Backpack Panel */
.pal-roster-box {
  background: var(--cq-card-bg, #f8fafc);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

html.dark .pal-roster-box {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-roster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pal-roster-header h3 {
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pal-roster-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.pal-roster-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pal-preset-btn {
  background: transparent;
  border: 1px solid var(--cq-border, #cbd5e1);
  color: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

html.dark .pal-preset-btn {
  border-color: #475569;
}

.pal-preset-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
  color: #6366f1;
}

.pal-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 180px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  border: 1px dashed var(--cq-border, #cbd5e1);
}

html.dark .pal-chips-wrap {
  background: rgba(0, 0, 0, 0.2);
  border-color: #334155;
}

.pal-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid var(--cq-border, #cbd5e1);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

html.dark .pal-chip {
  background: #0f172a;
  border-color: #475569;
}

.pal-chip-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 1rem;
  line-height: 1;
}

.pal-chip-remove:hover {
  color: #ef4444;
}

/* Search and Quick Filters */
.pal-search-panel {
  background: var(--cq-card-bg, #f8fafc);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

html.dark .pal-search-panel {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-search-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.pal-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--cq-border, #cbd5e1);
  background: #fff;
  color: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

html.dark .pal-search-input {
  background: #0f172a;
  border-color: #475569;
  color: #fff;
}

.pal-search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.pal-dropdown-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--cq-border, #e2e8f0);
  font-size: 0.9rem;
}

html.dark .pal-dropdown-item {
  border-color: #334155;
}

.pal-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.pal-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pal-quick-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cq-muted, #64748b);
  margin-right: 0.25rem;
}

.pal-tag-btn {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #6366f1;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.pal-tag-btn:hover {
  background: #6366f1;
  color: #fff;
}

/* Selected Target Header */
.pal-target-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.pal-target-identity {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pal-target-dex {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.pal-target-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}

.pal-target-zh {
  font-size: 1.1rem;
  color: var(--cq-muted, #64748b);
  font-weight: 600;
}

.pal-work-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pal-work-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
}

html.dark .pal-work-badge {
  background: #334155;
  color: #cbd5e1;
}

/* Breeding Tree Cards */
.pal-tree-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.pal-tree-card {
  background: var(--cq-card-bg, #ffffff);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html.dark .pal-tree-card {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--cq-border, #e2e8f0);
  padding-bottom: 0.5rem;
}

html.dark .pal-tree-header {
  border-color: var(--cq-border-dark, #334155);
}

.pal-gen-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.pal-tree-step {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

html.dark .pal-tree-step {
  background: rgba(0, 0, 0, 0.2);
}

.pal-step-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6366f1;
  min-width: 50px;
}

.pal-node-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  background: #ffffff;
  border: 1px solid var(--cq-border, #cbd5e1);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

html.dark .pal-node-chip {
  background: #0f172a;
  border-color: #475569;
}

.pal-node-chip.target {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border-color: #6366f1;
  color: #6366f1;
}

.pal-arrow {
  color: #94a3b8;
  font-weight: 800;
  padding: 0 0.3rem;
}

/* Results Grid */
.pal-results-section h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pal-results-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cq-muted, #64748b);
}

.pal-pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.75rem;
}

.pal-pair-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cq-card-bg, #ffffff);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.1s,
    border-color 0.15s;
}

html.dark .pal-pair-card {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-pair-card:hover {
  border-color: #6366f1;
}

.pal-pair-p1,
.pal-pair-p2 {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.pal-pair-p1:hover,
.pal-pair-p2:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.pal-pair-plus {
  color: #94a3b8;
  font-weight: 700;
  padding: 0 0.4rem;
}

.pal-subname {
  display: block;
  font-size: 0.75rem;
  color: var(--cq-muted, #64748b);
  font-weight: 400;
}

/* Forward Calculator Selectors */
.pal-forward-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .pal-forward-wrap {
    grid-template-columns: 1fr;
  }
}

.pal-forward-card {
  background: var(--cq-card-bg, #f8fafc);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
}

html.dark .pal-forward-card {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-forward-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.5rem;
}

.pal-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--cq-border, #cbd5e1);
  background: #fff;
  color: inherit;
  font-size: 0.95rem;
}

html.dark .pal-select {
  background: #0f172a;
  border-color: #475569;
  color: #fff;
}

.pal-child-result {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(99, 102, 241, 0.15));
  border: 2px solid #6366f1;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.pal-child-result h3 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

/* Passive Skills Section */
.pal-passives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pal-passive-card {
  background: var(--cq-card-bg, #ffffff);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 8px;
  padding: 1rem;
}

html.dark .pal-passive-card {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-passive-title {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.pal-passive-tier {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #fef08a;
  color: #854d0e;
}

.pal-passive-effect {
  font-size: 0.85rem;
  color: #10b981;
  font-weight: 600;
  margin: 0;
}

/* Editorial & Methodology Section */
.pal-methodology {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--cq-border, #e2e8f0);
}

html.dark .pal-methodology {
  border-color: var(--cq-border-dark, #334155);
}

.pal-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.pal-method-card {
  background: var(--cq-card-bg, #f8fafc);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 8px;
  padding: 1.25rem;
}

html.dark .pal-method-card {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-method-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.pal-method-card p {
  font-size: 0.9rem;
  color: var(--cq-muted, #64748b);
  line-height: 1.5;
  margin: 0;
}

html.dark .pal-method-card p {
  color: var(--cq-muted-dark, #94a3b8);
}

/* How to Use 3-Step Guide Banner */
.pal-guide-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

html.dark .pal-guide-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(30, 41, 59, 0.7) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

.pal-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.pal-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6366f1;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.pal-guide-step strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  color: var(--cq-text, #0f172a);
}

html.dark .pal-guide-step strong {
  color: #f1f5f9;
}

.pal-guide-step span {
  display: block;
  font-size: 0.82rem;
  color: var(--cq-muted, #64748b);
  line-height: 1.4;
}

html.dark .pal-guide-step span {
  color: #94a3b8;
}

.pal-step-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.pal-scope-toggle {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 1rem;
  flex-wrap: wrap;
}

.pal-scope-btn {
  background: var(--cq-card-bg, #fff);
  border: 1px solid var(--cq-border, #cbd5e1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
  transition: all 0.15s ease;
}

html.dark .pal-scope-btn {
  background: #1e293b;
  border-color: #475569;
}

.pal-scope-btn:hover {
  border-color: #6366f1;
}

.pal-scope-btn.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

/* --- ELEMENT COLOR THEMES & BADGES --- */
.pal-elem-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.elem-fire { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.elem-water { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.elem-electric { background: #fef9c3; color: #a16207; border: 1px solid #fef08a; }
.elem-grass { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.elem-ice { background: #e0f7fa; color: #00838f; border: 1px solid #b2ebf2; }
.elem-ground { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.elem-dark { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.elem-dragon { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.elem-neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

html.dark .elem-fire { background: rgba(234, 88, 12, 0.2); color: #fb923c; border-color: rgba(234, 88, 12, 0.4); }
html.dark .elem-water { background: rgba(2, 132, 199, 0.2); color: #38bdf8; border-color: rgba(2, 132, 199, 0.4); }
html.dark .elem-electric { background: rgba(202, 138, 4, 0.2); color: #facc15; border-color: rgba(202, 138, 4, 0.4); }
html.dark .elem-grass { background: rgba(22, 163, 74, 0.2); color: #4ade80; border-color: rgba(22, 163, 74, 0.4); }
html.dark .elem-ice { background: rgba(8, 145, 178, 0.2); color: #22d3ee; border-color: rgba(8, 145, 178, 0.4); }
html.dark .elem-ground { background: rgba(217, 119, 6, 0.2); color: #fbbf24; border-color: rgba(217, 119, 6, 0.4); }
html.dark .elem-dark { background: rgba(124, 58, 237, 0.2); color: #c084fc; border-color: rgba(124, 58, 237, 0.4); }
html.dark .elem-dragon { background: rgba(79, 70, 229, 0.2); color: #a5b4fc; border-color: rgba(79, 70, 229, 0.4); }
html.dark .elem-neutral { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; border-color: rgba(100, 116, 139, 0.4); }

/* --- TARGET SHOWCASE CARD --- */
.pal-target-showcase {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--cq-card-bg, #ffffff);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

html.dark .pal-target-showcase {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pal-showcase-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 2px solid rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pal-showcase-avatar {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.pal-showcase-info {
  flex: 1;
  min-width: 0;
}

.pal-showcase-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.pal-showcase-dex {
  font-size: 0.9rem;
  font-weight: 800;
  color: #6366f1;
}

.pal-showcase-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.pal-showcase-stats {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--cq-muted, #64748b);
  font-weight: 600;
}

/* --- PAIR FORMULA CARD GRID --- */
.pal-formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pal-pair-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cq-card-bg, #ffffff);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

html.dark .pal-pair-card {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-pair-card:hover {
  transform: translateY(-2px);
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.pal-pair-slot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.pal-pair-slot:hover {
  background: rgba(99, 102, 241, 0.08);
}

.pal-thumb-sm {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  object-fit: contain;
  flex-shrink: 0;
}

html.dark .pal-thumb-sm {
  background: rgba(255, 255, 255, 0.05);
}

.pal-slot-text {
  min-width: 0;
  line-height: 1.2;
}

.pal-slot-dex {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cq-muted, #64748b);
}

.pal-slot-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pal-pair-plus {
  font-size: 1.1rem;
  font-weight: 800;
  color: #6366f1;
  padding: 0 0.4rem;
  flex-shrink: 0;
}

/* Autocomplete with Icons */
.pal-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--cq-border, #f1f5f9);
  transition: background 0.15s;
}

html.dark .pal-dropdown-item {
  border-color: #334155;
}

.pal-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* Quick pills with icons */
.pal-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pal-tag-thumb {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Interactive Forward Workbench */
.pal-bench-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2.5rem 1.5rem;
  background: var(--cq-card-bg, #ffffff);
  border: 1px solid var(--cq-border, #e2e8f0);
  border-radius: 16px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

html.dark .pal-bench-wrap {
  background: var(--cq-card-bg-dark, #1e293b);
  border-color: var(--cq-border-dark, #334155);
}

.pal-bench-card {
  width: 260px;
  text-align: center;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.03);
  border: 2px dashed rgba(99, 102, 241, 0.2);
}

.pal-bench-card.pal-bench-result {
  border-style: solid;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.pal-bench-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.75rem;
  object-fit: contain;
  display: block;
}

.pal-bench-op {
  font-size: 2rem;
  font-weight: 800;
  color: #6366f1;
}

/* Full Pal Picker Grid */
.pal-picker-grid[hidden],
.pal-dropdown[hidden] {
  display: none;
}

.pal-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--cq-card-bg, #fff);
  border: 1px solid var(--cq-border, #cbd5e1);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

html.dark .pal-picker-grid {
  background: #0f172a;
  border-color: #334155;
}

.pal-picker-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--cq-border, #e2e8f0);
  background: var(--cq-card-bg, #fff);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s ease;
  user-select: none;
}

html.dark .pal-picker-item {
  background: #1e293b;
  border-color: #334155;
}

.pal-picker-item:hover {
  border-color: #6366f1;
}

.pal-picker-item.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

html.dark .pal-picker-item.selected {
  color: #34d399;
}


