.hxd-pcb-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.hxd-pcb-table-toolbar__compare {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.hxd-pcb-table-toolbar__compare-main {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.hxd-pcb-compare-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.hxd-pcb-compare-tags:empty {
  display: none;
}

.hxd-pcb-compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  max-width: 100%;
  padding: 0.25rem 0.375rem 0.25rem 0.625rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e4a8c;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.hxd-pcb-compare-tag__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hxd-pcb-compare-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.hxd-pcb-compare-tag__remove:hover {
  background: #dbeafe;
  color: #1e3a8a;
}

.hxd-pcb-table-toolbar__meta {
  font-size: 0.8125rem;
  color: #64748b;
}

.hxd-pcb-table-toolbar__results {
  flex-shrink: 0;
  font-weight: 500;
  color: #475569;
}

.hxd-pcb-compare-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: #3b7cef;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.hxd-pcb-compare-btn:hover:not(:disabled) {
  background: #2563eb;
}

.hxd-pcb-compare-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hxd-pcb-table .hxd-pcb-cell-compare {
  text-align: center;
  vertical-align: middle;
}

.hxd-pcb-table .hxd-pcb-compare-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #3b7cef;
  cursor: pointer;
}

.hxd-pcb-compare-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.hxd-pcb-compare-modal[hidden] {
  display: none;
}

.hxd-pcb-compare-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.hxd-pcb-compare-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.hxd-pcb-compare-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid #c5d0e3;
  background: linear-gradient(180deg, #f4f7fc 0%, #eef2f8 100%);
}

.hxd-pcb-compare-modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #10284c;
}

.hxd-pcb-compare-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #475569;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.hxd-pcb-compare-modal__close:hover {
  background: rgba(16, 40, 76, 0.08);
  color: #10284c;
}

.hxd-pcb-compare-modal__body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 1rem;
  background: #f8fafc;
}

.hxd-pcb-compare-modal__status {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: #64748b;
}

.hxd-pcb-compare-table-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #c5d0e3;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 40, 76, 0.06);
  overflow: hidden;
}

.hxd-pcb-compare-table-head {
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 2px solid #c5d0e3;
}

.hxd-pcb-compare-table-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.hxd-pcb-compare-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.hxd-pcb-compare-col-field {
  width: 18rem;
}

.hxd-pcb-compare-col-material {
  width: 12rem;
}

.hxd-pcb-compare-table th,
.hxd-pcb-compare-table td {
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid #e8edf4;
  vertical-align: top;
  text-align: left;
}

.hxd-pcb-compare-table thead th {
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  background: #eef2f8;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #10284c;
}

.hxd-pcb-compare-table thead th.hxd-pcb-compare-table__corner {
  text-transform: none;
  font-size: 0.9375rem;
  letter-spacing: 0;
  line-height: 1.35;
  white-space: normal;
  background: #e8eef8;
}

.hxd-pcb-compare-table thead th.hxd-pcb-compare-table__material {
  min-width: 11rem;
  background: #e3edff;
  color: #1e4a8c;
  white-space: normal;
  line-height: 1.35;
}

.hxd-pcb-compare-table tbody th.hxd-pcb-compare-table__field {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fafc;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  color: #475569;
  box-shadow: 1px 0 0 #e8edf4;
}

.hxd-pcb-compare-table tbody td.hxd-pcb-compare-table__value {
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
}

.hxd-pcb-compare-table tbody tr:nth-child(even) th.hxd-pcb-compare-table__field {
  background: #f1f5f9;
}

.hxd-pcb-compare-table tbody tr:nth-child(even) td.hxd-pcb-compare-table__value {
  background: #fafbfd;
}

.hxd-pcb-compare-table tbody tr:hover th.hxd-pcb-compare-table__field,
.hxd-pcb-compare-table tbody tr:hover td.hxd-pcb-compare-table__value {
  background: #edf4ff;
}

.hxd-pcb-compare-table tbody tr:last-child th,
.hxd-pcb-compare-table tbody tr:last-child td {
  border-bottom: none;
}

.hxd-pcb-compare-table td.hxd-pcb-compare-table__value.is-empty {
  color: #94a3b8;
  font-style: italic;
}

body.hxd-pcb-compare-modal-open {
  overflow: hidden;
}
