.pc-images {
  width: 100%;
  min-width: 0;
  container: image-picker / inline-size;
}

.pc-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 12px;
  max-width: 1114px;
}

.pc-image-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8dfe9;
  background: #fff;
  border-radius: 0;
  color: #202c41;
}

.pc-image-card:hover { border-color: #91ade5; }
.pc-image-card.is-picked {
  border-color: #2863ee;
  box-shadow: 0 0 0 1px #2863ee inset;
}

.pc-image-card .pc-image-pick {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 50px;
  padding: 0 12px;
  text-align: start;
  border: 0;
  border-radius: 0;
  background: #f0f1f6;
  color: #20314c;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.pc-image-pick span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pc-image-card.is-picked .pc-image-pick { color: #1a50cb; background: #f0f1f6; }
.pc-image-mark { flex: 0 0 24px; width: 24px; height: 24px; }
.pc-image-check {
  width: 14px;
  height: 14px;
  margin-left: auto;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pc-image-version { position: relative; min-width: 0; }
.pc-image-version select {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 0;
  border-top: 1px solid #e7ecf3;
  border-radius: 0;
  background: transparent;
  padding: 0 25px 0 12px;
  color: #35445a;
  font: inherit;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.pc-image-version select:hover { color: #1a50cb; }
.pc-image-preview {
  pointer-events: none;
  position: absolute;
  inset: 3px 25px 3px 3px;
  align-content: center;
  padding-inline-start: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff;
  color: #35445a;
  font-size: 12px;
}
[data-theme='dark'] .pc-image-preview { background: var(--shell-bg); color: var(--shell-ink); }
.pc-image-version > svg {
  position: absolute;
  width: 12px;
  height: 12px;
  inset-inline-end: 9px;
  top: calc(50% - 6px);
  pointer-events: none;
  fill: none;
  stroke: #607086;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}
.pc-image-card :is(button, select):focus-visible {
  outline: 2px solid #2863ee;
  outline-offset: -3px;
}
.pc-images-empty { margin: 0; color: #637089; font-size: 13px; }

@container image-picker (min-width: 900px) {
  .pc-images-grid { grid-template-columns: repeat(5, minmax(0, 210px)); gap: 16px; }
}
@container image-picker (max-width: 760px) {
  .pc-images-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container image-picker (max-width: 440px) {
  .pc-images-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pc-image-card .pc-image-pick { height: 42px; padding-inline: 10px; }
  .pc-image-version select { height: 38px; padding-inline-start: 10px; }
  .pc-image-preview { padding-inline-start: 7px; }
}
@container image-picker (max-width: 230px) {
  .pc-images-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (forced-colors: active) {
  .pc-image-card.is-picked { outline: 2px solid Highlight; }
  .pc-image-version select { appearance: auto; }
  .pc-image-preview { background: Canvas; color: CanvasText; }
  .pc-image-version > svg { display: none; }
}
