.shelf {
  margin: 0 0 16px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
}
.shelf > summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}
.shelf > summary::-webkit-details-marker {
  display: none;
}
.shelf[open] > summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.shelf-adds {
  display: flex;
  gap: 8px;
}
.shelf-adds .lot-add {
  flex: 1;
}
.shelf-out {
  padding-bottom: 12px;
}
.shelf-sum h3 small {
  font: 400 .9rem var(--f-body);
  color: var(--muted);
}
.shelf-sum-line {
  margin: 0 0 8px;
}
.shelf-all-grabs {
  width: 100%;
  min-height: 48px;
  margin: 2px 0 8px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 1rem var(--f-display);
  cursor: pointer;
}
.shelf-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.shelf-bar .lot-seg {
  flex: none;
}
.shelf-bar .lot-seg button {
  min-height: 44px;
  font-size: .88rem;
}
.shelf-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shelf-row {
  border: 1px solid var(--line);
  border-left: 5px solid var(--v,var(--line));
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.shelf-row.g-grab {
  --v:var(--good);
}
.shelf-row.g-maybe {
  --v:var(--warn);
}
.shelf-row.g-skip,
.shelf-row.g-unpriced {
  --v:var(--line);
}
.shelf-row-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
}
.shelf-row-btn:disabled {
  cursor: default;
}
.shelf-row-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.shelf-price {
  flex: 0 0 auto;
  min-width: 3.4em;
  font: 700 1.1rem var(--f-num);
}
.shelf-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.shelf-name small {
  font-weight: 400;
  color: var(--muted);
}
.shelf-num {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.5em;
  margin-right: 6px;
  border-radius: 999px;
  background: #ffd60a;
  color: #111;
  font: 700 .8rem var(--f-body);
}
.shelf-chip {
  border-color: var(--v,var(--line));
  color: var(--v,var(--muted));
}
.shelf-row.g-skip .shelf-chip,
.shelf-row.g-unpriced .shelf-chip {
  color: var(--muted);
}
.shelf-speed {
  font-size: .92rem;
  font-weight: 600;
}
.shelf-row.g-grab .shelf-speed {
  color: var(--good);
}
.shelf-why {
  font-size: .88rem;
  color: var(--muted);
}
.shelf-find {
  font-size: .85rem;
  color: var(--accent);
  font-weight: 600;
}
.shelf-row-btn:disabled .shelf-find {
  display: none;
}
.shelf-view {
  padding: 0;
  border: 0;
  border-radius: 14px;
  width: min(96vw, 720px);
  max-height: 92vh;
  background: var(--card);
  color: var(--ink);
}
.shelf-view::backdrop {
  background: rgba(0, 0, 0, .75);
}
.shelf-view-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
}
.shelf-view-top button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.6rem;
  cursor: pointer;
}
.shelf-fig {
  margin: 0 0 10px;
}
.shelf-fig svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--soft);
}
.shelf-fig figcaption {
  padding: 6px 14px;
  font-size: .9rem;
  color: var(--muted);
}
.shelf-modes {
  margin: 0 0 8px;
}
