body:has(dialog[open]) {
  overflow: hidden;
}
.model-quality {
  font-size: 10px;
  line-height: 1.5;
  margin: 8px 0 14px;
}
.text-detail {
  border: 0;
  background: none;
  color: #b9f978;
  padding: 6px 0;
  font-size: 11px;
  cursor: pointer;
  display: block;
  text-align: left;
}
#hardware-dialog,
#library-dialog {
  padding: 0;
  overflow: hidden;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  box-shadow: 0 32px 120px #000b;
}
#hardware-dialog[open],
#library-dialog[open] {
  display: flex;
  flex-direction: column;
}
#hardware-dialog .dialog-head,
#library-dialog .dialog-head {
  flex: none;
  padding: 22px 26px;
  margin: 0;
  border-bottom: 1px solid #354339;
  gap: 18px;
  background: #1b2521;
}
#hardware-dialog h2,
#library-dialog h2 {
  font-size: 23px;
  overflow-wrap: anywhere;
}
#hardware-report,
#library-report {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px 26px;
  min-height: 0;
}
.quality-badge {
  font-size: 12px;
  color: #d7e8c9;
  background: #273325;
  border: 1px solid #4d643c;
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.6;
}
.hardware-table {
  margin: 20px 0;
}
.hardware-table > div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 1fr);
  padding: 11px 0;
  border-bottom: 1px solid #303a33;
  gap: 12px;
}
.hardware-table dt {
  color: #a8b4b0;
  font-size: 12px;
}
.hardware-table dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}
.reference-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.reference-gallery figure {
  margin: 0;
  border: 1px solid #354139;
  border-radius: 12px;
  padding: 12px;
  background: #0f1614;
}
.reference-gallery img {
  width: 100%;
  height: 250px;
  object-fit: contain;
}
.reference-gallery figcaption {
  font-size: 11px;
  color: #a8b4b0;
  margin-top: 8px;
}
.library-model {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid #354139;
}
.library-model img {
  width: 160px;
  height: 145px;
  object-fit: contain;
  background: #121816;
  border-radius: 10px;
}
.library-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.library-tags span {
  background: #29362b;
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 10px;
}
.library-coverage {
  margin: 18px 0;
}
.library-coverage button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 12px;
  color: #e9f3e8;
  background: #202924;
  border: 1px solid #3a493d;
  border-radius: 8px;
  margin: 7px 0;
  text-align: left;
  font-size: 12px;
}
.library-coverage b {
  color: #b9f978;
  flex: none;
  font-size: 10px;
}
.wiring-panel {
  padding: 14px;
  border: 1px solid #4a5c3e;
  border-radius: 12px;
  background: #151e19;
  margin: 8px 0 16px;
}
.wire-card {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #354338;
}
.wire-card summary {
  cursor: pointer;
  font-size: 11px;
  line-height: 1.5;
  list-style: none;
}
.wire-card summary i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}
.wire-card p {
  font-size: 11px;
  line-height: 1.6;
}
.wire-card .active {
  border-color: #b9f978;
  color: #b9f978;
}
@media (max-width: 650px) {
  #hardware-dialog,
  #library-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  #hardware-dialog .dialog-head,
  #library-dialog .dialog-head {
    padding: 16px;
  }
  #hardware-dialog h2,
  #library-dialog h2 {
    font-size: 18px;
  }
  #hardware-report,
  #library-report {
    padding: 16px;
  }
  .library-model {
    grid-template-columns: 1fr;
  }
  .library-model img {
    width: 100%;
    height: 180px;
  }
  .library-coverage button {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .reference-gallery {
    grid-template-columns: 1fr;
  }
}
dialog::backdrop {
  background: #020608cc;
  backdrop-filter: blur(12px);
}
dialog .icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 27px;
  background: #282e32;
  border: 1px solid #424b50;
  border-radius: 12px;
  cursor: pointer;
}
dialog .icon:hover {
  background: #35422d;
  border-color: #b9f978;
}
dialog .dialog-head .icon {
  position: relative;
  z-index: 2;
  color: #e9f4e8;
  align-self: center;
}
#compatibility-dialog .dialog-head > div {
  min-width: 0;
}
#picker,
#compatibility-dialog {
  padding: 0;
  overflow: hidden;
  width: min(1000px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  box-shadow: 0 32px 120px #000b;
  border-color: #39453f;
}
#picker[open],
#compatibility-dialog[open] {
  display: flex;
  flex-direction: column;
}
#picker .dialog-head,
#compatibility-dialog .dialog-head {
  padding: 24px 28px;
  margin: 0;
  flex: none;
  background: linear-gradient(120deg, #232c27, #171f21);
  border-bottom: 1px solid #364139;
  gap: 20px;
}
.dialog-head h2 {
  margin: 6px 0 0;
}
.picker-controls {
  padding: 18px 28px 14px;
  flex: none;
  background: #151c1e;
  border-bottom: 1px solid #303b35;
}
.picker-controls .filters {
  margin: 0;
  gap: 12px;
}
.picker-controls .filters input {
  flex: 1;
  min-width: 0;
}
.picker-controls .check {
  margin: 12px 0 6px;
}
.picker-controls .ram-filters {
  margin-top: 12px;
}
.picker-controls .ram-filters p {
  margin: 0;
}
#options,
#compatibility-report {
  padding: 18px 28px 24px;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-color: #59694c #151c1e;
}
#options > .sub {
  margin-top: 0;
  font-size: 12px;
}
#picker .option {
  background: #20272a;
  border: 1px solid #35403a;
  border-radius: 14px;
  padding: 18px;
  margin: 12px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
}
#picker .option:has(button:hover) {
  border-color: #a2d968;
  background: #253029;
}
#picker .option h3 {
  font-size: 16px;
  line-height: 1.35;
}
#picker .option > div {
  min-width: 0;
}
#picker .option .price {
  font-size: 14px;
  white-space: nowrap;
}
#picker .option details {
  font-size: 12px;
}
#picker .option .conflict {
  font-size: 11px;
  line-height: 1.5;
  margin-top: 10px;
  color: #d9b882;
}
.picker-footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 28px;
  background: #171f21;
  border-top: 1px solid #364139;
  font-size: 12px;
  color: #a7b5b0;
}
.compat-open {
  margin: 0 0 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.compat-open span {
  color: #b9f978;
  font-size: 11px;
}
.compat-counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.compat-counts span {
  padding: 10px 14px;
  border: 1px solid #394c3b;
  border-radius: 10px;
  background: #202c24;
  font-size: 13px;
}
.compat-counts span:nth-child(2) {
  background: #332725;
  border-color: #67483d;
}
.compat-counts span:nth-child(3) {
  background: #302c23;
  border-color: #635a3e;
}
.compat-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid #344638;
  border-radius: 12px;
  background: #1b2520;
  margin: 12px 0;
}
.compat-card h3 {
  font-size: 14px;
  line-height: 1.5;
  margin: 6px 0;
}
.compat-card p {
  margin: 6px 0;
  line-height: 1.6;
}
.compat-symbol {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: #b9f978;
  color: #172219;
  font-weight: bold;
}
.compat-card.unknown {
  background: #25241f;
  border-color: #4c4533;
}
.unknown .compat-symbol {
  background: #d9b882;
}
.compat-card.failed {
  background: #302120;
  border-color: #764c46;
}
.failed .compat-symbol {
  background: #ff9d89;
}
.board-specs {
  margin-top: 12px;
  border-top: 1px solid #37443b;
  padding-top: 12px;
}
.board-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.board-slots > div {
  background: #141c19;
  border: 1px solid #344338;
  border-radius: 8px;
  padding: 9px;
}
.board-slots b {
  font-size: 18px;
  color: #b9f978;
  display: block;
}
.board-slots span {
  font-size: 10px;
  color: #aebbb2;
}
.board-specs p {
  font-size: 11px;
  line-height: 1.5;
  color: #b9c4bf;
}
@media (max-width: 650px) {
  #picker,
  #compatibility-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 15px;
  }
  #picker .dialog-head,
  #compatibility-dialog .dialog-head {
    padding: 16px;
  }
  dialog h2 {
    font-size: 21px;
  }
  .picker-controls {
    padding: 12px 16px;
  }
  .picker-controls .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 115px;
  }
  .picker-controls select {
    width: 100%;
    font-size: 12px;
  }
  .picker-controls .ram-filters {
    gap: 6px;
  }
  .picker-controls .ram-filters p {
    display: none;
  }
  #options,
  #compatibility-report {
    padding: 12px 16px 16px;
  }
  #picker .option {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
  }
  #picker .option > div {
    grid-column: 1/-1;
  }
  #picker .option .price {
    margin: 0;
  }
  #picker .option h3 {
    font-size: 15px;
  }
  .picker-footer {
    padding: 12px 16px;
  }
  .picker-footer > span {
    max-width: 160px;
  }
  .compat-card {
    padding: 13px;
    gap: 10px;
  }
}
.compat-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  position: relative;
  z-index: 3;
  padding: 0;
  color: #e9f4e8;
  font-size: 22px;
  background: #282e32;
  border-color: #424b50;
  border-radius: 12px;
}

#hardware-dialog .dialog-head > div,
#library-dialog .dialog-head > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
