.vending-item-picker {
  box-sizing: border-box;
  width: min(56rem, 96vw);
  max-width: 100%;
  max-height: 90dvh;
  margin: auto;
  padding: clamp(.75rem, 2vw, 1.25rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
}

.vending-item-picker[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: .75rem;
}

.vending-item-picker::backdrop { background: #000a; }
.vending-item-picker header, .vending-item-picker footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}

.vending-item-picker h3, .vending-item-picker p { margin: 0; }
.vending-item-picker footer { color: var(--muted); font-size: .88rem; }

.vending-item-picker input[type=search] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.vending-item-picker .grant-categories { min-width: 0; }
.vending-item-picker .grant-shelf {
  min-height: 0;
  max-height: 52dvh;
  padding: .15rem;
  overflow: auto;
}
.vending-item-picker .grant-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(7rem, 100%), 1fr));
  gap: .4rem;
}
.vending-item-picker .grant-tile {
  grid-template-rows: 56px auto auto;
  max-width: 100%;
  padding: .4rem;
  border-radius: 6px;
}
.vending-item-picker .grant-tile :is(strong, small) {
  --ui-overflow-wrap: anywhere;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.vending-item-picker .grant-tile strong { font-size: .86rem; }
.vending-item-picker .grant-tile small { color: var(--muted); font-size: .74rem; }
.vending-item-picker [hidden] { display: none !important; }

.vending-item-icon {
  display: inline-block;
  flex: none;
  width: 56px;
  height: 56px;
  vertical-align: middle;
  background-repeat: no-repeat;
}

@media (max-width: 680px) {
  .vending-item-picker { width: calc(100vw - 1rem); max-height: 94dvh; }
  .vending-item-picker .grant-grid { grid-template-columns: repeat(auto-fill, minmax(min(6rem, 100%), 1fr)); }
  .vending-item-picker input[type=search] { font-size: 16px; }
}

@media (max-height: 480px) {
  .vending-item-picker[open] { display: block; }
  .vending-item-picker[open] > * + * { margin-top: .4rem; }
  .vending-item-picker .grant-shelf { max-height: none; }
}
