/* Family Depot section of the navbar drawer (#drawer.depot-drawer). The drawer
   owns header, close button, focus and scrolling; the panel owns its columns. */
.drawer.depot-drawer {
  width: min(calc(880px + var(--ui-nav-rail-size)), 100%);
}
.family-depot-panel {
  container: family-storage / inline-size;
  color: var(--ui-color-text);
}
.family-depot-panel .storage-content {
  padding-top: var(--ui-space-3);
}
.family-depot-panel .storage-status {
  position: sticky;
  bottom: calc(-1 * var(--ui-space-4));
  z-index: 2;
  margin: var(--ui-space-3) 0 0;
  background: var(--ui-color-surface-raised);
  padding: var(--ui-space-2) var(--ui-space-4);
  border-top: 1px solid var(--ui-color-border-subtle);
  color: var(--ui-color-text-muted);
  font: 600 11px/1.3 var(--ui-font-body);
}
.storage-status[data-tone="danger"] {
  color: var(--ui-color-danger);
}
.storage-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}
.storage-note {
  margin: var(--ui-space-2) 0 0;
  color: var(--ui-color-text-muted);
  font-size: 11px;
  line-height: 1.45;
}
.family-depot-panel .storage-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px 80px 64px 64px;
  align-items: end;
  gap: var(--ui-space-2);
  margin: var(--ui-space-3) 0 0;
}
.family-depot-panel .storage-toolbar:not(.pokemon-filter-toolbar) {
  grid-template-columns: minmax(0, 1fr);
}
.family-depot-panel
  .storage-toolbar
  :is(.depot-search, .quality-filter, .iv-range-filter) {
  display: grid;
  align-items: stretch;
  gap: var(--ui-space-1);
  width: 100%;
  min-width: 0;
  max-width: none;
  color: var(--ui-color-text-muted);
  font: 700 10px/1.2 var(--ui-font-body);
}
.family-depot-panel .storage-toolbar .quality-filter > span {
  color: inherit;
  font: inherit;
}
.family-depot-panel .storage-toolbar .storage-quality-mount {
  width: 100%;
}
.family-depot-panel .storage-toolbar :is(input, .custom-select-trigger) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: var(--ui-space-1) var(--ui-space-2);
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius);
  background: var(--ui-color-surface);
  color: var(--ui-color-text);
  font: 600 12px/1.2 var(--ui-font-body);
}
.family-depot-panel .storage-toolbar .custom-select-primary {
  font: 600 12px/1.2 var(--ui-font-body);
}
.family-depot-panel .storage-toolbar :is(input, .custom-select-trigger):hover {
  border-color: var(--ui-color-primary-hover);
  background: var(--ui-color-surface-raised);
}
.family-depot-panel .storage-toolbar .collection-sort {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--ui-space-1);
  margin: 0;
}
.storage-toolbar .collection-sort > span {
  margin: 0 var(--ui-space-1) 0 0;
}
.storage-toolbar .collection-sort button {
  min-height: 24px;
  padding: var(--ui-space-1) var(--ui-space-2);
  font: 700 10px/1.2 var(--ui-font-body);
}
.storage-variant-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-1);
  margin-top: var(--ui-space-2);
}
.storage-variant-filters > span {
  margin-right: var(--ui-space-1);
  color: var(--ui-color-text-muted);
  font: 700 10px/1.2 var(--ui-font-body);
}
.storage-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-space-3);
  margin-top: var(--ui-space-3);
  container-type: inline-size;
}
.storage-column {
  display: grid;
  align-content: start;
  gap: var(--ui-space-2);
  min-width: 0;
}
.storage-column .section-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--ui-space-1) var(--ui-space-2);
  margin: 0;
  padding-bottom: var(--ui-space-1);
  border-bottom: 1px solid var(--ui-color-border-subtle);
}
.storage-column .section-heading h3 {
  color: var(--ui-color-text);
  font: 800 16px/1.2 var(--ui-font-body);
  overflow-wrap: anywhere;
}
.storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-1);
}
.storage-actions button,
.storage-item button {
  min-height: 26px;
  padding: var(--ui-space-1) var(--ui-space-2);
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius);
  background: var(--ui-color-surface-control);
  color: var(--ui-color-text);
  font: 700 10px/1.2 var(--ui-font-body);
  white-space: nowrap;
  cursor: pointer;
}
.storage-actions .storage-move {
  border-color: var(--ui-color-primary);
  background: var(--ui-color-action);
  color: var(--ui-color-on-primary);
}
.storage-actions button:hover:not(:disabled),
.storage-item button:hover:not(:disabled) {
  border-color: var(--ui-color-primary-hover);
}
.storage-actions .storage-move:hover:not(:disabled) {
  background: var(--ui-color-action-hover);
}
.storage-actions button:disabled,
.storage-item button:disabled {
  opacity: 0.45;
  cursor: default;
}
.storage-list {
  display: grid;
  gap: var(--ui-space-1);
}
/* Only nearby groups of rows exist (web/ui/list-window.js); the windows read
   --storage-row-height as the estimate for rows not measured yet. */
