.hfs-unpack-here-dialog .dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: min(88vh, 48rem);
  display: flex;
  flex-direction: column;
}

.hfs-unpack-here-dialog .dialog-content {
  min-height: 0;
  overflow: hidden;
}

.hfs-unpack-picker {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  min-width: 0;
  max-height: 72vh;
}

.hfs-unpack-picker-location {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
  padding: .8rem;
  border: 1px solid var(--panel-border, var(--border, rgba(127,127,127,.28)));
  border-radius: .7rem;
  background: var(--panel-bg, rgba(127,127,127,.06));
}

.hfs-unpack-picker-location-icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  border-radius: .6rem;
  background: var(--button-bg, rgba(127,127,127,.13));
  font-size: 1.25rem;
}

.hfs-unpack-picker-location-icon svg,
.hfs-unpack-picker-location-icon .icon {
  width: 1.4rem;
  height: 1.4rem;
}

.hfs-unpack-picker-location-text {
  min-width: 0;
}

.hfs-unpack-picker-caption,
.hfs-unpack-picker-count,
.hfs-unpack-picker-permission,
.hfs-unpack-picker-note,
.hfs-unpack-picker-no-permission {
  color: var(--text-secondary, var(--secondary, #888));
  font-size: .85rem;
}

.hfs-unpack-picker-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.hfs-unpack-picker-toolbar,
.hfs-unpack-picker-footer,
.hfs-unpack-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}

.hfs-unpack-picker-toolbar {
  min-height: 2.3rem;
}

.hfs-unpack-picker-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-height: 8rem;
  max-height: 42vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: .25rem;
  border: 1px solid var(--panel-border, var(--border, rgba(127,127,127,.24)));
  border-radius: .7rem;
}

.hfs-unpack-picker-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  padding: .3rem;
  border-radius: .5rem;
}

.hfs-unpack-picker-row:hover {
  background: var(--hover-bg, rgba(127,127,127,.1));
}

.hfs-unpack-picker-open,
.hfs-unpack-picker-select,
.hfs-unpack-picker-secondary,
.hfs-unpack-picker-cancel,
.hfs-unpack-picker-confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.35rem;
  padding: .4rem .7rem;
  border: 1px solid var(--button-border, rgba(127,127,127,.28));
  border-radius: .55rem;
  background: var(--button-bg, rgba(127,127,127,.08));
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.hfs-unpack-picker-open {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: 0;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.hfs-unpack-picker-open svg,
.hfs-unpack-picker-open .icon,
.hfs-unpack-picker-confirm svg,
.hfs-unpack-picker-confirm .icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.hfs-unpack-picker-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hfs-unpack-picker-select {
  min-height: 2rem;
  flex: 0 0 auto;
  font-size: .85rem;
}

.hfs-unpack-picker-open:disabled,
.hfs-unpack-picker-select:disabled,
.hfs-unpack-picker-secondary:disabled,
.hfs-unpack-picker-confirm:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.hfs-unpack-picker-empty {
  display: grid;
  place-items: center;
  min-height: 7rem;
  padding: 1rem;
  color: var(--text-secondary, var(--secondary, #888));
  text-align: center;
}

.hfs-unpack-picker-error {
  padding: .65rem .8rem;
  border-radius: .55rem;
  background: rgba(210, 50, 50, .1);
  color: var(--error, #c33);
  overflow-wrap: anywhere;
}

.hfs-unpack-picker-note {
  margin-top: -.45rem;
}

.hfs-unpack-picker-footer {
  align-items: flex-end;
  flex-wrap: wrap;
  padding-top: .2rem;
}

.hfs-unpack-picker-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.hfs-unpack-picker-confirm {
  background: var(--button-bg, var(--background-good, #397b55));
  color: var(--button-color, inherit);
  font-weight: 600;
}

@media (max-width: 600px) {
  .hfs-unpack-picker {
    max-height: 75vh;
  }
  .hfs-unpack-picker-list {
    max-height: 38vh;
  }
  .hfs-unpack-picker-footer {
    align-items: stretch;
  }
  .hfs-unpack-picker-actions {
    width: 100%;
  }
  .hfs-unpack-picker-actions button {
    flex: 1;
  }
}