.storage-list[data-total-rows] {
  --storage-row-height: 50px;
}
.storage-window-group {
  display: grid;
  gap: var(--ui-space-1);
}
.storage-row {
  display: grid;
  grid-template-columns: 16px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 5px 7px;
  border: 1px solid var(--ui-color-border);
  border-left: 2px solid var(--quality-color, #a58a53);
  background: var(--ui-color-surface);
  color: var(--ui-color-text);
  font-size: 11px;
  cursor: pointer;
}
.storage-row:hover {
  border-color: var(--ui-color-accent-strong);
  background: var(--ui-color-surface-control);
}
.storage-row.selected {
  background: color-mix(
    in srgb,
    var(--ui-color-primary) 12%,
    var(--ui-color-surface)
  );
}
.storage-row .depot-sprite {
  width: 30px;
  height: 30px;
}
.storage-row .depot-sprite :is(.ot-pokemon-icon, img, .pokemon-icon-fallback) {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.storage-equipped {
  cursor: default;
}
.storage-equipped-badge {
  color: var(--ui-color-text);
  font-size: 8px;
  font-weight: 900;
}
.storage-column .section-heading > strong {
  color: var(--ui-color-text-muted);
  font: 600 10px/1.3 var(--ui-font-body);
  text-align: left;
}
.storage-column [data-storage-hidden] {
  display: block;
  color: var(--ui-color-text-muted);
  font-size: 9px;
  font-weight: 600;
}
.storage-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.storage-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.storage-identity small {
  color: var(--ui-color-text-muted);
  font-size: 9px;
}
.storage-identity .quality-badge {
  justify-self: start;
}
.storage-metrics {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--ui-color-text-muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.storage-metrics b {
  color: var(--ui-color-text);
  font-size: 11px;
}
.storage-metrics .ui-icon {
  width: 12px;
  height: 12px;
  color: #f6d979;
}
.storage-item {
  grid-template-columns: 27px minmax(0, 1fr) 70px auto;
  border-left-color: var(--ui-color-border);
  cursor: default;
}
/* Room for a grouped balance up to 999.999.999 without scrolling the field. */
.storage-pokedollars {
  grid-template-columns: 27px minmax(0, 1fr) 96px auto;
}
.storage-item .ot-item-icon,
.storage-item .item-icon-fallback {
  width: 27px;
  height: 27px;
}
.storage-quantity {
  display: grid;
  gap: 2px;
  color: var(--ui-color-text-muted);
  font-size: 8px;
  font-weight: 900;
}
.storage-quantity input {
  width: 100%;
  height: 26px;
  padding: 3px 6px;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius);
  background: var(--ui-color-surface);
  color: var(--ui-color-text);
  font: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.storage-empty {
  margin: 0;
  padding: var(--ui-space-3);
  border: 1px dashed var(--ui-color-border);
  color: var(--ui-color-text-muted);
  font-size: 11px;
  text-align: center;
}
.family-depot-panel :is(button, input):focus-visible {
  outline: 2px solid var(--ui-color-focus);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .storage-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .storage-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container family-storage (max-width: 560px) {
  .storage-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .family-depot-panel .storage-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
